ATLAS Offline Software
Public Member Functions | Protected Attributes | List of all members
SCT_CalibAlgs::XmlStreamer Class Reference

#include <XmlStreamer.h>

Inheritance diagram for SCT_CalibAlgs::XmlStreamer:
Collaboration diagram for SCT_CalibAlgs::XmlStreamer:

Public Member Functions

 XmlStreamer (const std::string &name, const std::map< std::string, std::string > &attributes, std::ostream &os=std::cout)
 
 XmlStreamer (const std::string &name, const std::string &attributeName, const std::string &attributeValue, std::ostream &os=std::cout)
 
 XmlStreamer (const std::string &name, const std::vector< std::string > &attributeNames, const std::vector< std::string > &attributeValues, std::ostream &os=std::cout)
 
 XmlStreamer (const std::string &name, std::ostream &os=std::cout)
 
virtual ~XmlStreamer ()
 
template<class T >
void value (const T &v)
 

Protected Attributes

std::string m_name
 
std::vector< std::string > m_attributeNames
 
std::vector< std::string > m_attributeValues
 
std::ostream & m_os
 
unsigned int m_depth {}
 
unsigned int m_nodeIndex {}
 
unsigned int m_nodeId {}
 

Detailed Description

Definition at line 18 of file XmlStreamer.h.

Constructor & Destructor Documentation

◆ XmlStreamer() [1/4]

SCT_CalibAlgs::XmlStreamer::XmlStreamer ( const std::string &  name,
const std::map< std::string, std::string > &  attributes,
std::ostream &  os = std::cout 
)

Definition at line 20 of file XmlStreamer.cxx.

20  :
22  m_os << "\n<" << m_name;
23  if (not attributes.empty()) {
24  Attributes_t::const_iterator i{attributes.begin()};
25  const Attributes_t::const_iterator end{attributes.end()};
26  for (; i!=end; ++i) {
27  m_os << " " << i->first << "=\"" << i->second << "\"";
28  }
29  }
30  m_os << ">";
31  m_os.flush();
32 }

◆ XmlStreamer() [2/4]

SCT_CalibAlgs::XmlStreamer::XmlStreamer ( const std::string &  name,
const std::string &  attributeName,
const std::string &  attributeValue,
std::ostream &  os = std::cout 
)

Definition at line 50 of file XmlStreamer.cxx.

50  :
51  IElementStreamer(name, attributeName, attributeValue, os) {
52  m_os << "\n<" << m_name;
53  for (unsigned int i{0}; i!=m_attributeNames.size(); ++i) {
54  m_os << " " << m_attributeNames[i] << "=\"" << m_attributeValues[i] << "\"";
55  }
56  m_os << ">";
57  m_os.flush();
58 }

◆ XmlStreamer() [3/4]

SCT_CalibAlgs::XmlStreamer::XmlStreamer ( const std::string &  name,
const std::vector< std::string > &  attributeNames,
const std::vector< std::string > &  attributeValues,
std::ostream &  os = std::cout 
)

Definition at line 34 of file XmlStreamer.cxx.

34  :
35  IElementStreamer(name, attributeNames, attributeValues, os) {
36  m_os << "\n<" << m_name;
37  for (unsigned int i{0}; i!=attributeNames.size(); ++i) {
38  m_os << " " << attributeNames[i] << "=\"" << attributeValues[i] << "\"";
39  }
40  m_os << ">";
41  m_os.flush();
42 }

◆ XmlStreamer() [4/4]

SCT_CalibAlgs::XmlStreamer::XmlStreamer ( const std::string &  name,
std::ostream &  os = std::cout 
)

Definition at line 44 of file XmlStreamer.cxx.

45  :IElementStreamer(name, empty, os) {
46  m_os << "\n<" << m_name << ">";
47  m_os.flush();
48 }

◆ ~XmlStreamer()

SCT_CalibAlgs::XmlStreamer::~XmlStreamer ( )
virtual

Definition at line 60 of file XmlStreamer.cxx.

60  {
61  m_os << "</" << m_name << ">";
62  if (m_depth==1) m_os << "\n";
63 }

Member Function Documentation

◆ value()

template<class T >
void SCT_CalibAlgs::IElementStreamer::value ( const T &  v)
inlineinherited

Definition at line 36 of file IElementStreamer.h.

36  {
37  m_os<<v;
38  }

Member Data Documentation

◆ m_attributeNames

std::vector<std::string> SCT_CalibAlgs::IElementStreamer::m_attributeNames
protectedinherited

Definition at line 23 of file IElementStreamer.h.

◆ m_attributeValues

std::vector<std::string> SCT_CalibAlgs::IElementStreamer::m_attributeValues
protectedinherited

Definition at line 24 of file IElementStreamer.h.

◆ m_depth

unsigned int SCT_CalibAlgs::IElementStreamer::m_depth {}
protectedinherited

Definition at line 26 of file IElementStreamer.h.

◆ m_name

std::string SCT_CalibAlgs::IElementStreamer::m_name
protectedinherited

Definition at line 22 of file IElementStreamer.h.

◆ m_nodeId

unsigned int SCT_CalibAlgs::IElementStreamer::m_nodeId {}
protectedinherited

Definition at line 28 of file IElementStreamer.h.

◆ m_nodeIndex

unsigned int SCT_CalibAlgs::IElementStreamer::m_nodeIndex {}
protectedinherited

Definition at line 27 of file IElementStreamer.h.

◆ m_os

std::ostream& SCT_CalibAlgs::IElementStreamer::m_os
protectedinherited

Definition at line 25 of file IElementStreamer.h.


The documentation for this class was generated from the following files:
SCT_CalibAlgs::IElementStreamer::m_attributeValues
std::vector< std::string > m_attributeValues
Definition: IElementStreamer.h:24
SCT_CalibAlgs::IElementStreamer::m_name
std::string m_name
Definition: IElementStreamer.h:22
SCT_CalibAlgs::IElementStreamer::IElementStreamer
IElementStreamer(const std::string &name, const std::map< std::string, std::string > &attributeMap, std::ostream &os=std::cout)
Definition: IElementStreamer.cxx:15
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
lumiFormat.i
int i
Definition: lumiFormat.py:85
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
python.PyAthena.v
v
Definition: PyAthena.py:154
SCT_CalibAlgs::IElementStreamer::m_attributeNames
std::vector< std::string > m_attributeNames
Definition: IElementStreamer.h:23
SCT_CalibAlgs::IElementStreamer::m_os
std::ostream & m_os
Definition: IElementStreamer.h:25
SCT_CalibAlgs::IElementStreamer::m_depth
unsigned int m_depth
Definition: IElementStreamer.h:26
collListGuids.attributes
attributes
Definition: collListGuids.py:46