μHAL (v2.6.5)
Part of the IPbus software repository
Public Member Functions | Private Attributes | List of all members
uhal::Parser< R > Class Template Reference

Forward declaration of the Parser so we can declare it friend. More...

#include <uhal/XmlParser.hpp>

Inheritance diagram for uhal::Parser< R >:
[legend]

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...
 
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...
 

Detailed Description

template<typename R>
class uhal::Parser< R >

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.

Constructor & Destructor Documentation

◆ Parser()

template<typename R >
uhal::Parser< R >::Parser ( )

Default constructor.

Definition at line 223 of file XmlParser.hxx.

◆ ~Parser()

template<typename R >
uhal::Parser< R >::~Parser ( )

Destructor.

Definition at line 231 of file XmlParser.hxx.

Member Function Documentation

◆ addRule()

template<typename R>
template<typename T >
void uhal::Parser< R >::addRule ( const Rule< R > &  aRule,
aCallbackHandler 
)

Method to add the rules to the parser.

Parameters
aRulea rule object specifying what to match
aCallbackHandlera function callback to be performed when the rule conditions are met

Definition at line 239 of file XmlParser.hxx.

◆ operator()()

template<typename R >
R uhal::Parser< R >::operator() ( const pugi::xml_node &  aNode)

Functor which converts an XML node to an object of template type R.

Parameters
aNodean XML node for converting to an object
Returns
an object of template type R

Definition at line 314 of file XmlParser.hxx.

Member Data Documentation

◆ mHashes

template<typename R>
boost::unordered_map< std::string , uint64_t > uhal::Parser< R >::mHashes
private

Map of the tags to the one-hot encoded hash.

Definition at line 249 of file XmlParser.hpp.

◆ mNextHash

template<typename R>
uint64_t uhal::Parser< R >::mNextHash
private

One-hot encoded hash for rules.

Definition at line 247 of file XmlParser.hpp.

◆ mRuleCounter

template<typename R>
uint32_t uhal::Parser< R >::mRuleCounter
private

Member to track rule numbers for giving each rule a unique ID.

Definition at line 253 of file XmlParser.hpp.

◆ mRules

template<typename R>
std::deque< Rule<R> > uhal::Parser< R >::mRules
private

Container for storing rule objects.

Definition at line 251 of file XmlParser.hpp.


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