fipa_services
Connection.hpp
Go to the documentation of this file.
1 #ifndef FIPA_SERVICES_TRANSPORTS_CONNECTION_HPP
2 #define FIPA_SERVICES_TRANSPORTS_CONNECTION_HPP
3 
4 #include <fipa_services/transports/Address.hpp>
5 
6 namespace fipa {
7 namespace services {
8 namespace transports {
9 
16 {
17 protected:
19 public:
20  Connection();
21  Connection(const std::string& ip, uint16_t port, const std::string& protocol = "udt");
22  Connection(const Address& address);
23 
24  uint16_t getPort() const { return mAddress.port; }
25  std::string getIP() const { return mAddress.ip; }
26 
27  Address getAddress() const { return mAddress; }
28 
29  bool operator==(const Connection& other) const { return mAddress == other.mAddress; }
30 };
31 
32 } // end namespace transports
33 } // end namespace services
34 } // end namespace fipa
35 #endif // FIPA_SERVICES_TRANSPORTS_CONNECTION_HPP
std::string ip
Definition: Address.hpp:17
uint16_t port
Definition: Address.hpp:18
A connection is defined by a communication address.
Definition: Connection.hpp:15
uint16_t getPort() const
Definition: Connection.hpp:24
Communication address specified by IP, port, and protocol.
Definition: Address.hpp:15
Address mAddress
Definition: Connection.hpp:18
std::string getIP() const
Definition: Connection.hpp:25
Address getAddress() const
Definition: Connection.hpp:27
bool operator==(const Connection &other) const
Definition: Connection.hpp:29
Connection()
Definition: Connection.cpp:8
Definition: DistributedServiceDirectory.cpp:5