ATLAS Offline Software
Loading...
Searching...
No Matches
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 :
21 IElementStreamer(name, attributes, os) {
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}
IElementStreamer(const std::string &name, const std::map< std::string, std::string > &attributeMap, std::ostream &os=std::cout)

◆ 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}
std::vector< std::string > m_attributeValues
std::vector< std::string > m_attributeNames

◆ 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}
static const Attributes_t empty

◆ ~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.

26{};

◆ 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.

28{};

◆ m_nodeIndex

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

Definition at line 27 of file IElementStreamer.h.

27{};

◆ 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: