ChimeraTK-DeviceAccess  03.18.00
ChimeraTK::LogicalNameMapParser Class Reference

Logical name map: store information from xlmap file and provide it to the LogicalNameMappingBackend and its register accessors. More...

#include <LogicalNameMapParser.h>

+ Collaboration diagram for ChimeraTK::LogicalNameMapParser:

Public Member Functions

 LogicalNameMapParser (std::map< std::string, std::string > parameters, std::map< std::string, LNMVariable > &variables)
 Constructor: parse map from XML file. More...
 
BackendRegisterCatalogue< LNMBackendRegisterInfoparseFile (const std::string &fileName)
 parse the given XML file More...
 
template<typename 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 &currentPath, const xmlpp::Element *element, BackendRegisterCatalogue< LNMBackendRegisterInfo > &catalogue)
 called inside parseFile() to parse an XML element and its sub-elements recursively More...
 
void parsingError (const xmlpp::Node *node, const std::string &message)
 throw a parsing error with more information More...
 
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. More...
 
template<typename ValueType >
std::vector< ValueType > getValueVectorFromXmlSubnode (const xmlpp::Node *node, const std::string &subnodeName, BackendRegisterCatalogue< LNMBackendRegisterInfo > const &catalogue)
 
template<>
std::string getValueFromXmlSubnode (const xmlpp::Node *node, const std::string &subnodeName, BackendRegisterCatalogue< LNMBackendRegisterInfo > const &catalogue, bool hasDefault, std::string defaultValue)
 

Protected Attributes

std::string _fileName
 file name of the logical map More...
 
RegisterPath currentModule
 current register path in the map More...
 
std::map< std::string, std::string > _parameters
 actual register info map (register name to target information) More...
 
std::map< std::string, LNMVariable > & _variables
 Reference to the variables map inside the LNM backend. More...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ LogicalNameMapParser()

ChimeraTK::LogicalNameMapParser::LogicalNameMapParser ( std::map< std::string, std::string >  parameters,
std::map< std::string, LNMVariable > &  variables 
)
inline

Constructor: parse map from XML file.

Definition at line 29 of file LogicalNameMapParser.h.

Member Function Documentation

◆ getValueFromXmlSubnode() [1/3]

template<>
std::string ChimeraTK::LogicalNameMapParser::getValueFromXmlSubnode ( const xmlpp::Node *  node,
const std::string &  subnodeName,
BackendRegisterCatalogue< LNMBackendRegisterInfo > const &  catalogue,
bool  hasDefault,
std::string  defaultValue 
)
protected

Definition at line 16 of file LogicalNameMapParser.cc.

◆ getValueFromXmlSubnode() [2/3]

template<typename T >
T ChimeraTK::LogicalNameMapParser::getValueFromXmlSubnode ( const xmlpp::Node *  node,
const std::string &  subnodeName,
BackendRegisterCatalogue< LNMBackendRegisterInfo > const &  catalogue,
bool  hasDefault,
defaultValue 
)

Definition at line 151 of file LogicalNameMapParser.cc.

+ Here is the call graph for this function:

◆ getValueFromXmlSubnode() [3/3]

template<typename ValueType >
ValueType ChimeraTK::LogicalNameMapParser::getValueFromXmlSubnode ( const xmlpp::Node *  node,
const std::string &  subnodeName,
BackendRegisterCatalogue< LNMBackendRegisterInfo > const &  catalogue,
bool  hasDefault = false,
ValueType  defaultValue = ValueType() 
)
protected

Build a Value object for a given subnode.

◆ getValueVectorFromXmlSubnode() [1/2]

template<typename ValueType >
std::vector<ValueType> ChimeraTK::LogicalNameMapParser::getValueVectorFromXmlSubnode ( const xmlpp::Node *  node,
const std::string &  subnodeName,
BackendRegisterCatalogue< LNMBackendRegisterInfo > const &  catalogue 
)
protected

◆ getValueVectorFromXmlSubnode() [2/2]

template<typename T >
std::vector<T> ChimeraTK::LogicalNameMapParser::getValueVectorFromXmlSubnode ( const xmlpp::Node *  node,
const std::string &  subnodeName,
BackendRegisterCatalogue< LNMBackendRegisterInfo > const &  catalogue 
)

Definition at line 163 of file LogicalNameMapParser.cc.

+ Here is the call graph for this function:

◆ parseElement()

void ChimeraTK::LogicalNameMapParser::parseElement ( const RegisterPath currentPath,
const xmlpp::Element *  element,
BackendRegisterCatalogue< LNMBackendRegisterInfo > &  catalogue 
)
protected

called inside parseFile() to parse an XML element and its sub-elements recursively

Definition at line 294 of file LogicalNameMapParser.cc.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parseFile()

BackendRegisterCatalogue< LNMBackendRegisterInfo > ChimeraTK::LogicalNameMapParser::parseFile ( const std::string &  fileName)

parse the given XML file

Definition at line 261 of file LogicalNameMapParser.cc.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parsingError()

void ChimeraTK::LogicalNameMapParser::parsingError ( const xmlpp::Node *  node,
const std::string &  message 
)
protected

throw a parsing error with more information

Definition at line 447 of file LogicalNameMapParser.cc.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ _fileName

std::string ChimeraTK::LogicalNameMapParser::_fileName
protected

file name of the logical map

Definition at line 55 of file LogicalNameMapParser.h.

◆ _parameters

std::map<std::string, std::string> ChimeraTK::LogicalNameMapParser::_parameters
protected

actual register info map (register name to target information)

parameter map

Definition at line 65 of file LogicalNameMapParser.h.

◆ _variables

std::map<std::string, LNMVariable>& ChimeraTK::LogicalNameMapParser::_variables
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.

◆ currentModule

RegisterPath ChimeraTK::LogicalNameMapParser::currentModule
protected

current register path in the map

Definition at line 58 of file LogicalNameMapParser.h.


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