ATLAS Offline Software
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 
13 namespace 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 
74 void
76 SetName( std::string name )
77 {
78  this->m_name.SetString(name.c_str());
79 }
80 
81 const char*
83 GetName() const
84 {
85  return this->m_name.GetName();
86 }
87 
88 void
90 AddAlg( std::string alg )
91 {
92  TObjString* newAlg = new TObjString(alg.c_str());
93  this->m_subAlgs->Add(newAlg);
94 }
95 
96 TIter
98 GetAllAlg() const
99 {
100  return TIter(this->m_subAlgs);
101 }
102 
103 void
105 AddLib( std::string lib )
106 {
107  TObjString* newLib = new TObjString(lib.c_str());
108  this->m_libs->Add(newLib);
109 }
110 
111 TIter
113 GetAllLib() const
114 {
115  return TIter(this->m_libs);
116 }
117 
118 void
120 PrintIOStream( 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 
144 void 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 
158 std::ostream& operator<<( std::ostream& o, const dqi::HanConfigCompAlg& p ){
159  p.PrintIOStream(o);
160  return o;
161 }
162 
163 std::ostream& operator<<( std::ostream& o, const dqi::HanConfigCompAlg* p ){
164  p->PrintIOStream(o);
165  return o;
166 }
dqi::HanConfigCompAlg
Definition: HanConfigCompAlg.h:22
SGout2dot.alg
alg
Definition: SGout2dot.py:243
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
dqi::HanConfigCompAlg::AddAlg
virtual void AddAlg(std::string alg)
Definition: HanConfigCompAlg.cxx:90
dqi::HanConfigCompAlg::GetAllLib
virtual TIter GetAllLib() const
Definition: HanConfigCompAlg.cxx:113
dqi::HanConfigCompAlg::GetAllAlg
virtual TIter GetAllAlg() const
Definition: HanConfigCompAlg.cxx:98
ClassImp
ClassImp(xAOD::TFileChecker) namespace xAOD
Definition: TFileChecker.cxx:28
HanConfigCompAlg.h
dqi::HanConfigCompAlg::operator=
HanConfigCompAlg & operator=(const HanConfigCompAlg &other)
Definition: HanConfigCompAlg.cxx:44
dqi::HanConfigCompAlg::m_subAlgs
TSeqCollection * m_subAlgs
Definition: HanConfigCompAlg.h:42
dqi::HanConfigCompAlg::HanConfigCompAlg
HanConfigCompAlg()
Definition: HanConfigCompAlg.cxx:16
HanUtils.h
dqi::HanConfigCompAlg::m_name
TObjString m_name
Definition: HanConfigCompAlg.h:41
operator<<
std::ostream & operator<<(std::ostream &o, const dqi::HanConfigCompAlg &p)
Definition: HanConfigCompAlg.cxx:158
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
dqi::newTList
TSeqCollection * newTList(const char *name, TObject *obj=0)
Definition: HanUtils.cxx:19
dqi::HanConfigCompAlg::SetName
virtual void SetName(std::string name)
Definition: HanConfigCompAlg.cxx:76
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
dqi::HanConfigCompAlg::m_libs
TSeqCollection * m_libs
Definition: HanConfigCompAlg.h:43
dqi::HanConfigCompAlg::PrintIOStream
virtual void PrintIOStream(std::ostream &o) const
Definition: HanConfigCompAlg.cxx:120
dqi::HanConfigCompAlg::GetName
virtual const char * GetName() const
Definition: HanConfigCompAlg.cxx:83
dqi::HanConfigCompAlg::AddLib
virtual void AddLib(std::string lib)
Definition: HanConfigCompAlg.cxx:105
dqi
Definition: CompositeAlgorithm.h:16
dqi::HanConfigCompAlg::~HanConfigCompAlg
virtual ~HanConfigCompAlg()
Definition: HanConfigCompAlg.cxx:67