Forward declaration of the Parser so we can declare it friend. More...
#include <uhal/XmlParser.hpp>
Public Member Functions | |
Parser () | |
Default constructor. More... | |
~Parser () | |
Destructor. More... | |
template<typename T > | |
void | addRule (const Rule< R > &aRule, T aCallbackHandler) |
Method to add the rules to the parser. More... | |
R | operator() (const pugi::xml_node &aNode) |
Functor which converts an XML node to an object of template type R. More... | |
Private Attributes | |
uint64_t | mNextHash |
One-hot encoded hash for rules. More... | |
boost::unordered_map< std::string, uint64_t > | mHashes |
Map of the tags to the one-hot encoded hash. More... | |
std::deque< Rule< R > > | mRules |
Container for storing rule objects. More... | |
uint32_t | mRuleCounter |
Member to track rule numbers for giving each rule a unique ID. More... | |
Forward declaration of the Parser so we can declare it friend.
Parser class which converts an XML node to an object of type R.
Definition at line 71 of file XmlParser.hpp.
uhal::Parser< R >::Parser |
Default constructor.
Definition at line 239 of file XmlParser.hxx.
References uhal::Parser< R >::mHashes.
uhal::Parser< R >::~Parser |
Destructor.
Definition at line 248 of file XmlParser.hxx.
void uhal::Parser< R >::addRule | ( | const Rule< R > & | aRule, |
T | aCallbackHandler | ||
) |
Method to add the rules to the parser.
aRule | a rule object specifying what to match |
aCallbackHandler | a function callback to be performed when the rule conditions are met |
Definition at line 255 of file XmlParser.hxx.
References uhal::log(), uhal::Rule< R >::mForbidden, uhal::Rule< R >::mForbiddenHash, uhal::Rule< R >::mFuncPtr, uhal::Rule< R >::mOptional, uhal::Rule< R >::mRequired, uhal::Rule< R >::mRequiredHash, and uhal::Rule< R >::mRuleId.
R uhal::Parser< R >::operator() | ( | const pugi::xml_node & | aNode | ) |
Functor which converts an XML node to an object of template type R.
aNode | an XML node for converting to an object |
Definition at line 330 of file XmlParser.hxx.
References uhal::Rule< R >::description(), pugi::xml_node::first_attribute(), uhal::Integer(), uhal::log(), uhal::Rule< R >::mRequired, pugi::xml_attribute::next_attribute(), uhal::Quote(), and uhal::Warning.
|
private |
Map of the tags to the one-hot encoded hash.
Definition at line 241 of file XmlParser.hpp.
Referenced by uhal::Parser< R >::Parser().
|
private |
One-hot encoded hash for rules.
Definition at line 239 of file XmlParser.hpp.
|
private |
Member to track rule numbers for giving each rule a unique ID.
Definition at line 245 of file XmlParser.hpp.
|
private |
Container for storing rule objects.
Definition at line 243 of file XmlParser.hpp.