Rev 1319 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 1319 | Rev 1403 | ||
|---|---|---|---|
| Line 12... | Line 12... | ||
| 12 | #include <boost/make_shared.hpp> |
12 | #include <boost/make_shared.hpp> |
| 13 | #include "message/Message.h" |
13 | #include "message/Message.h" |
| 14 | #include "log/Logger.h" |
14 | #include "log/Logger.h" |
| 15 | 15 | ||
| 16 | namespace atom { |
16 | namespace atom { |
| 17 | namespace broker { |
- | |
| 18 | - | ||
| 19 | using namespace std; |
- | |
| 20 | using namespace message; |
- | |
| 21 | 17 | ||
| 22 | class Broker |
18 | class Broker |
| 23 | { |
19 | { |
| 24 | typedef boost::signal<void(Message::pointer message)> OnMessageSignal; |
- | |
| 25 | - | ||
| 26 | public: |
20 | public: |
| 27 | typedef boost::shared_ptr<Broker> |
21 | typedef boost::shared_ptr<Broker> Pointer; |
| 28 | 22 | ||
| 29 | ~Broker(); |
23 | ~Broker(); |
| 30 | 24 | ||
| 31 | void |
25 | void Connect(const Signal_OnMessage::slot_type &slot); |
| 32 | void |
26 | void Put(Message::Pointer message); |
| 33 | 27 | ||
| 34 | static |
28 | static Pointer GetInstance(); |
| 35 | 29 | ||
| 36 | private: |
30 | private: |
| 37 |
|
31 | typedef boost::signal<void(Message::pointer message)> Signal_OnMessage; |
| 38 | 32 | ||
| - | 33 | Broker(); |
|
| - | 34 | ||
| 39 |
|
35 | Signal_OnMessage OnMessage; |
| 40 | 36 | ||
| 41 | log::Logger LOG; |
37 | log::Logger LOG; |
| 42 | 38 | ||
| 43 |
|
39 | static Pointer instance_; |
| - | 40 | ||
| - | 41 | ||
| 44 | }; |
42 | }; |
| 45 | 43 | ||
| 46 | } |
44 | } // namespace atom |
| 47 | } |
45 | |
| 48 | #endif /* BROKER_H_ */ |
46 | #endif /* BROKER_H_ */ |