Line data Source code
1 : //
2 : // Author: Vladimir Migashko <migashko@gmail.com>, (C) 2013-2015
3 : //
4 : // Copyright: See COPYING file that comes with this distribution
5 : //
6 :
7 : #pragma once
8 :
9 : #include <wfc/domain_object.hpp>
10 : #include "pinger_config.hpp"
11 : #include <pingpong/ipinger.hpp>
12 : #include <pingpong/iponger.hpp>
13 : #include <memory>
14 : #include <string>
15 :
16 :
17 : namespace demo{ namespace pingpong{
18 :
19 0 : class pinger
20 : : public ::wfc::domain_object< ipinger, pinger_config>
21 : , public std::enable_shared_from_this<pinger>
22 : {
23 : typedef std::vector< std::weak_ptr<iponger2> > target_list;
24 : public:
25 : virtual void initialize() override;
26 : virtual void play(ball::ptr, ball::handler) override;
27 : virtual void pong(ball::ptr, ball::handler, io_id_t, ball_handler ) override;
28 : private:
29 : target_list get_target_list() const;
30 : private:
31 : target_list _targets;
32 : mutable std::mutex _mutex;
33 : };
34 :
35 : }}
|