reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
resip::ParserContainer< T > Class Template Reference

Container class for ParserCategory, used by SipMessage to represent multi-valued headers (Contact, Via, etc). More...

#include <ParserContainer.hxx>

Inheritance diagram for resip::ParserContainer< T >:
[legend]

Classes

class  const_iterator
 A const_iterator class (bidirectional) More...
 
class  iterator
 An iterator class (bidirectional) More...
 

Public Types

typedef T value_type
 
typedef value_type * pointer
 
typedef const value_type * const_pointer
 
typedef value_type & reference
 
typedef const value_type & const_reference
 
typedef ptrdiff_t difference_type
 
typedef ParserContainerBase::Parsers Parsers
 
- Public Types inherited from resip::ParserContainerBase
typedef size_t size_type
 

Public Member Functions

 ParserContainer ()
 Default c'tor.
 
 ParserContainer (PoolBase &pool)
 
 ParserContainer (HeaderFieldValueList *hfvs, Headers::Type type=Headers::UNKNOWN)
 
 ParserContainer (HeaderFieldValueList *hfvs, Headers::Type type, PoolBase &pool)
 
 ParserContainer (const ParserContainer &other)
 Copy c'tor.
 
 ParserContainer (const ParserContainer &other, PoolBase &pool)
 Copy c'tor.
 
ParserContainer & operator= (const ParserContainer &other)
 Assignment operator.
 
T & front ()
 Returns the first header field value in this container.
 
T & back ()
 Returns the last header field value in this container.
 
const T & front () const
 Returns the first header field value in this container.
 
const T & back () const
 Returns the last header field value in this container.
 
T * getByIndex (size_t index)
 Returns a pointer to the header field value at the given 0-based index, or nullptr if the index is out of range.
 
const T * getByIndex (size_t index) const
 
void push_front (const T &t)
 Inserts a header field value at the front of this container.
 
void push_back (const T &t)
 Inserts a header field value at the back of this container.
 
ParserContainer reverse () const
 Returns a copy of this ParserContainer, in reverse order.
 
iterator begin ()
 Returns an iterator pointing to the first header field value.
 
iterator end ()
 Returns an iterator pointing to the last header field value.
 
iterator erase (iterator i)
 Erases the header field value pointed to by i.
 
bool find (const T &rhs) const
 Finds the first header field value that matches rhs.
 
virtual void parseAll ()
 Triggers a parse of all contained header field values.
 
const_iterator begin () const
 Returns a const_iterator pointing to the first header field value.
 
const_iterator end () const
 Returns a const_iterator pointing to the first header field value.
 
virtual ParserContainerBase * clone () const
 Clones this container, and all contained header field values.
 
- Public Member Functions inherited from resip::ParserContainerBase
 ParserContainerBase (Headers::Type type=Headers::UNKNOWN)
 constructor; sets the type only
 
 ParserContainerBase (Headers::Type type, PoolBase &pool)
 constructor; sets the type only
 
 ParserContainerBase (const ParserContainerBase &rhs)
 copy constructor copies the mType and the mParsers from the rhs
 
 ParserContainerBase (const ParserContainerBase &rhs, PoolBase &pool)
 
ParserContainerBase & operator= (const ParserContainerBase &rhs)
 assignment operator copies the mParsers from the rhs
 
virtual ~ParserContainerBase ()
 virtual destructor - empty in this class
 
void clear ()
 clear the mParsers vector
 
size_t size () const
 return the size of the mParsers vector
 
bool empty () const
 return true or false indicating whether the mParsers vector is empty or not
 
EncodeStream & encode (const Data &headerName, EncodeStream &str) const
 
std::ostream & encode (Headers::Type type, std::ostream &str) const
 
EncodeStream & encodeEmbedded (const Data &headerName, EncodeStream &str) const
 
void pop_front ()
 if mParsers vector is not empty, erase the first element
 
void pop_back ()
 if mParsers vector is not empty, erase the first element
 
void append (const ParserContainerBase &rhs)
 append the vector to the mParsers vector held locally
 
bool getHeaderValueByIndex (size_t index, Data &headerValue) const
 

Friends

class ParserContainer< T >::iterator
 
class ParserContainer< T >::const_iterator
 

Additional Inherited Members

- Protected Types inherited from resip::ParserContainerBase
typedef std::vector< HeaderKit, StlPoolAllocator< HeaderKit, PoolBase > > Parsers
 
- Protected Member Functions inherited from resip::ParserContainerBase
void copyParsers (const Parsers &parsers)
 copy header kits
 
void freeParsers ()
 free parser containers
 
void freeParser (HeaderKit &kit)
 
ParserCategory * makeParser (const ParserCategory &orig)
 
- Protected Attributes inherited from resip::ParserContainerBase
const Headers::Type mType
 
Parsers mParsers
 the actual list (vector) of parsers on which encoding is done
 
PoolBase * mPool
 

Detailed Description

template<class T>
class resip::ParserContainer< T >

Container class for ParserCategory, used by SipMessage to represent multi-valued headers (Contact, Via, etc).

This has an interface that is similar to stl containers, but not as complete.

Definition at line 22 of file ParserContainer.hxx.

Member Typedef Documentation

◆ const_pointer

template<class T >
typedef const value_type* resip::ParserContainer< T >::const_pointer

Definition at line 27 of file ParserContainer.hxx.

◆ const_reference

template<class T >
typedef const value_type& resip::ParserContainer< T >::const_reference

Definition at line 29 of file ParserContainer.hxx.

◆ difference_type

template<class T >
typedef ptrdiff_t resip::ParserContainer< T >::difference_type

Definition at line 30 of file ParserContainer.hxx.

◆ Parsers

template<class T >
typedef ParserContainerBase::Parsers resip::ParserContainer< T >::Parsers

Definition at line 178 of file ParserContainer.hxx.

◆ pointer

template<class T >
typedef value_type* resip::ParserContainer< T >::pointer

Definition at line 26 of file ParserContainer.hxx.

◆ reference

template<class T >
typedef value_type& resip::ParserContainer< T >::reference

Definition at line 28 of file ParserContainer.hxx.

◆ value_type

template<class T >
typedef T resip::ParserContainer< T >::value_type

Definition at line 25 of file ParserContainer.hxx.

Constructor & Destructor Documentation

◆ ParserContainer() [1/6]

template<class T >
resip::ParserContainer< T >::ParserContainer ( )
inline

Default c'tor.

Definition at line 35 of file ParserContainer.hxx.

◆ ParserContainer() [2/6]

template<class T >
resip::ParserContainer< T >::ParserContainer ( PoolBase &  pool)
inline

Definition at line 39 of file ParserContainer.hxx.

◆ ParserContainer() [3/6]

template<class T >
resip::ParserContainer< T >::ParserContainer ( HeaderFieldValueList *  hfvs,
Headers::Type  type = Headers::UNKNOWN 
)
inline

Definition at line 48 of file ParserContainer.hxx.

◆ ParserContainer() [4/6]

template<class T >
resip::ParserContainer< T >::ParserContainer ( HeaderFieldValueList *  hfvs,
Headers::Type  type,
PoolBase &  pool 
)
inline

Definition at line 63 of file ParserContainer.hxx.

◆ ParserContainer() [5/6]

template<class T >
resip::ParserContainer< T >::ParserContainer ( const ParserContainer< T > &  other)
inline

Copy c'tor.

Definition at line 82 of file ParserContainer.hxx.

◆ ParserContainer() [6/6]

template<class T >
resip::ParserContainer< T >::ParserContainer ( const ParserContainer< T > &  other,
PoolBase &  pool 
)
inline

Copy c'tor.

Definition at line 89 of file ParserContainer.hxx.

Member Function Documentation

◆ back() [1/2]

template<class T >
T & resip::ParserContainer< T >::back ( )
inline

Returns the last header field value in this container.

Definition at line 112 of file ParserContainer.hxx.

◆ back() [2/2]

template<class T >
const T & resip::ParserContainer< T >::back ( ) const
inline

Returns the last header field value in this container.

Definition at line 128 of file ParserContainer.hxx.

◆ begin() [1/2]

template<class T >
iterator resip::ParserContainer< T >::begin ( )
inline

Returns an iterator pointing to the first header field value.

Definition at line 271 of file ParserContainer.hxx.

◆ begin() [2/2]

template<class T >
const_iterator resip::ParserContainer< T >::begin ( ) const
inline

Returns a const_iterator pointing to the first header field value.

Definition at line 323 of file ParserContainer.hxx.

◆ clone()

template<class T >
virtual ParserContainerBase * resip::ParserContainer< T >::clone ( ) const
inlinevirtual

Clones this container, and all contained header field values.

Implements resip::ParserContainerBase.

Definition at line 334 of file ParserContainer.hxx.

◆ end() [1/2]

template<class T >
iterator resip::ParserContainer< T >::end ( )
inline

Returns an iterator pointing to the last header field value.

Definition at line 276 of file ParserContainer.hxx.

◆ end() [2/2]

template<class T >
const_iterator resip::ParserContainer< T >::end ( ) const
inline

Returns a const_iterator pointing to the first header field value.

Definition at line 329 of file ParserContainer.hxx.

◆ erase()

template<class T >
iterator resip::ParserContainer< T >::erase ( iterator  i)
inline

Erases the header field value pointed to by i.

Invalidates all existing iterators.

Definition at line 282 of file ParserContainer.hxx.

◆ find()

template<class T >
bool resip::ParserContainer< T >::find ( const T &  rhs) const
inline

Finds the first header field value that matches rhs.

Definition at line 291 of file ParserContainer.hxx.

◆ front() [1/2]

template<class T >
T & resip::ParserContainer< T >::front ( )
inline

Returns the first header field value in this container.

Definition at line 104 of file ParserContainer.hxx.

◆ front() [2/2]

template<class T >
const T & resip::ParserContainer< T >::front ( ) const
inline

Returns the first header field value in this container.

Definition at line 120 of file ParserContainer.hxx.

◆ getByIndex() [1/2]

template<class T >
T * resip::ParserContainer< T >::getByIndex ( size_t  index)
inline

Returns a pointer to the header field value at the given 0-based index, or nullptr if the index is out of range.

O(1) - backed by a vector.

Definition at line 137 of file ParserContainer.hxx.

◆ getByIndex() [2/2]

template<class T >
const T * resip::ParserContainer< T >::getByIndex ( size_t  index) const
inline

Definition at line 143 of file ParserContainer.hxx.

◆ operator=()

template<class T >
ParserContainer & resip::ParserContainer< T >::operator= ( const ParserContainer< T > &  other)
inline

Assignment operator.

Definition at line 96 of file ParserContainer.hxx.

◆ parseAll()

template<class T >
virtual void resip::ParserContainer< T >::parseAll ( )
inlinevirtual

Triggers a parse of all contained header field values.

Exceptions
ParseExceptionif any header field value is malformed.

Implements resip::ParserContainerBase.

Definition at line 310 of file ParserContainer.hxx.

◆ push_back()

template<class T >
void resip::ParserContainer< T >::push_back ( const T &  t)
inline

Inserts a header field value at the back of this container.

Definition at line 161 of file ParserContainer.hxx.

◆ push_front()

template<class T >
void resip::ParserContainer< T >::push_front ( const T &  t)
inline

Inserts a header field value at the front of this container.

Definition at line 152 of file ParserContainer.hxx.

◆ reverse()

template<class T >
ParserContainer resip::ParserContainer< T >::reverse ( ) const
inline

Returns a copy of this ParserContainer, in reverse order.

Todo:
!bwc! optimize this (we are copying each ParserContainer twice)

Definition at line 171 of file ParserContainer.hxx.

Friends And Related Symbol Documentation

◆ ParserContainer< T >::const_iterator

template<class T >
friend class ParserContainer< T >::const_iterator
friend

Definition at line 341 of file ParserContainer.hxx.

◆ ParserContainer< T >::iterator

template<class T >
friend class ParserContainer< T >::iterator
friend

Definition at line 340 of file ParserContainer.hxx.


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