sipxportlib  Version 3.3
Public Member Functions | Static Protected Attributes | Friends | List of all members
OsContact Class Reference

#include <OsContact.h>

Inheritance diagram for OsContact:
Inheritance graph
[legend]
Collaboration diagram for OsContact:
Collaboration graph
[legend]

Public Member Functions

 OsContact (UtlString address, int port, OsSocket::IpProtocolSocketType protocol, IpAddressType type)
 
 OsContact (const OsContact &ref)
 
virtual ~OsContact ()
 
const void getAddress (UtlString &address) const
 
const int getPort () const
 
const OsSocket::IpProtocolSocketType getProtocol () const
 
const IpAddressType getAddressType () const
 
virtual unsigned hash () const
 
virtual UtlContainableType getContainableType () const
 
virtual int compareTo (UtlContainable const *) const
 
virtual UtlBoolean isEqual (UtlContainable const *) const
 
- Public Member Functions inherited from UtlContainable
virtual ~UtlContainable ()
 
unsigned directHash () const
 Provides a hash function that uses the object pointer as the hash value. More...
 
virtual UtlBoolean isInstanceOf (const UtlContainableType type) const
 Determine if this object is a derivative of the specified UtlContainableType. More...
 

Static Protected Attributes

static UtlContainableType TYPE = "OsContact"
 

Friends

class OsContactTests
 

Additional Inherited Members

- Static Public Member Functions inherited from UtlContainable
static unsigned stringHash (char const *value)
 Provides a hash function appropriate for null-terminated string values. More...
 
static UtlBoolean areSameTypes (const UtlContainableType type1, const UtlContainableType type2)
 Are UtlContainable types the same. More...
 
- Static Public Attributes inherited from UtlContainable
static const UtlContainableType TYPE = "UtlContainable"
 

Detailed Description

OsContact is a containable object which represents an inter-networking point of contact, which could also be described as a "transport endpoint". It contains an address, a port value, a protocol, and the address type.

Constructor & Destructor Documentation

OsContact ( UtlString  address,
int  port,
OsSocket::IpProtocolSocketType  protocol,
IpAddressType  type 
)

Constructor.

Parameters
addressString representation of the ip address. For IPv4, it should be in "dotted quad" notation. For IPv6, it should use the text representation of addresses specified in RFC 3513.

Note that IP addresses which are sematically identical, but differ in string representation, will be considered as not being equal. (e.g. - a contact having an address "192.168.1.2" will not equal a contact having an address "192.168.001.002".

Note that the current design doesn't allow for IPV4 tunneled over IPV6 to compare correctly with the original IPV4 address.

Note that IP addresses will be compared as strings, so, use of wildcard addresses ("0.0.0.0") will not match any other address.

Parameters
portThe port value for the contact.
protocolThe prefered protocol for this contact.
typeThe type of ip address.
OsContact ( const OsContact ref)

Copy constructor.

~OsContact ( )
virtual

Destructor

Member Function Documentation

const void getAddress ( UtlString address) const

Accessor for the address string.

const int getPort ( ) const

Accessor for the port value.

const OsSocket::IpProtocolSocketType getProtocol ( ) const

Accessor for the protocol enum value.

const IpAddressType getAddressType ( ) const

Accessor for the address type enum value.

unsigned hash ( ) const
virtual

Calculate a unique hash code for this object. If the equals operator returns true for another object, then both of those objects must return the same hashcode.

Implements UtlContainable.

UtlContainableType getContainableType ( ) const
virtual

Get the ContainableType for a UtlContainable derived class.

Implements UtlContainable.

int compareTo ( UtlContainable const *  inVal) const
virtual

Compare the this object to another like-objects. Results for designating a non-like object are undefined.

Returns
0 if equal, < 0 if less then and >0 if greater.

Implements UtlContainable.

UtlBoolean isEqual ( UtlContainable const *  inVal) const
virtual

Test this object to another like-object for equality. This method returns false if unlike-objects are specified.

Reimplemented from UtlContainable.

Friends And Related Function Documentation

friend class OsContactTests
friend

Member Data Documentation

UtlContainableType TYPE = "OsContact"
staticprotected