reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
resip::QValueParameter Class Reference

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

#include <QValueParameter.hxx>

Inheritance diagram for resip::QValueParameter:
[legend]

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
 
- Public Member Functions inherited from resip::Parameter
 Parameter (ParameterTypes::Type type)
 
virtual ~Parameter ()
 
ParameterTypes::Type getType () const
 
virtual const Data & getName () const
 
virtual bool isQuoted () const
 
virtual void setQuoted (bool)
 

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.
 

Additional Inherited Members

- Protected Member Functions inherited from resip::Parameter
 Parameter (const Parameter &other)
 
Parameter & operator= (const Parameter &other)
 

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

◆ Type

Definition at line 61 of file QValueParameter.hxx.

Constructor & Destructor Documentation

◆ QValueParameter() [1/2]

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.

◆ QValueParameter() [2/2]

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.

Member Function Documentation

◆ clone()

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.

◆ decode()

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

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.

◆ encode()

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.

◆ qval()

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

Definition at line 113 of file QValueParameter.hxx.

◆ value()

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

Definition at line 112 of file QValueParameter.hxx.


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