39#ifndef _uhal_XmlParser_hpp_
40#define _uhal_XmlParser_hpp_
56 UHAL_DEFINE_EXCEPTION_CLASS ( ContradictoryParserRule ,
"Exception class to handle the case where an attribute is both required and forbidden." )
70 template < typename R >
74 template < typename R >
91 template <
typename R ,
typename T >
116 template <
typename R ,
typename T >
143 template <
typename R >
160 Rule<R>& require (
const std::string& aStr );
167 Rule<R>& forbid (
const std::string& aStr );
174 Rule<R>& optional (
const std::string& aStr );
180 std::string description()
const;
212 template <
typename R >
227 template <
typename T >
228 void addRule (
const Rule<R> & aRule , T aCallbackHandler );
241 std::unordered_map< std::string , uint64_t >
mHashes;
Wrapper to generate a new Python exception type.
\rst Holds a reference to a Python object (no reference counting)
Abstract base class for wrapping function pointers, function objects and bound functions as objects.
T * mT
Store the function pointer which will be called when the object is evaluated (bracket operator)
Class for wrapping bound functions and function objects as an object.
T mT
The function object or bound function which will be called when the object is evaluated (bracket oper...
Forward declaration of the Parser so we can declare it friend.
std::deque< Rule< R > > mRules
Container for storing rule objects.
uint32_t mRuleCounter
Member to track rule numbers for giving each rule a unique ID.
std::unordered_map< std::string, uint64_t > mHashes
Map of the tags to the one-hot encoded hash.
uint64_t mNextHash
One-hot encoded hash for rules.
Rule for matching XML attributes.
std::set< std::string > mRequired
The required attributes for this rule.
BaseFunctionObject< R > * mFuncPtr
An object wrapping the function pointer for the function to be called when the rule conditions are me...
uint32_t mRuleId
The ID of the rule.
std::set< std::string > mForbidden
The forbidden attributes for this rule.
uint64_t mForbiddenHash
The hash for forbidden attributes.
uint64_t mRequiredHash
The hash for required attributes.
std::set< std::string > mOptional
The optional attributes for this rule.
#define UHAL_DEFINE_EXCEPTION_CLASS(ClassName, ClassDescription)