Iterator re-validating Parser wrapper. More...
#include <senf/Packets/SafeIterator.hh>
Public Member Functions | |
Parser & | operator* () const |
Access the stored parser. More... | |
Parser * | operator-> () const |
Access the stored parser. More... | |
bool | boolean_test () const |
Check validity. More... | |
Public Member Functions inherited from senf::comparable_safe_bool< class > | |
operator bool_type () const | |
bool | operator! () const |
Structors and default members | |
SafePacketParserWrapper () | |
Create an empty uninitialized SafePacketParserWrapper. More... | |
SafePacketParserWrapper (Parser parser) | |
Initialize SafePacketParserWrapper from parser. More... | |
SafePacketParserWrapper & | operator= (Parser parser) |
Assign parser to this . More... | |
Additional Inherited Members | |
Protected Types inherited from senf::safe_bool_base | |
typedef void(safe_bool_base::* | bool_type) () const |
Protected Member Functions inherited from senf::comparable_safe_bool< class > | |
~comparable_safe_bool () | |
Protected Member Functions inherited from senf::safe_bool_base | |
void | this_type_does_not_support_comparisons () const |
safe_bool_base () | |
safe_bool_base (const safe_bool_base &) | |
safe_bool_base & | operator= (const safe_bool_base &) |
~safe_bool_base () | |
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.
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 108 of file SafeIterator.hh.
senf::SafePacketParserWrapper< Parser >::SafePacketParserWrapper | ( | ) |
Create an empty uninitialized SafePacketParserWrapper.
senf::SafePacketParserWrapper< Parser >::SafePacketParserWrapper | ( | Parser | parser | ) |
Initialize SafePacketParserWrapper from parser.
bool senf::SafePacketParserWrapper< Parser >::boolean_test | ( | ) | const |
Check validity.
Parser& senf::SafePacketParserWrapper< Parser >::operator* | ( | ) | const |
Access the stored parser.
On every access, the stored parsers iterator will be updated / re-validated.
Parser* senf::SafePacketParserWrapper< Parser >::operator-> | ( | ) | const |
Access the stored parser.
On every access, the stored parsers iterator will be updated / re-validated.
SafePacketParserWrapper& senf::SafePacketParserWrapper< Parser >::operator= | ( | Parser | parser | ) |
Assign parser to this
.