NetAddress Class Reference

#include <NetAddress.hh>


Public Member Functions

 NetAddress (u_int8_t const *data, unsigned length=4)
 NetAddress (unsigned length=4)
 NetAddress (NetAddress const &orig)
NetAddressoperator= (NetAddress const &rightSide)
virtual ~NetAddress ()
unsigned length () const
u_int8_t const * data () const

Private Member Functions

void assign (u_int8_t const *data, unsigned length)
void clean ()

Private Attributes

unsigned fLength
u_int8_t * fData


Detailed Description

Definition at line 41 of file NetAddress.hh.


Constructor & Destructor Documentation

NetAddress::NetAddress ( u_int8_t const *  data,
unsigned  length = 4 
)

Definition at line 36 of file NetAddress.cpp.

References assign().

00036                                                             {
00037   assign(data, length);
00038 }

NetAddress::NetAddress ( unsigned  length = 4  ) 

Definition at line 40 of file NetAddress.cpp.

References fData, fLength, and NULL.

00040                                       {
00041   fData = new u_int8_t[length];
00042   if (fData == NULL) {
00043     fLength = 0;
00044     return;
00045   }
00046 
00047   for (unsigned i = 0; i < length; ++i) fData[i] = 0;
00048   fLength = length;
00049 }

NetAddress::NetAddress ( NetAddress const &  orig  ) 

Definition at line 51 of file NetAddress.cpp.

References assign(), data(), and length().

00051                                              {
00052   assign(orig.data(), orig.length());
00053 }

NetAddress::~NetAddress (  )  [virtual]

Definition at line 63 of file NetAddress.cpp.

References clean().

00063                         {
00064   clean();
00065 }


Member Function Documentation

NetAddress & NetAddress::operator= ( NetAddress const &  rightSide  ) 

Definition at line 55 of file NetAddress.cpp.

References assign(), clean(), data(), and length().

00055                                                              {
00056   if (&rightSide != this) {
00057     clean();
00058     assign(rightSide.data(), rightSide.length());
00059   }
00060   return *this;
00061 }

unsigned NetAddress::length (  )  const [inline]

Definition at line 50 of file NetAddress.hh.

References fLength.

Referenced by NetAddress(), and operator=().

00050 { return fLength; }

u_int8_t const* NetAddress::data (  )  const [inline]

Definition at line 51 of file NetAddress.hh.

References fData.

Referenced by MediaSubsession::connectionEndpointAddress(), getSDPDescription(), main(), NetAddress(), RTSPClient::openConnection(), operator=(), ourIPAddress(), parseSourceFilterAttribute(), SIPClient::processURL(), DarwinInjector::setDestination(), and RTSPClient::setRequestFields().

00052                 { return fData; }

void NetAddress::assign ( u_int8_t const *  data,
unsigned  length 
) [private]

Definition at line 67 of file NetAddress.cpp.

References fData, fLength, and NULL.

Referenced by NetAddress(), and operator=().

00067                                                              {
00068   fData = new u_int8_t[length];
00069   if (fData == NULL) {
00070     fLength = 0;
00071     return;
00072   }
00073 
00074   for (unsigned i = 0; i < length; ++i) fData[i] = data[i];
00075   fLength = length;
00076 }

void NetAddress::clean (  )  [private]

Definition at line 78 of file NetAddress.cpp.

References fData, fLength, and NULL.

Referenced by operator=(), and ~NetAddress().

00078                        {
00079   delete[] fData; fData = NULL;
00080   fLength = 0;
00081 }


Field Documentation

unsigned NetAddress::fLength [private]

Definition at line 58 of file NetAddress.hh.

Referenced by assign(), clean(), length(), and NetAddress().

u_int8_t* NetAddress::fData [private]

Definition at line 59 of file NetAddress.hh.

Referenced by assign(), clean(), data(), and NetAddress().


The documentation for this class was generated from the following files:
Generated on Tue Mar 25 14:40:19 2014 for live by  doxygen 1.5.2