![]() |
ChimeraTK-DeviceAccess 03.20.00
|
Logical name map: store information from xlmap file and provide it to the LogicalNameMappingBackend and its register accessors. More...
#include <LogicalNameMapParser.h>
Public Member Functions | |
LogicalNameMapParser (std::map< std::string, std::string > parameters, std::map< std::string, LNMVariable > &variables) | |
Constructor: parse map from XML file. | |
BackendRegisterCatalogue< LNMBackendRegisterInfo > | parseFile (const std::string &fileName) |
parse the given XML file | |
template<typename T > | |
T | getValueFromXmlSubnode (const xmlpp::Node *node, const std::string &subnodeName, BackendRegisterCatalogue< LNMBackendRegisterInfo > const &catalogue, bool hasDefault, T defaultValue) |
template<typename T > | |
std::vector< T > | getValueVectorFromXmlSubnode (const xmlpp::Node *node, const std::string &subnodeName, BackendRegisterCatalogue< LNMBackendRegisterInfo > const &catalogue) |
Protected Member Functions | |
void | parseElement (const RegisterPath ¤tPath, const xmlpp::Element *element, BackendRegisterCatalogue< LNMBackendRegisterInfo > &catalogue) |
called inside parseFile() to parse an XML element and its sub-elements recursively | |
void | parsingError (const xmlpp::Node *node, const std::string &message) |
throw a parsing error with more information | |
template<typename ValueType > | |
ValueType | getValueFromXmlSubnode (const xmlpp::Node *node, const std::string &subnodeName, BackendRegisterCatalogue< LNMBackendRegisterInfo > const &catalogue, bool hasDefault=false, ValueType defaultValue=ValueType()) |
Build a Value object for a given subnode. | |
template<typename ValueType > | |
std::vector< ValueType > | getValueVectorFromXmlSubnode (const xmlpp::Node *node, const std::string &subnodeName, BackendRegisterCatalogue< LNMBackendRegisterInfo > const &catalogue) |
Protected Attributes | |
std::string | _fileName |
file name of the logical map | |
RegisterPath | currentModule |
current register path in the map | |
std::map< std::string, std::string > | _parameters |
actual register info map (register name to target information) | |
std::map< std::string, LNMVariable > & | _variables |
Reference to the variables map inside the LNM backend. | |
Logical name map: store information from xlmap file and provide it to the LogicalNameMappingBackend and its register accessors.
Definition at line 26 of file LogicalNameMapParser.h.
|
inline |
Constructor: parse map from XML file.
Definition at line 29 of file LogicalNameMapParser.h.
T ChimeraTK::LogicalNameMapParser::getValueFromXmlSubnode | ( | const xmlpp::Node * | node, |
const std::string & | subnodeName, | ||
BackendRegisterCatalogue< LNMBackendRegisterInfo > const & | catalogue, | ||
bool | hasDefault, | ||
T | defaultValue | ||
) |
Definition at line 152 of file LogicalNameMapParser.cc.
|
protected |
Build a Value object for a given subnode.
|
protected |
std::vector< T > ChimeraTK::LogicalNameMapParser::getValueVectorFromXmlSubnode | ( | const xmlpp::Node * | node, |
const std::string & | subnodeName, | ||
BackendRegisterCatalogue< LNMBackendRegisterInfo > const & | catalogue | ||
) |
Definition at line 164 of file LogicalNameMapParser.cc.
|
protected |
called inside parseFile() to parse an XML element and its sub-elements recursively
Definition at line 295 of file LogicalNameMapParser.cc.
BackendRegisterCatalogue< LNMBackendRegisterInfo > ChimeraTK::LogicalNameMapParser::parseFile | ( | const std::string & | fileName | ) |
parse the given XML file
Definition at line 262 of file LogicalNameMapParser.cc.
|
protected |
throw a parsing error with more information
Definition at line 448 of file LogicalNameMapParser.cc.
|
protected |
file name of the logical map
Definition at line 55 of file LogicalNameMapParser.h.
|
protected |
actual register info map (register name to target information)
parameter map
Definition at line 65 of file LogicalNameMapParser.h.
|
protected |
Reference to the variables map inside the LNM backend.
Is filled with initial values in the parser
Definition at line 68 of file LogicalNameMapParser.h.
|
protected |
current register path in the map
Definition at line 58 of file LogicalNameMapParser.h.