CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Attributes
XMLProcessor Class Reference

#include <CalibCalorimetry/HcalTPGAlgos/interface/XMLProcessor.h>

Classes

struct  _checksumsDBConfig
 
struct  _DBConfig
 
struct  _LMapRowHBEF
 
struct  _LMapRowHO
 
struct  _loaderBaseConfig
 
struct  _lutDBConfig
 

Public Types

typedef
XMLProcessor::_checksumsDBConfig 
checksumsDBConfig
 
typedef struct
XMLProcessor::_DBConfig 
DBConfig
 
typedef struct
XMLProcessor::_LMapRowHBEF 
LMapRowHBEF
 
typedef struct
XMLProcessor::_LMapRowHO 
LMapRowHO
 
typedef struct
XMLProcessor::_loaderBaseConfig 
loaderBaseConfig
 
typedef XMLProcessor::_lutDBConfig lutDBConfig
 

Public Member Functions

int addLMapHBEFDataset (XMLDOMBlock *doc, LMapRowHBEF *row, std::string templateFileName)
 
int addLMapHODataset (XMLDOMBlock *doc, LMapRowHO *row, std::string templateFileName)
 
XMLDOMBlockcreateLMapHBEFXMLBase (std::string templateFileName)
 
XMLDOMBlockcreateLMapHOXMLBase (std::string templateFileName)
 
int init (void)
 
XMLCh * serializeDOM (XERCES_CPP_NAMESPACE::DOMNode *node, std::string target="stdout")
 
int terminate (void)
 
int test (void)
 
int write (XMLDOMBlock *doc, std::string target="stdout")
 
virtual ~XMLProcessor ()
 

Static Public Member Functions

static XMLCh * _toXMLCh (std::string temp)
 
static XMLCh * _toXMLCh (int temp)
 
static XMLCh * _toXMLCh (double temp)
 
static XMLCh * _toXMLCh (time_t temp)
 
static XMLProcessorgetInstance ()
 

Private Member Functions

 XMLProcessor ()
 
 XMLProcessor (const XMLProcessor &)
 

Static Private Attributes

static XMLProcessorinstance = NULL
 

Detailed Description

Description: Testing Xerces library for processing HCAL DB XML wrappers

Usage: <usage>

Definition at line 42 of file XMLProcessor.h.

Member Typedef Documentation

Constructor & Destructor Documentation

XMLProcessor::~XMLProcessor ( )
virtual

Definition at line 50 of file XMLProcessor.cc.

XMLProcessor::XMLProcessor ( )
private

Definition at line 44 of file XMLProcessor.cc.

Referenced by getInstance().

XMLProcessor::XMLProcessor ( const XMLProcessor )
private

Member Function Documentation

XMLCh * XMLProcessor::_toXMLCh ( std::string  temp)
inlinestatic

Definition at line 183 of file XMLProcessor.h.

References XERCES_CPP_NAMESPACE_USE::transcode().

Referenced by HcalTriggerKey::add_data(), and HcalL1TriggerObjectsXml::add_data().

184 {
185  XMLCh* buff = XERCES_CPP_NAMESPACE::XMLString::transcode(temp.c_str());
186  return buff;
187 }
XMLCh * transcode(const T &fInput)
XMLCh * XMLProcessor::_toXMLCh ( int  temp)
inlinestatic

Definition at line 189 of file XMLProcessor.h.

References gather_cfg::cout, mps_update::status, and XERCES_CPP_NAMESPACE_USE::transcode().

190 {
191  char buf[100];
192  int status = snprintf( buf, 100, "%d", temp );
193  if ( status >= 100 )
194  {
195  std::cout << "XMLProcessor::_toXMLCh(int temp): buffer overflow, the std::string will be truncated!" << std::endl;
196  }
197  else if ( status <0 )
198  {
199  std::cout << "XMLProcessor::_toXMLCh(int temp): output error" << std::endl;
200  }
201  XMLCh* buff = XERCES_CPP_NAMESPACE::XMLString::transcode( buf );
202  return buff;
203 }
XMLCh * transcode(const T &fInput)
tuple cout
Definition: gather_cfg.py:145
tuple status
Definition: mps_update.py:57
XMLCh * XMLProcessor::_toXMLCh ( double  temp)
inlinestatic

Definition at line 205 of file XMLProcessor.h.

References gather_cfg::cout, mps_update::status, and XERCES_CPP_NAMESPACE_USE::transcode().

206 {
207  char buf[100];
208  int status = snprintf( buf, 100, "%.10e", temp );
209  if ( status >= 100 )
210  {
211  std::cout << "XMLProcessor::_toXMLCh(int temp): buffer overflow, the std::string will be truncated!" << std::endl;
212  }
213  else if ( status <0 )
214  {
215  std::cout << "XMLProcessor::_toXMLCh(int temp): output error" << std::endl;
216  }
217  XMLCh* buff = XERCES_CPP_NAMESPACE::XMLString::transcode( buf );
218  return buff;
219 }
XMLCh * transcode(const T &fInput)
tuple cout
Definition: gather_cfg.py:145
tuple status
Definition: mps_update.py:57
XMLCh * XMLProcessor::_toXMLCh ( time_t  temp)
inlinestatic

Definition at line 221 of file XMLProcessor.h.

References gather_cfg::cout, mps_update::status, and XERCES_CPP_NAMESPACE_USE::transcode().

222 {
223  char buf[100];
224  int status = strftime( buf, 50, "%c", gmtime( &temp ) );
225  if ( status == 0 )
226  {
227  std::cout << "XML Processor::_toXMLCh(int temp): buffer overflow, the std::string is indeterminate!" << std::endl;
228  }
229  XMLCh* buff = XERCES_CPP_NAMESPACE::XMLString::transcode( buf );
230  return buff;
231 }
XMLCh * transcode(const T &fInput)
tuple cout
Definition: gather_cfg.py:145
tuple status
Definition: mps_update.py:57
int XMLProcessor::addLMapHBEFDataset ( XMLDOMBlock doc,
LMapRowHBEF row,
std::string  templateFileName 
)

Definition at line 94 of file XMLProcessor.cc.

int XMLProcessor::addLMapHODataset ( XMLDOMBlock doc,
LMapRowHO row,
std::string  templateFileName 
)

Definition at line 160 of file XMLProcessor.cc.

XMLDOMBlock * XMLProcessor::createLMapHBEFXMLBase ( std::string  templateFileName)

Definition at line 81 of file XMLProcessor.cc.

XMLDOMBlock * XMLProcessor::createLMapHOXMLBase ( std::string  templateFileName)

Definition at line 147 of file XMLProcessor.cc.

static XMLProcessor* XMLProcessor::getInstance ( )
inlinestatic

Definition at line 145 of file XMLProcessor.h.

References instance, and XMLProcessor().

146  {
147  if (!instance) instance = new XMLProcessor();
148  return instance;
149  }
static XMLProcessor * instance
Definition: XMLProcessor.h:180
int XMLProcessor::init ( void  )

Definition at line 298 of file XMLProcessor.cc.

XMLCh * XMLProcessor::serializeDOM ( XERCES_CPP_NAMESPACE::DOMNode *  node,
std::string  target = "stdout" 
)

Definition at line 238 of file XMLProcessor.cc.

int XMLProcessor::terminate ( void  )

Definition at line 317 of file XMLProcessor.cc.

int XMLProcessor::test ( void  )

Definition at line 217 of file XMLProcessor.cc.

int XMLProcessor::write ( XMLDOMBlock doc,
std::string  target = "stdout" 
)

Definition at line 205 of file XMLProcessor.cc.

Member Data Documentation

XERCES_CPP_NAMESPACE_USE XMLProcessor * XMLProcessor::instance = NULL
staticprivate

Definition at line 180 of file XMLProcessor.h.

Referenced by getInstance().