Gaudi Framework, version v23r7

Home   Generated: Wed Mar 20 2013
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
AlgorithmHistory.cpp
Go to the documentation of this file.
1 
2 //
3 // $Id: AlgorithmHistory.cpp,v 1.1 2006/11/09 10:24:05 mato Exp $
4 //
5 // GaudiHistory/AlgorithmHistory.cpp
6 //
7 // Contains history information for an Algorithm
8 //
9 //
10 // @author: Charles Leggett
11 //
13 
15 #include "GaudiKernel/JobHistory.h"
16 #include "GaudiKernel/Algorithm.h"
17 #include <iostream>
18 #include <assert.h>
19 
20 
21 using std::ostream;
22 using std::endl;
23 using std::type_info;
24 using std::vector;
25 
26 //**********************************************************************
27 // Member functions.
28 //**********************************************************************
29 
30 // Constructor.
31 
33 :
34  m_algorithm_type(System::typeinfoName(typeid(alg))),
35  m_algorithm_version(alg.version()),
36  m_algorithm_name(alg.name()),
37  m_algorithm( &alg ),
38  m_properties(alg.getProperties()),
39  m_jobHistory(job)
40 {
41  assert( alg.subAlgorithms() != 0 );
42 
44  ialg=alg.subAlgorithms()->begin();
45  ialg!=alg.subAlgorithms()->end(); ++ ialg ) {
47  }
48 }
49 
50 //**********************************************************************
51 
53  const std::string& algName,
54  const std::string& algType,
55  const PropertyList& props,
56  const HistoryList& subHists) :
57  m_algorithm_type(algType), // FIXME type_info???
58  m_algorithm_version(algVersion),
59  m_algorithm_name(algName),
60  m_algorithm(0),
61  m_properties(props),
62  m_subalgorithm_histories(subHists) {}
63 
64 //**********************************************************************
65 
66 // Destructor.
67 
71  iphist!=m_subalgorithm_histories.end(); ++iphist ) {
72  delete *iphist;
73  }
74 }
75 
76 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
77 
78 const CLID&
80 
81  static CLID CLID_AlgorithmHistory = 56809101; //from `clid AlgorithmHistory`
82  return CLID_AlgorithmHistory;
83 
84 }
85 
86 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
87 
88 void
89 AlgorithmHistory::dump(std::ostream& ost, const bool isXML, int ind) const {
90 
91  if (!isXML) {
92  ost << "Type: " << algorithm_type() << endl;
93  ost << "Name: " << algorithm_name() << endl;
94  ost << "Version: " << algorithm_version() << endl;
95  // Properties.
96  ost << "Properties: [" << endl;;
98  ipprop=properties().begin();
99  ipprop!=properties().end(); ++ipprop ) {
100  const Property& prop = **ipprop;
101  prop.fillStream(ost);
102  ost << endl;
103  }
104  ost << "]" << endl;
105  // Subalgorithms.
106  if ( subalgorithm_histories().size() == 0 ) {
107  ost << "No subalgorithms.";
108  } else {
109  ost << "Subalgorithms: {" << endl;
111  iphist=subalgorithm_histories().begin();
112  iphist!=subalgorithm_histories().end(); ++iphist ) {
113  if ( iphist==subalgorithm_histories().begin() ) {
114  ost << "----------" << endl;
115  }
116  ost << **iphist << endl;
117  ost << "----------" << endl;
118  }
119  ost << "}";
120  }
121  } else {
122  ind += 2;
123  indent(ost,ind);
124  ost << "<COMPONENT name=\"" << algorithm_name()
125  << "\" class=\"" << convert_string(algorithm_type())
126  << "\" version=\"" << algorithm_version()
127  << "\">" << std::endl;
128 
130  ipprop=properties().begin();
131  ipprop!=properties().end(); ++ipprop ) {
132  const Property& prop = **ipprop;
133  indent(ost,ind+2);
134  ost << "<PROPERTY name=\"" << prop.name()
135  << "\" value=\"" << convert_string(prop.toString())
136  << "\" documentation=\"" << convert_string(prop.documentation())
137  << "\">" << std::endl;
138  }
139 
140  // Subalgs
141  if ( subalgorithm_histories().size() != 0 ) {
143  iphist=subalgorithm_histories().begin();
144  iphist!=subalgorithm_histories().end(); ++iphist ) {
145  (*iphist)->dump(ost,isXML,ind+2);
146  }
147 
148  }
149 
150  indent(ost,ind);
151  ost << "</COMPONENT>" << std::endl;
152 
153 
154 
155 
156 
157  }
158 }
159 
160 
161 //**********************************************************************
162 // Free functions.
163 //**********************************************************************
164 
165 // Output stream.
166 
168 
169  rhs.dump(lhs,false);
170 
171  return lhs;
172 }
173 
174 //**********************************************************************

Generated at Wed Mar 20 2013 17:59:39 for Gaudi Framework, version v23r7 by Doxygen version 1.8.2 written by Dimitri van Heesch, © 1997-2004