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