$treeview $search $mathjax $extrastylesheet
otsdaq
v2_03_00
$projectbrief
|
$projectbrief
|
$searchbox |
00001 #ifndef _ots_ConfigurationHandler_h_ 00002 #define _ots_ConfigurationHandler_h_ 00003 00004 #include <string> 00005 #include <xercesc/dom/DOMDocument.hpp> 00006 #include <xercesc/util/XMLChar.hpp> 00007 00008 #include "otsdaq-core/TableCore/TableVersion.h" 00009 00010 namespace ots 00011 { 00012 class TableBase; 00013 00014 class ConfigurationHandler 00015 { 00016 public: 00017 ConfigurationHandler(void); 00018 virtual ~ConfigurationHandler(void); 00019 virtual void read(TableBase& configuration) { ; } 00020 virtual void write(const TableBase& configuration) { ; } 00021 00022 static void readXML(TableBase& configuration, TableVersion version); 00023 static void readXML(TableBase* configuration, TableVersion version); 00024 static std::string writeXML(const TableBase& configuration); // returns the file name 00025 static std::string writeXML(const TableBase* configuration); // returns the file name 00026 00027 // FIXME These are methods that should not exist as public but I don't know what to do 00028 // until I know how to make the database interface 00029 static std::string getXMLDir(const TableBase* configuration); 00030 00031 private: 00032 static void initPlatform(void); 00033 static void terminatePlatform(void); 00034 static bool validateNode(XMLCh* tagName, 00035 xercesc::DOMNode* node, 00036 const std::string& expectedValue); 00037 static void outputXML(xercesc::DOMDocument* pmyDOMDocument, std::string filePath); 00038 static std::string getXMLFileName(const TableBase& configuration, 00039 TableVersion version); 00040 00041 static xercesc::DOMNode* getNode(XMLCh* tagName, 00042 xercesc::DOMNode* parent, 00043 unsigned int itemNumber); 00044 static xercesc::DOMNode* getNode(XMLCh* tagName, 00045 xercesc::DOMElement* parent, 00046 unsigned int itemNumber); 00047 static xercesc::DOMElement* getElement(XMLCh* tagName, 00048 xercesc::DOMNode* parent, 00049 unsigned int itemNumber); 00050 static xercesc::DOMElement* getElement(XMLCh* tagName, 00051 xercesc::DOMElement* parent, 00052 unsigned int itemNumber); 00053 static XMLCh* rootTag_; 00054 static XMLCh* headerTag_; 00055 static XMLCh* typeTag_; 00056 static XMLCh* extensionTableNameTag_; 00057 static XMLCh* nameTag_; 00058 static XMLCh* runTag_; 00059 static XMLCh* runTypeTag_; 00060 static XMLCh* runNumberTag_; 00061 static XMLCh* runBeginTimestampTag_; 00062 static XMLCh* locationTag_; 00063 static XMLCh* datasetTag_; 00064 static XMLCh* versionTag_; 00065 static XMLCh* commentDescriptionTag_; 00066 static XMLCh* createdByUserTag_; 00067 static XMLCh* partTag_; 00068 static XMLCh* nameLabelTag_; 00069 static XMLCh* kindOfPartTag_; 00070 static XMLCh* dataTag_; 00071 }; 00072 00073 } // namespace ots 00074 00075 #endif // ots_ConfigurationHandler_h