source: source/ariba/utility/transport/transport_peer.hpp@ 10767

Last change on this file since 10767 was 10700, checked in by Michael Tänzer, 12 years ago

Merge CMake branch into trunk

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