reSIProcate/stack  9694
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Friends
resip::IntegerParameter Class Reference

Generically represents integer values conveyed by SIP parameters. More...

#include <IntegerParameter.hxx>

Inheritance diagram for resip::IntegerParameter:
Inheritance graph
[legend]
Collaboration diagram for resip::IntegerParameter:
Collaboration graph
[legend]

List of all members.

Public Types

typedef int Type

Public Member Functions

 IntegerParameter (ParameterTypes::Type, ParseBuffer &pb, const std::bitset< 256 > &terminators)
 IntegerParameter (ParameterTypes::Type type, int value=-666999666)
virtual EncodeStreamencode (EncodeStream &stream) const
virtual Parameterclone () const

Static Public Member Functions

static Parameterdecode (ParameterTypes::Type type, ParseBuffer &pb, const std::bitset< 256 > &terminators, PoolBase *pool)

Private Member Functions

Typevalue ()

Private Attributes

int mValue

Friends

class ParserCategory
class Uri

Detailed Description

Generically represents integer values conveyed by SIP parameters.

Definition at line 20 of file IntegerParameter.hxx.


Member Typedef Documentation

Definition at line 23 of file IntegerParameter.hxx.


Constructor & Destructor Documentation

IntegerParameter::IntegerParameter ( ParameterTypes::Type  type,
ParseBuffer pb,
const std::bitset< 256 > &  terminators 
)

Definition at line 13 of file IntegerParameter.cxx.

References resip::ParseBuffer::assertNotEof(), resip::Symbols::EQUALS, resip::ParseBuffer::integer(), mValue, resip::ParseBuffer::ParamTerm, resip::ParseBuffer::skipChar(), resip::ParseBuffer::skipToOneOf(), and resip::ParseBuffer::skipWhitespace().

Referenced by clone(), and decode().

   : Parameter(type),
     mValue(0)
{
   pb.skipWhitespace();
   pb.skipChar(Symbols::EQUALS[0]);
   pb.skipWhitespace();
   pb.assertNotEof();
   
   // hack to allow expires to have an 2543 style quoted Date
   if (type == ParameterTypes::expires)
   {
      try
      {
         mValue = pb.integer();
      }
      catch (ParseException&)
      {
         mValue = 3600;
         pb.skipToOneOf(ParseBuffer::ParamTerm);
      }
      
      if(mValue < 0)
      {
         mValue = 3600;
      }
   }
   else
   {
      mValue = pb.integer();
   }
}

Here is the call graph for this function:

IntegerParameter::IntegerParameter ( ParameterTypes::Type  type,
int  value = -666999666 
) [explicit]

Definition at line 48 of file IntegerParameter.cxx.


Member Function Documentation

Parameter * IntegerParameter::clone ( ) const [virtual]

Implements resip::Parameter.

Definition at line 54 of file IntegerParameter.cxx.

References IntegerParameter().

{
   return new IntegerParameter(*this);
}

Here is the call graph for this function:

static Parameter* resip::IntegerParameter::decode ( ParameterTypes::Type  type,
ParseBuffer pb,
const std::bitset< 256 > &  terminators,
PoolBase pool 
) [inline, static]

Definition at line 28 of file IntegerParameter.hxx.

References IntegerParameter().

      {
         return new (pool) IntegerParameter(type, pb, terminators);
      }

Here is the call graph for this function:

EncodeStream & IntegerParameter::encode ( EncodeStream stream) const [virtual]

Implements resip::Parameter.

Definition at line 60 of file IntegerParameter.cxx.

References resip::Symbols::EQUALS, resip::Parameter::getName(), and mValue.

{
   return stream << getName() << Symbols::EQUALS << mValue;
}

Here is the call graph for this function:

Type& resip::IntegerParameter::value ( ) [inline, private]

Definition at line 42 of file IntegerParameter.hxx.

References mValue.

{return mValue;}

Friends And Related Function Documentation

friend class ParserCategory [friend]

Definition at line 40 of file IntegerParameter.hxx.

friend class Uri [friend]

Definition at line 41 of file IntegerParameter.hxx.


Member Data Documentation

Definition at line 44 of file IntegerParameter.hxx.

Referenced by encode(), IntegerParameter(), and value().


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