reSIProcate/stack  9694
Public Member Functions | Private Member Functions | Private Attributes | Friends
resip::SdpContents::Session::Origin Class Reference

processes o= lines in SDP More...

#include <SdpContents.hxx>

Collaboration diagram for resip::SdpContents::Session::Origin:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Origin (const Data &user, const UInt64 &sessionId, const UInt64 &version, AddrType addr, const Data &address)
 constructor for origin line
 Origin (const Origin &rhs)
Originoperator= (const Origin &rhs)
void parse (ParseBuffer &pb)
EncodeStreamencode (EncodeStream &) const
const UInt64getSessionId () const
 returns the session ID
UInt64getSessionId ()
 returns the session ID
const UInt64getVersion () const
 returns the session version
UInt64getVersion ()
 returns the session version
const Datauser () const
 returns the user string for the session
Datauser ()
 returns the user string for the session
AddrType getAddressType () const
 returns the session address type
const DatagetAddress () const
 returns the session address type
void setAddress (const Data &host, AddrType type=IP4)
 set the address for the session

Private Member Functions

 Origin ()

Private Attributes

Data mUser
UInt64 mSessionId
UInt64 mVersion
AddrType mAddrType
Data mAddress

Friends

class Session

Detailed Description

processes o= lines in SDP

Definition at line 170 of file SdpContents.hxx.


Constructor & Destructor Documentation

SdpContents::Session::Origin::Origin ( const Data user,
const UInt64 sessionId,
const UInt64 version,
AddrType  addr,
const Data address 
)

constructor for origin line

Parameters:
usersession user
sessionIdsession ID
versionsession version
addrsession address type (IP4 or IP6)
addressIP address of the session

Definition at line 253 of file SdpContents.cxx.

   : mUser(user),
     mSessionId(sessionId),
     mVersion(version),
     mAddrType(addr),
     mAddress(address)
{}
SdpContents::Session::Origin::Origin ( const Origin rhs)

Definition at line 229 of file SdpContents.cxx.

   : mUser(rhs.mUser),
     mSessionId(rhs.mSessionId),
     mVersion(rhs.mVersion),
     mAddrType(rhs.mAddrType),
     mAddress(rhs.mAddress)
{
}
SdpContents::Session::Origin::Origin ( ) [private]

Definition at line 221 of file SdpContents.cxx.


Member Function Documentation

EncodeStream & SdpContents::Session::Origin::encode ( EncodeStream s) const

Definition at line 266 of file SdpContents.cxx.

References CRLF, resip::SdpContents::Session::mVersion, NetworkType, and resip::Symbols::SPACE.

{
   s << "o="
     << mUser << Symbols::SPACE[0]
     << mSessionId << Symbols::SPACE[0]
     << mVersion << Symbols::SPACE[0]
     << "IN "
     << NetworkType[mAddrType] << Symbols::SPACE[0]
     << mAddress << Symbols::CRLF;
   return s;
}
const Data& resip::SdpContents::Session::Origin::getAddress ( ) const [inline]

returns the session address type

Returns:
address type (IP4 or IP6)

Definition at line 228 of file SdpContents.hxx.

References mAddress.

{return mAddress;}
AddrType resip::SdpContents::Session::Origin::getAddressType ( ) const [inline]

returns the session address type

Returns:
address type (IP4 or IP6)

Definition at line 223 of file SdpContents.hxx.

References mAddrType.

{return mAddrType;}
const UInt64& resip::SdpContents::Session::Origin::getSessionId ( ) const [inline]

returns the session ID

Returns:
session ID

Definition at line 196 of file SdpContents.hxx.

References mSessionId.

{return mSessionId;}
UInt64& resip::SdpContents::Session::Origin::getSessionId ( ) [inline]

returns the session ID

Returns:
session ID

Definition at line 200 of file SdpContents.hxx.

References mSessionId.

{ return mSessionId; }
const UInt64& resip::SdpContents::Session::Origin::getVersion ( ) const [inline]

returns the session version

Returns:
session version

Definition at line 205 of file SdpContents.hxx.

References mVersion.

{return mVersion;}
UInt64& resip::SdpContents::Session::Origin::getVersion ( ) [inline]

returns the session version

Returns:
session version

Definition at line 209 of file SdpContents.hxx.

References mVersion.

{ return mVersion; }
SdpContents::Session::Origin & SdpContents::Session::Origin::operator= ( const Origin rhs)

Definition at line 239 of file SdpContents.cxx.

References mAddress, mAddrType, mSessionId, mUser, mVersion, and resip::SdpContents::Session::mVersion.

{
   if (this != &rhs)
   {
      mUser = rhs.mUser;
      mSessionId = rhs.mSessionId;
      mVersion = rhs.mVersion;
      mAddrType = rhs.mAddrType;
      mAddress = rhs.mAddress;
   }
   return *this;
}
void SdpContents::Session::Origin::parse ( ParseBuffer pb)

Definition at line 286 of file SdpContents.cxx.

References resip::Symbols::CRLF, resip::ParseBuffer::data(), resip::Symbols::EQUALS, resip::SdpContents::IP4, resip::SdpContents::IP6, resip::SdpContents::Session::mVersion, NetworkType, resip::ParseBuffer::skipChar(), skipEol(), resip::ParseBuffer::skipToChar(), resip::ParseBuffer::skipToOneOf(), resip::Symbols::SPACE, resip::ParseBuffer::uInt64(), and WarningLog.

{
   pb.skipChar('o');
   const char* anchor = pb.skipChar(Symbols::EQUALS[0]);

   pb.skipToChar(Symbols::SPACE[0]);
   pb.data(mUser, anchor);

   anchor = pb.skipChar(Symbols::SPACE[0]);
   try
   {
      mSessionId = pb.uInt64();
   }
   catch(ParseException& e)
   {
       WarningLog(<< "Exception parsing origin sessionid: " << e);
   }
   pb.skipToChar(Symbols::SPACE[0]);

   anchor = pb.skipChar(Symbols::SPACE[0]);
   try
   {
      mVersion = pb.uInt64();
   }
   catch(ParseException& e)
   {
       WarningLog(<< "Exception parsing origin version: " << e);
   }
   pb.skipToChar(Symbols::SPACE[0]);

   pb.skipChar(Symbols::SPACE[0]);
   pb.skipChar('I');
   pb.skipChar('N');

   anchor = pb.skipChar(Symbols::SPACE[0]);
   pb.skipToChar(Symbols::SPACE[0]);
   Data addrType;
   pb.data(addrType, anchor);
   if (addrType == NetworkType[IP4])
   {
      mAddrType = IP4;
   }
   else if (addrType == NetworkType[IP6])
   {
      mAddrType = IP6;
   }
   else
   {
      mAddrType = static_cast<AddrType>(0);
   }

   anchor = pb.skipChar(Symbols::SPACE[0]);
   pb.skipToOneOf(Symbols::CRLF);
   pb.data(mAddress, anchor);

   skipEol(pb);
}

Here is the call graph for this function:

void SdpContents::Session::Origin::setAddress ( const Data host,
AddrType  type = IP4 
)

set the address for the session

Parameters:
hostIP address to associate with the session
typetype of addressing

Definition at line 279 of file SdpContents.cxx.

{
    mAddress = host;
    mAddrType = addr;
}
const Data& resip::SdpContents::Session::Origin::user ( ) const [inline]

returns the user string for the session

Returns:
user string

Definition at line 213 of file SdpContents.hxx.

References mUser.

{return mUser;}
Data& resip::SdpContents::Session::Origin::user ( ) [inline]

returns the user string for the session

Returns:
user string

Definition at line 217 of file SdpContents.hxx.

References mUser.

{return mUser;}

Friends And Related Function Documentation

friend class Session [friend]

Definition at line 246 of file SdpContents.hxx.


Member Data Documentation

Definition at line 244 of file SdpContents.hxx.

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

Definition at line 243 of file SdpContents.hxx.

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

Definition at line 241 of file SdpContents.hxx.

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

Definition at line 240 of file SdpContents.hxx.

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

Definition at line 242 of file SdpContents.hxx.

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


The documentation for this class was generated from the following files: