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

Represents the "q" parameter value of the RFC 3261 grammar. More...

#include <QValueParameter.hxx>

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

List of all members.

Public Types

typedef QValue Type

Public Member Functions

 QValueParameter (ParameterTypes::Type, ParseBuffer &pb, const std::bitset< 256 > &terminators)
 constructor
 QValueParameter (ParameterTypes::Type type)
 constructor creates object and sets q value to zero
virtual Parameterclone () const
 creates a new QValueParameter object that is a copy of this one.
virtual EncodeStreamencode (EncodeStream &stream) const
 returns "q=3" or equivalent in the stream it receives
Typevalue ()
int qval () const

Static Public Member Functions

static Parameterdecode (ParameterTypes::Type type, ParseBuffer &pb, const std::bitset< 256 > &terminators, PoolBase *pool)
 creates a QValueParameter object and returns a pointer to it.

Private Attributes

Type mValue

Detailed Description

Represents the "q" parameter value of the RFC 3261 grammar.

See also:
Parameter

First reference to q-values in 3261 reproduced here:

8.1.3.4 Processing 3xx Responses

Upon receipt of a redirection response (for example, a 301 response status code), clients SHOULD use the URI(s) in the Contact header field to formulate one or more new requests based on the redirected request. This process is similar to that of a proxy recursing on a 3xx class response as detailed in Sections 16.5 and 16.6. A client starts with an initial target set containing exactly one URI, the Request-URI of the original request. If a client wishes to formulate new requests based on a 3xx class response to that request, it places the URIs to try into the target set. Subject to the restrictions in this specification, a client can choose which Contact URIs it places into the target set. As with proxy recursion, a client processing 3xx class responses MUST NOT add any given URI to the target set more than once. If the original request had a SIPS URI in the Request- URI, the client MAY choose to recurse to a non-SIPS URI, but SHOULD inform the user of the redirection to an insecure URI.

Any new request may receive 3xx responses themselves containing the original URI as a contact. Two locations can be configured to redirect to each other. Placing any given URI in the target set only once prevents infinite redirection loops.

As the target set grows, the client MAY generate new requests to the URIs in any order. A common mechanism is to order the set by the "q" parameter value from the Contact header field value. Requests to the URIs MAY be generated serially or in parallel. One approach is to process groups of decreasing q-values serially and process the URIs in each q-value group in parallel. Another is to perform only serial processing in decreasing q-value order, arbitrarily choosing between contacts of equal q-value.

Definition at line 58 of file QValueParameter.hxx.


Member Typedef Documentation

Definition at line 61 of file QValueParameter.hxx.


Constructor & Destructor Documentation

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

constructor

Parameters:
typeused to initialize Parameter
pbinput is expected to be in the format " = qvalue" The blanks before and after the "=" sign are optional in this implementation. But absence of "=" will throw a ParseException.
terminatorsnot used
See also:
Parameter
Exceptions:
ParseException

Definition at line 17 of file QValueParameter.cxx.

References resip::ParseBuffer::eof(), mValue, resip::ParseBuffer::position(), resip::ParseBuffer::qVal(), resip::QValue::setValue(), resip::ParseBuffer::skipChar(), and resip::ParseBuffer::skipWhitespace().

Referenced by clone(), and decode().

   : Parameter(type),
     mValue(0)
{
   pb.skipWhitespace();
   if (!pb.eof() && *pb.position() != '=')
   {
      throw ParseException("parameter constructor expected '='",
                           "QValueParameter", __FILE__, __LINE__);
   }
   pb.skipChar();
   pb.skipWhitespace();
   
   // .dlb. not zero terminated; no error detection
   mValue.setValue(pb.qVal());
}

Here is the call graph for this function:

QValueParameter::QValueParameter ( ParameterTypes::Type  type) [explicit]

constructor creates object and sets q value to zero

Parameters:
typeused to initialize Parameter
Exceptions:
nothing

Definition at line 36 of file QValueParameter.cxx.

   : Parameter(type),
     mValue(0)
{}

Member Function Documentation

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

creates a new QValueParameter object that is a copy of this one.

Returns:
a new QValueParameter object that is a copy of this one.

Implements resip::Parameter.

Definition at line 42 of file QValueParameter.cxx.

References QValueParameter().

{
   return new QValueParameter(*this);
}

Here is the call graph for this function:

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

creates a QValueParameter object and returns a pointer to it.

Parameters:
typeused to initialize Parameter
pbinput is expected to be in the format " = qvalue" The blanks before and after the "=" sign are optional in this implementation. But absence of "=" will throw a ParseException.
terminatorsnot used
Returns:
a new QValueParameter object that is a copy of this one.
Exceptions:
ParseException

Definition at line 91 of file QValueParameter.hxx.

References QValueParameter().

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

Here is the call graph for this function:

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

returns "q=3" or equivalent in the stream it receives

Parameters:
streamostream to write into
Returns:
ostream with information written into it

Implements resip::Parameter.

Definition at line 48 of file QValueParameter.cxx.

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

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

Here is the call graph for this function:

int resip::QValueParameter::qval ( ) const [inline]

Definition at line 113 of file QValueParameter.hxx.

References resip::QValue::getValue(), and mValue.

{return mValue.getValue();}

Here is the call graph for this function:

Type& resip::QValueParameter::value ( ) [inline]

Definition at line 112 of file QValueParameter.hxx.

References mValue.

{return mValue;}

Member Data Documentation

Definition at line 116 of file QValueParameter.hxx.

Referenced by encode(), qval(), QValueParameter(), and value().


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