sipxportlib  Version 3.3
OsContact.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2006 Pingtel Corp.
3 //
4 //
5 // $$
8 
9 
10 #ifndef _OsContact_h_
11 #define _OsContact_h_
12 
13 // SYSTEM INCLUDES
14 // APPLICATION INCLUDES
15 #include "utl/UtlContainable.h"
16 #include "utl/UtlString.h"
17 #include "os/OsSocket.h"
18 
19 // DEFINES
20 // MACROS
21 // EXTERNAL FUNCTIONS
22 // EXTERNAL VARIABLES
23 // CONSTANTS
24 // STRUCTS
25 // TYPEDEFS
26 // FORWARD DECLARATIONS
27 
28 /* ============================ ENUMERATIONS ============================== */
33 {
34  IP4,
35  IP6
36 };
37 
45 class OsContact : public UtlContainable
46 {
47 /* //////////////////////////// PUBLIC //////////////////////////////////// */
48 public:
49 
50 /* ============================ FRIENDS =================================== */
51  friend class OsContactTests;
52 
53 /* ============================ ENUMERATIONS ============================== */
54 
55 /* ============================ CREATORS ================================== */
56 
82  OsContact(UtlString address,
83  int port,
85  IpAddressType type);
86 
90  OsContact(const OsContact& ref);
91 
95  virtual ~OsContact();
96 
97 
98 /* ============================ MANIPULATORS ============================== */
99 
100 
101 /* ============================ ACCESSORS ================================= */
105  const void getAddress(UtlString& address) const;
106 
110  const int getPort() const;
111 
116 
120  const IpAddressType getAddressType() const;
121 
127  virtual unsigned hash() const ;
128 
132  virtual UtlContainableType getContainableType() const;
133 
134 /* ============================ INQUIRY =================================== */
135 
142  virtual int compareTo(UtlContainable const *) const ;
143 
148  virtual UtlBoolean isEqual(UtlContainable const *) const ;
149 
150 /* //////////////////////////// PROTECTED ///////////////////////////////// */
151 protected:
154 /* //////////////////////////// PRIVATE /////////////////////////////////// */
155 private:
159  OsContact& operator=(const OsContact&) ;
160 
169  const int compareInt(const int first, const int second) const;
170 
171  UtlString mAddress;
172  int mPort ;
174  IpAddressType mType;
176 } ;
177 
178 /* ============================ INLINE METHODS ============================ */
179 
180 #endif // _OsContact_h_
const IpAddressType getAddressType() const
Definition: OsContact.cpp:70
OsContact(UtlString address, int port, OsSocket::IpProtocolSocketType protocol, IpAddressType type)
Definition: OsContact.cpp:30
const OsSocket::IpProtocolSocketType getProtocol() const
Definition: OsContact.cpp:65
IpProtocolSocketType
Definition: OsSocket.h:92
virtual ~OsContact()
Definition: OsContact.cpp:52
const int getPort() const
Definition: OsContact.cpp:60
Definition: OsContact.h:45
const char *const UtlContainableType
Definition: UtlDefs.h:70
Definition: OsContact.h:34
Definition: UtlContainable.h:37
Definition: UtlString.h:48
virtual UtlContainableType getContainableType() const
Definition: OsContact.cpp:81
static UtlContainableType TYPE
Definition: OsContact.h:152
friend class OsContactTests
Definition: OsContact.h:51
virtual int compareTo(UtlContainable const *) const
Definition: OsContact.cpp:88
int UtlBoolean
Definition: UtlDefs.h:41
Definition: OsContact.h:35
virtual unsigned hash() const
Definition: OsContact.cpp:75
virtual UtlBoolean isEqual(UtlContainable const *) const
Definition: OsContact.cpp:119
const void getAddress(UtlString &address) const
Definition: OsContact.cpp:124
IpAddressType
Definition: OsContact.h:32