IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
SocketDesc.h
1 // SocketDesc.h:
3 // -----------
4 //
14 
15 #ifndef __IPSDKCOMM_SOCKETDESC_H__
16 #define __IPSDKCOMM_SOCKETDESC_H__
17 
18 // suppression warnings
19 // warning C4251: 'ipsdk::tcpip::SocketDesc::_peerType' : class
20 // 'ipsdk::tcpip::ePeerType' needs to have dll-interface to be used by clients
21 // of class 'ipsdk::tcpip::SocketDesc'
22 #pragma warning (push)
23 #pragma warning (disable : 4251)
24 
26 #include <IPSDKComm/TcpIp/EndPoint.h>
27 #include <IPSDKComm/TcpIp/Types.h>
28 
29 namespace ipsdk {
30 namespace tcpip {
31 
34 
36 {
37 public:
40  SocketDesc(const Guid& guid,
41  const ePeerType& type,
42  const EndPoint& local,
43  const EndPoint& remote)
44  : _guid(guid), _peerType(type), _local(local), _remote(remote)
45  {
46  }
47 
48  ~SocketDesc()
49  {
50  }
52 
53 
54 // methods
55 public:
56 
58  const Guid& guid() const { return _guid; }
59 
61  const ePeerType& type() const { return _peerType; }
62 
64  const EndPoint& local() const { return _local; }
65 
67  const EndPoint& remote() const { return _remote; }
68 
70  unsigned short listenPort() const;
71 
73  bool operator<(const SocketDesc& other) { return _guid < other._guid; }
74 
75 // attributes
76 protected:
79 
82 
85 
88 };
89 
92 
93 } // end of namespace tpcip
94 } // end of namespace ipsdk
95 
96 #pragma warning (pop)
97 
98 #endif // __IPSDKCORE_SOCKETDESC_H__
const EndPoint & remote() const
Definition: SocketDesc.h:67
EndPoint _remote
remote end point
Definition: SocketDesc.h:87
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
serializable overlay of boost::asio::endpoint
Definition: EndPoint.h:34
Guid _guid
unique identifier of the peer
Definition: SocketDesc.h:78
Definition of import/export macro for library.
const ePeerType & type() const
Definition: SocketDesc.h:61
ePeerType
Enumerate TCP/IP peer type (client or serveur.
Definition: Types.h:50
const EndPoint & local() const
Definition: SocketDesc.h:64
Class encapsulating an auto initialized uuid.
Definition: Guid.h:27
Definition: SocketDesc.h:35
Predefined types for ip addresses management.
#define IPSDKCOMM_API
Import/Export macro for library IPSDKComm.
Definition: IPSDKCommExports.h:25
EndPoint _local
local end point
Definition: SocketDesc.h:84
ePeerType _peerType
peer type (client or server)
Definition: SocketDesc.h:81
const Guid & guid() const
Definition: SocketDesc.h:58
bool operator<(const SocketDesc &other)
Definition: SocketDesc.h:73