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

Process t= (start/stop time) lines in SDP. More...

#include <SdpContents.hxx>

List of all members.

Classes

class  Repeat
 Repeat time. More...

Public Member Functions

 Time (unsigned long start, unsigned long stop)
 Constructor.
 Time (const Time &rhs)
Timeoperator= (const Time &rhs)
void parse (ParseBuffer &pb)
EncodeStreamencode (EncodeStream &) const
void addRepeat (const Repeat &repeat)
unsigned long getStart () const
 return the start time
unsigned long getStop () const
 return the stop time
const std::list< Repeat > & getRepeats () const

Private Member Functions

 Time ()

Private Attributes

unsigned long mStart
unsigned long mStop
std::list< RepeatmRepeats

Friends

class Session

Detailed Description

Process t= (start/stop time) lines in SDP.

Definition at line 440 of file SdpContents.hxx.


Constructor & Destructor Documentation

SdpContents::Session::Time::Time ( unsigned long  start,
unsigned long  stop 
)

Constructor.

The times given are the decimal part of an NTP timestamp. To convert these values to UNIX time, subtract decimal 2208988800 from the value.

Parameters:
startstart time
stopstop time

Definition at line 631 of file SdpContents.cxx.

   : mStart(start),
     mStop(stop)
{}
SdpContents::Session::Time::Time ( const Time rhs)

Definition at line 637 of file SdpContents.cxx.

   : mStart(rhs.mStart),
     mStop(rhs.mStop)
{}
resip::SdpContents::Session::Time::Time ( ) [inline, private]

Definition at line 500 of file SdpContents.hxx.

{}

Member Function Documentation

void SdpContents::Session::Time::addRepeat ( const Repeat repeat)

Definition at line 689 of file SdpContents.cxx.

{
   mRepeats.push_back(repeat);
}
EncodeStream & SdpContents::Session::Time::encode ( EncodeStream s) const

Definition at line 655 of file SdpContents.cxx.

References CRLF, and resip::Symbols::SPACE.

{
   s << "t=" << mStart << Symbols::SPACE[0]
     << mStop
     << Symbols::CRLF;

   for (list<Repeat>::const_iterator i = mRepeats.begin();
        i != mRepeats.end(); ++i)
   {
      i->encode(s);
   }
   return s;
}
const std::list<Repeat>& resip::SdpContents::Session::Time::getRepeats ( ) const [inline]

Definition at line 497 of file SdpContents.hxx.

References mRepeats.

{return mRepeats;}
unsigned long resip::SdpContents::Session::Time::getStart ( ) const [inline]

return the start time

Returns:
start time

Definition at line 491 of file SdpContents.hxx.

References mStart.

{return mStart;}
unsigned long resip::SdpContents::Session::Time::getStop ( ) const [inline]

return the stop time

Returns:
stop time

Definition at line 496 of file SdpContents.hxx.

References mStop.

{return mStop;}
SdpContents::Session::Time & SdpContents::Session::Time::operator= ( const Time rhs)

Definition at line 643 of file SdpContents.cxx.

References mRepeats, mStart, and mStop.

{
   if (this != &rhs)
   {
      mStart = rhs.mStart;
      mStop = rhs.mStop;
      mRepeats = rhs.mRepeats;
   }
   return *this;
}
void SdpContents::Session::Time::parse ( ParseBuffer pb)

Definition at line 670 of file SdpContents.cxx.

References resip::ParseBuffer::eof(), resip::Symbols::EQUALS, resip::ParseBuffer::position(), resip::ParseBuffer::skipChar(), skipEol(), resip::Symbols::SPACE, and resip::ParseBuffer::uInt32().

{
   pb.skipChar('t');
   pb.skipChar(Symbols::EQUALS[0]);

   mStart = pb.uInt32();
   pb.skipChar(Symbols::SPACE[0]);
   mStop = pb.uInt32();

   skipEol(pb);

   while (!pb.eof() && *pb.position() == 'r')
   {
      addRepeat(Repeat());
      mRepeats.back().parse(pb);
   }
}

Here is the call graph for this function:


Friends And Related Function Documentation

friend class Session [friend]

Definition at line 505 of file SdpContents.hxx.


Member Data Documentation

Definition at line 503 of file SdpContents.hxx.

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

Definition at line 501 of file SdpContents.hxx.

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

Definition at line 502 of file SdpContents.hxx.

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


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