senf::SafePacketParserWrapper< Parser > Class Template Reference
[The PacketParser facility]

Iterator re-validating Parser wrapper. More...

#include <senf/Packets/SafeIterator.hh>

Inheritance diagram for senf::SafePacketParserWrapper< Parser >:
Inheritance graph
[legend]

List of all members.


Detailed Description

template<class Parser>
class senf::SafePacketParserWrapper< Parser >

Iterator re-validating Parser wrapper.

An ordinary parser will be invalidated whenever the raw data container's size is changed. This can complicate some algorithms considerably.

This wrapper will update the parsers iterator (the value returned by the i() member) on every access. This ensures that the iterator will stay valid.

Attention:
Beware however, if you insert or remove data before the safe wrapper, the location will not be updated accordingly and therefore the parser will be invalid.
Additionally a SafePacketParserWrapper has an uninitialized state. The only allowed operations in this state are the boolean test for validity and assigning another parser.

Definition at line 121 of file SafeIterator.hh.


Public Member Functions

Parser &  operator* () const
  Access the stored parser.
Parser *  operator-> () const
  Access the stored parser.
bool  boolean_test () const
  Check validity.

Structors and default members

  SafePacketParserWrapper ()
  Create an empty uninitialized SafePacketParserWrapper.
  SafePacketParserWrapper (Parser parser)
  Initialize SafePacketParserWrapper from parser.
SafePacketParserWrapper operator= (Parser parser)
  Assign parser to this.

Constructor & Destructor Documentation

template<class Parser >
senf::SafePacketParserWrapper< Parser >::
SafePacketParserWrapper ()

Create an empty uninitialized SafePacketParserWrapper.

Definition at line 37 of file SafeIterator.cti.

template<class Parser>
senf::SafePacketParserWrapper< Parser >::
SafePacketParserWrapper ( Parser  parser )

Initialize SafePacketParserWrapper from parser.

Definition at line 42 of file SafeIterator.cti.


Member Function Documentation

template<class Parser >
bool senf::SafePacketParserWrapper< Parser >::
boolean_test ()

Check validity.

Definition at line 73 of file SafeIterator.cti.

template<class Parser >
Parser & senf::SafePacketParserWrapper< Parser >::
operator* ()

Access the stored parser.

On every access, the stored parsers iterator will be updated / re-validated.

Definition at line 55 of file SafeIterator.cti.

template<class Parser >
Parser * senf::SafePacketParserWrapper< Parser >::
operator-> ()

Access the stored parser.

On every access, the stored parsers iterator will be updated / re-validated.

Definition at line 64 of file SafeIterator.cti.

template<class Parser>
senf::SafePacketParserWrapper< Parser > & senf::SafePacketParserWrapper< Parser >::
operator= ( Parser  parser )

Assign parser to this.

Definition at line 47 of file SafeIterator.cti.


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