close Warning: Can't use blame annotator:
No changeset 11381 in the repository

source: source/ariba/utility/addressing2/endpoint_set.hpp@ 12458

Last change on this file since 12458 was 12060, checked in by hock@…, 11 years ago

Reintegrate branch: 20130111-hock-message_classes

improvements:

  • new message classes (reboost, zero-copy)
  • "fast path" for direct links (skip overlay layer)
  • link-properties accessible from the application
  • SystemQueue can call boost::bind functions
  • protlib compatibility removed (32bit overhead saved in every message)
  • addressing2
  • AddressDiscovery discoveres only addresses on which we're actually listening
  • ariba serialization usage reduced (sill used in OverlayMsg)
  • Node::connect, easier and cleaner interface to start-up ariba from the application
  • ariba configs via JSON, XML, etc (boost::property_tree)
  • keep-alive overhead greatly reduced
  • (relayed) overlay links can actually be closed now
  • lost messages are detected in most cases
  • notification to the application when link is transformed into direct-link
  • overlay routing: send message to second best hop if it would be dropped otherwise
  • SequenceNumbers (only mechanisms, so for: upward compatibility)
  • various small fixes


regressions:

  • bluetooth is not yet working again
  • bootstrap modules deactivated
  • liblog4xx is not working (use cout-logging)

This patch brings great performance and stability improvements at cost of backward compatibility.
Also bluetooth and the bootstrap modules have not been ported to the new interfaces, yet.

File size: 2.6 KB
RevLine 
1/*
2 * endpoint_set.hpp
3 *
4 * Created on: 27.03.2013
5 * Author: mario
6 */
7
8#ifndef ENDPOINT_SET_HPP_
9#define ENDPOINT_SET_HPP_
10
11// ariba
12#include "endpoint.hpp"
13#include "ariba/utility/transport/messages/shared_buffer.hpp"
14
15// boost
16#include <boost/shared_ptr.hpp>
17#include <boost/property_tree/ptree.hpp>
18
19// system
20#include <vector>
21#include <stdexcept>
22
23namespace ariba {
24
25using boost::property_tree::ptree;
26using boost::shared_ptr;
27
28namespace addressing2 {
29
30/// forward declarations
31class tcpip_endpoint;
32
33/**
34 * Holds a number of endpoints. (Usually of one particular node.)
35 */
36class endpoint_set
37{
38public:
39
40 // factories
41 static shared_ptr<endpoint_set> create_EndpointSet(const boost::property_tree::ptree& pt);
42// static shared_ptr<endpoint_set> create_EndpointSet(const std::string& str);
43 static shared_ptr<endpoint_set> create_EndpointSet();
44
45 endpoint_set();
46
47// endpoint_set(const std::string& str);
48 endpoint_set(const boost::property_tree::ptree& pt);
49 virtual ~endpoint_set();
50
51
52 /**
53 * Adds an endpoint to this set.
54 *
55 * (Ignores duplicates)
56 */
57 void add_endpoint(EndpointPtr endpoint);
58
59 /**
60 * Adds all endpoints from the given set to this set.
61 *
62 * (Ignores duplicates)
63 */
64 void add_endpoints(const boost::shared_ptr<endpoint_set> endpoints);
65
66 /**
67 * @return Human readable string representation of this endpoint-set.
68 */
69 std::string to_string() const;
70
71 /**
72 * @return a vector of all tcpip_endpoints in this set
73 */
74 const std::vector<shared_ptr<tcpip_endpoint> >& get_tcpip_endpoints() const;
75
76 /**
77 * This function serializes this endpoint_set with all its endpoints
78 * into a shared buffer, which then can be sent to another node.
79 *
80 * @return A byte-representation of this set saved into a shared_buffer.
81 */
82 reboost::shared_buffer_t serialize() const;
83
84 /**
85 * Recreates an endpoint_set from a shared buffer.
86 *
87 * ---> Complementary to »endpoint_set::serialize_into_shared_buffer()«
88 *
89 * @return remaining sub-buffer
90 */
91 reboost::shared_buffer_t deserialize(reboost::shared_buffer_t buff);
92
93
94 /**
95 * @return total number of endpoints in this set
96 */
97 int count() const
98 {
99 return tcpip_endpoints.size();
100 }
101
102private:
103 std::vector<shared_ptr<tcpip_endpoint> > tcpip_endpoints;
104};
105
106typedef boost::shared_ptr<endpoint_set> EndpointSetPtr;
107typedef boost::shared_ptr<const endpoint_set> const_EndpointSetPtr;
108
109}} /* namespace addressing2::ariba */
110#endif /* ENDPOINT_SET_HPP_ */
Note: See TracBrowser for help on using the repository browser.