1 | #ifndef TRANSPORT_PEER_HPP_
|
---|
2 | #define TRANSPORT_PEER_HPP_
|
---|
3 |
|
---|
4 | // ariba
|
---|
5 | #include "ariba/config.h"
|
---|
6 | #include "ariba/utility/logging/Logging.h"
|
---|
7 | #include "ariba/utility/addressing2/endpoint_set.hpp"
|
---|
8 |
|
---|
9 | // ariba interfaces
|
---|
10 | #include "interfaces/transport_protocol.hpp"
|
---|
11 |
|
---|
12 | // boost
|
---|
13 | #include <boost/shared_ptr.hpp>
|
---|
14 |
|
---|
15 | // boost-adaption
|
---|
16 | //#include "rfcomm/bluetooth_rfcomm.hpp"
|
---|
17 |
|
---|
18 |
|
---|
19 | // namespace ariba::transport
|
---|
20 | namespace ariba {
|
---|
21 | namespace transport {
|
---|
22 |
|
---|
23 | /**
|
---|
24 | * This class allocates implementations of various transport
|
---|
25 | * protocols and can send messages to an entire set of endpoints
|
---|
26 | *
|
---|
27 | * @author Sebastian Mies <mies@tm.uka.de>, Mario Hock
|
---|
28 | */
|
---|
29 | class transport_peer :
|
---|
30 | public transport_protocol
|
---|
31 | {
|
---|
32 | use_logging_h(transport_peer);
|
---|
33 | typedef boost::shared_ptr<transport_protocol> TransportProtocolPtr;
|
---|
34 |
|
---|
35 | public:
|
---|
36 | transport_peer();
|
---|
37 |
|
---|
38 | /**
|
---|
39 | * Adds endpoints on which ariba should listen ("server"-sockets)
|
---|
40 | *
|
---|
41 | * @return An endpoint_set holding all active endpoints ariba is listening on.
|
---|
42 | */
|
---|
43 | addressing2::EndpointSetPtr add_listenOn_endpoints(addressing2::EndpointSetPtr endpoints);
|
---|
44 |
|
---|
45 | virtual ~transport_peer();
|
---|
46 | virtual void start();
|
---|
47 | virtual void stop();
|
---|
48 |
|
---|
49 | virtual void send(
|
---|
50 | const addressing2::const_EndpointSetPtr endpoints,
|
---|
51 | reboost::message_t message,
|
---|
52 | uint8_t priority = system_priority::OVERLAY);
|
---|
53 |
|
---|
54 | virtual void register_listener( transport_listener* listener );
|
---|
55 |
|
---|
56 |
|
---|
57 | private:
|
---|
58 | addressing2::EndpointSetPtr local;
|
---|
59 | std::vector<TransportProtocolPtr> transport_streams;
|
---|
60 | };
|
---|
61 |
|
---|
62 | }} // namespace ariba::transport
|
---|
63 |
|
---|
64 | #endif /* TRANSPORT_PEER_HPP_ */
|
---|