|
reSIProcate/stack
9694
|
Represents the "q" parameter value of the RFC 3261 grammar. More...
#include <QValueParameter.hxx>


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 Parameter * | clone () const |
| creates a new QValueParameter object that is a copy of this one. | |
| virtual EncodeStream & | encode (EncodeStream &stream) const |
| returns "q=3" or equivalent in the stream it receives | |
| Type & | value () |
| int | qval () const |
Static Public Member Functions | |
| static Parameter * | decode (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 |
Represents the "q" parameter value of the RFC 3261 grammar.
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.
| typedef QValue resip::QValueParameter::Type |
Definition at line 61 of file QValueParameter.hxx.
| QValueParameter::QValueParameter | ( | ParameterTypes::Type | type, |
| ParseBuffer & | pb, | ||
| const std::bitset< 256 > & | terminators | ||
| ) |
constructor
| type | used to initialize Parameter |
| pb | input 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. |
| terminators | not used |
| 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()); }

| QValueParameter::QValueParameter | ( | ParameterTypes::Type | type | ) | [explicit] |
| Parameter * QValueParameter::clone | ( | ) | const [virtual] |
creates 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);
}

| 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.
| type | used to initialize Parameter |
| pb | input 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. |
| terminators | not used |
| ParseException |
Definition at line 91 of file QValueParameter.hxx.
References QValueParameter().
{
return new (pool) QValueParameter(type, pb, terminators);
}

| EncodeStream & QValueParameter::encode | ( | EncodeStream & | stream | ) | const [virtual] |
returns "q=3" or equivalent in the stream it receives
| stream | ostream to write into |
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;
}

| int resip::QValueParameter::qval | ( | ) | const [inline] |
Definition at line 113 of file QValueParameter.hxx.
References resip::QValue::getValue(), and mValue.

| Type& resip::QValueParameter::value | ( | ) | [inline] |
Type resip::QValueParameter::mValue [private] |
Definition at line 116 of file QValueParameter.hxx.
Referenced by encode(), qval(), QValueParameter(), and value().
1.7.5.1