Class to access ODB info from an XML ODB dump at either the begining of a run or from a seperate file.
Public Member Functions | |
TXMLOdb (char *buffer, int size=0) | |
virtual | ~TXMLOdb () |
TXMLNode * | FindNode (const char *name, TXMLNode *node=nullptr) |
TXMLNode * | FindPath (const char *path, TXMLNode *node=nullptr) |
const char * | GetNodeName (TXMLNode *) |
std::vector< double > | ReadDoubleArray (TXMLNode *node) |
int | ReadInt (const char *path, int index=0, int defaultValue=0xffffffff) |
std::vector< int > | ReadIntArray (TXMLNode *node) |
std::vector< std::string > | ReadStringArray (TXMLNode *node) |
Public Attributes | |
TXMLDocument * | fDoc |
TXMLNode * | fOdb |
TDOMParser * | fParser |
Static Private Attributes | |
static char | fTextBuffer [256] |
#include <TXMLOdb.h>
TXMLOdb::TXMLOdb | ( | char * | buffer, |
int | size = 0 |
||
) |
Creator, tries to open buffer as input file and parse it, if that fails, parses size bytes of the buffer.
Definition at line 16 of file TXMLOdb.cxx.
|
virtual |
Default destructor, deletes the parser.
Definition at line 43 of file TXMLOdb.cxx.
References fParser.
TXMLNode * TXMLOdb::FindNode | ( | const char * | name, |
TXMLNode * | node = nullptr |
||
) |
Finds node with name "name". If a node is provided this node will be used as a starting point. If the provided node is a null pointer fOdb is used instead. Returns a null pointer if the search fails.
Definition at line 51 of file TXMLOdb.cxx.
References fOdb, and GetNodeName().
Referenced by FindPath().
TXMLNode * TXMLOdb::FindPath | ( | const char * | path, |
TXMLNode * | node = nullptr |
||
) |
Find path "path" under the provided node. If the node is a null pointer, fOdb is used instead.
Definition at line 77 of file TXMLOdb.cxx.
References FindNode(), and fOdb.
Referenced by TGRSIDataParser::Process(), ReadInt(), TMidasFile::SetEPICSOdb(), TMidasFile::SetFileOdb(), TMidasFile::SetGRIFFOdb(), TMidasFile::SetRunInfo(), TMidasFile::SetTIGDAQOdb(), and TMidasFile::SetTIGOdb().
const char * TXMLOdb::GetNodeName | ( | TXMLNode * | node | ) |
Returns the name of a node.
Definition at line 115 of file TXMLOdb.cxx.
References fTextBuffer.
Referenced by FindNode(), TMidasFile::SetFileOdb(), and TMidasFile::SetTIGOdb().
std::vector< double > TXMLOdb::ReadDoubleArray | ( | TXMLNode * | node | ) |
Reads and returns an array of doubles.
Definition at line 230 of file TXMLOdb.cxx.
Referenced by TMidasFile::SetGRIFFOdb(), TMidasFile::SetTIGDAQOdb(), and TMidasFile::SetTIGOdb().
int TXMLOdb::ReadInt | ( | const char * | path, |
int | index = 0 , |
||
int | defaultValue = 0xffffffff |
||
) |
tries to find the path "path", returns defaultValue if that fails, otherwise returns 0.
Definition at line 127 of file TXMLOdb.cxx.
References FindPath().
std::vector< int > TXMLOdb::ReadIntArray | ( | TXMLNode * | node | ) |
Reads and returns an array of integers.
Definition at line 137 of file TXMLOdb.cxx.
Referenced by TMidasFile::SetGRIFFOdb(), TMidasFile::SetTIGDAQOdb(), and TMidasFile::SetTIGOdb().
std::vector< std::string > TXMLOdb::ReadStringArray | ( | TXMLNode * | node | ) |
Reads and returns an array of strings.
Definition at line 179 of file TXMLOdb.cxx.
Referenced by TMidasFile::SetEPICSOdb(), TMidasFile::SetGRIFFOdb(), TMidasFile::SetTIGDAQOdb(), and TMidasFile::SetTIGOdb().
TXMLNode* TXMLOdb::fOdb |
Definition at line 38 of file TXMLOdb.h.
Referenced by FindNode(), FindPath(), and TXMLOdb().
TDOMParser* TXMLOdb::fParser |
Definition at line 37 of file TXMLOdb.h.
Referenced by TXMLOdb(), and ~TXMLOdb().
|
staticprivate |
Definition at line 50 of file TXMLOdb.h.
Referenced by GetNodeName().