|
μHAL (v2.7.9)
Part of the IPbus software repository
|
Go to the documentation of this file.
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." )
58 UHAL_DEFINE_EXCEPTION_CLASS ( NoActionSpecified , "Exception class to handle the case where a callback is requested without it being specified." )
60 UHAL_DEFINE_EXCEPTION_CLASS ( TooManyAttributes , "Exception class to handle the case where the parser is asked to handle more than 64 attributes." )
64 UHAL_DEFINE_EXCEPTION_CLASS ( AmbiguousParserRules , "Exception class to handle the case where two or more equally strict rules are passed." )
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 );
212 template <
typename R >
227 template <
typename T >
228 void addRule (
const Rule<R> & aRule , T aCallbackHandler );
241 boost::unordered_map< std::string , uint64_t >
mHashes;
#define UHAL_DEFINE_EXCEPTION_CLASS(ClassName, ClassDescription)
std::deque< Rule< R > > mRules
Container for storing rule objects.
std::set< std::string > mOptional
The optional attributes for this rule.
std::set< std::string > mForbidden
The forbidden attributes for this rule.
Class for wrapping bound functions and function objects as an object.
boost::unordered_map< std::string, uint64_t > mHashes
Map of the tags to the one-hot encoded hash.
uint32_t mRuleId
The ID of the rule.
BaseFunctionObject< R > * mFuncPtr
An object wrapping the function pointer for the function to be called when the rule conditions are me...
std::set< std::string > mRequired
The required attributes for this rule.
Rule for matching XML attributes.
uint64_t mRequiredHash
The hash for required attributes.
Abstract base class for wrapping function pointers, function objects and bound functions as objects.
T mT
The function object or bound function which will be called when the object is evaluated (bracket oper...
uint64_t mForbiddenHash
The hash for forbidden attributes.
Forward declaration of the Parser so we can declare it friend.
uint64_t mNextHash
One-hot encoded hash for rules.
uint32_t mRuleCounter
Member to track rule numbers for giving each rule a unique ID.