ATLAS Offline Software
Loading...
Searching...
No Matches
HanConfigCompAlg.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
7
8//Get rid of Root macros that confuse Doxygen
12
13namespace dqi {
14
17{
18 this->m_subAlgs = newTList("subAlgs");
19 this->m_libs = newTList("libs");
20}
21
24 :TObject(other),
25 m_name(other.m_name)
26{
27 this->m_subAlgs = newTList("subAlgs");
28 this->m_libs = newTList("libs");
29 TIter nextAlg(other.m_subAlgs);
30 TObjString* otherAlg;
31 while((otherAlg = dynamic_cast<TObjString*>(nextAlg())) != 0){
32 TObjString* alg = new TObjString(*otherAlg);
33 this->m_subAlgs->Add(alg);
34 }
35 TIter nextLib(other.m_libs);
36 TObjString* otherLib;
37 while((otherLib = dynamic_cast<TObjString*>(nextLib())) != 0){
38 TObjString* lib = new TObjString(*otherLib);
39 this->m_libs->Add(lib);
40 }
41}
42
45{
46 if (this == &other) return *this;
47
48 this->m_name = other.m_name;
49 this->m_subAlgs = newTList("subAlgs");
50 this->m_libs = newTList("libs");
51 TIter nextAlg(other.m_subAlgs);
52 TObjString* otherAlg;
53 while((otherAlg = dynamic_cast<TObjString*>(nextAlg())) != 0){
54 TObjString* alg = new TObjString(*otherAlg);
55 this->m_subAlgs->Add(alg);
56 }
57 TIter nextLib(other.m_libs);
58 TObjString* otherLib;
59 while((otherLib = dynamic_cast<TObjString*>(nextLib())) != 0){
60 TObjString* lib = new TObjString(*otherLib);
61 this->m_libs->Add(lib);
62 }
63 return *this;
64}
65
68 this->m_subAlgs->Delete();
69 this->m_libs->Delete();
70 delete m_subAlgs;
71 delete m_libs;
72}
73
74void
76SetName( std::string name )
77{
78 this->m_name.SetString(name.c_str());
79}
80
81const char*
83GetName() const
84{
85 return this->m_name.GetName();
86}
87
88void
90AddAlg( std::string alg )
91{
92 TObjString* newAlg = new TObjString(alg.c_str());
93 this->m_subAlgs->Add(newAlg);
94}
95
96TIter
98GetAllAlg() const
99{
100 return TIter(this->m_subAlgs);
101}
102
103void
105AddLib( std::string lib )
106{
107 TObjString* newLib = new TObjString(lib.c_str());
108 this->m_libs->Add(newLib);
109}
110
111TIter
113GetAllLib() const
114{
115 return TIter(this->m_libs);
116}
117
118void
120PrintIOStream( std::ostream& o ) const
121{
122 o << "\nHanConfigCompAlg: " << this->GetName() << "\n";
123
124 if (!( m_subAlgs->IsEmpty())) {
125 o << " Sub-Algorithms = {\n";
126 TIter nextAlg(m_subAlgs);
127 TObjString* alg;
128 while((alg=dynamic_cast<TObjString*>(nextAlg()))!=0){
129 o << " " << alg;
130 }
131 o << " }\n";
132 }
133 if (!( m_libs->IsEmpty())) {
134 o << " Libraries = {\n";
135 TIter nextLib(m_libs);
136 TObjString* lib;
137 while((lib=dynamic_cast<TObjString*>(nextLib()))!=0){
138 o << " " << lib;
139 }
140 o << " }\n";
141 }
142}
143
144void HanConfigCompAlg::Streamer(TBuffer &R__b)
145{
146 // Stream an object of class dqi::HanConfigCompAlg.
147
148 if (R__b.IsReading()) {
149 //delete m_subAlgs; delete m_libs;
150 R__b.ReadClassBuffer(dqi::HanConfigCompAlg::Class(),this);
151 } else {
152 R__b.WriteClassBuffer(dqi::HanConfigCompAlg::Class(),this);
153 }
154}
155
156}//namespace dqi
157
158std::ostream& operator<<( std::ostream& o, const dqi::HanConfigCompAlg& p ){
159 p.PrintIOStream(o);
160 return o;
161}
162
163std::ostream& operator<<( std::ostream& o, const dqi::HanConfigCompAlg* p ){
164 p->PrintIOStream(o);
165 return o;
166}
std::ostream & operator<<(std::ostream &o, const dqi::HanConfigCompAlg &p)
ClassImp(xAOD::Experimental::RFileChecker) namespace xAOD
virtual TIter GetAllLib() const
virtual TIter GetAllAlg() const
virtual void PrintIOStream(std::ostream &o) const
virtual const char * GetName() const
TSeqCollection * m_libs
TSeqCollection * m_subAlgs
HanConfigCompAlg & operator=(const HanConfigCompAlg &other)
virtual void AddAlg(std::string alg)
virtual void SetName(std::string name)
virtual void AddLib(std::string lib)
TSeqCollection * newTList(const char *name, TObject *obj=0)
Definition HanUtils.cxx:18