[5284] | 1 | #ifndef TRANSPORT_PEER_HPP_
|
---|
| 2 | #define TRANSPORT_PEER_HPP_
|
---|
| 3 |
|
---|
[7464] | 4 | #include "ariba/config.h"
|
---|
[5284] | 5 | #include "transport_protocol.hpp"
|
---|
[5993] | 6 | #include "ariba/utility/addressing/endpoint_set.hpp"
|
---|
[10653] | 7 | #include <boost/shared_ptr.hpp>
|
---|
| 8 | #include "rfcomm/bluetooth_rfcomm.hpp"
|
---|
[5284] | 9 |
|
---|
[10653] | 10 |
|
---|
[5284] | 11 | // namespace ariba::transport
|
---|
| 12 | namespace ariba {
|
---|
| 13 | namespace transport {
|
---|
| 14 |
|
---|
| 15 | using namespace ariba::addressing;
|
---|
| 16 |
|
---|
| 17 | class tcpip;
|
---|
[10653] | 18 |
|
---|
[7041] | 19 | #ifdef HAVE_LIBBLUETOOTH
|
---|
[10653] | 20 | class rfcomm_transport;
|
---|
[7041] | 21 | #endif
|
---|
[5284] | 22 |
|
---|
| 23 | /**
|
---|
| 24 | * TODO: Doc
|
---|
| 25 | *
|
---|
| 26 | * @author Sebastian Mies <mies@tm.uka.de>
|
---|
| 27 | */
|
---|
[9324] | 28 | /// this transport peer allocates implementations of various transport
|
---|
| 29 | /// protocols and can send messages to an entire set of endpoints
|
---|
[5284] | 30 | class transport_peer : public transport_protocol {
|
---|
| 31 | public:
|
---|
| 32 | transport_peer( endpoint_set& local_set );
|
---|
| 33 | virtual ~transport_peer();
|
---|
| 34 | virtual void start();
|
---|
| 35 | virtual void stop();
|
---|
[10653] | 36 |
|
---|
| 37 | virtual void send(
|
---|
| 38 | const endpoint_set& endpoints,
|
---|
| 39 | reboost::message_t message,
|
---|
| 40 | uint8_t priority = 0);
|
---|
| 41 |
|
---|
| 42 | /// @deprecated: Use terminate() from transport_connection instead
|
---|
[5614] | 43 | virtual void terminate( const address_v* remote );
|
---|
[10653] | 44 |
|
---|
[5284] | 45 | virtual void register_listener( transport_listener* listener );
|
---|
| 46 |
|
---|
| 47 | private:
|
---|
[10653] | 48 | void create_service(tcp::endpoint endp);
|
---|
| 49 | #ifdef HAVE_LIBBLUETOOTH
|
---|
| 50 | void create_service(boost::asio::bluetooth::rfcomm::endpoint endp);
|
---|
| 51 | #endif
|
---|
| 52 |
|
---|
[5284] | 53 | endpoint_set& local;
|
---|
[10653] | 54 | std::vector< boost::shared_ptr<tcpip> > tcps;
|
---|
[7041] | 55 | #ifdef HAVE_LIBBLUETOOTH
|
---|
[10653] | 56 | std::vector< boost::shared_ptr<rfcomm_transport> > rfcomms;
|
---|
[7041] | 57 | #endif
|
---|
[5284] | 58 | };
|
---|
| 59 |
|
---|
| 60 | }} // namespace ariba::transport
|
---|
| 61 |
|
---|
| 62 | #endif /* TRANSPORT_PEER_HPP_ */
|
---|