| # Gaudi Framework, version v23r0 |

Home |  | Generated: Mon Jan 30 2012

# AlgToolHistory.cpp

Go to the documentation of this file.

    00001
    00002 //
    00003 // $Id: AlgToolHistory.cpp,v 1.1 2006/11/09 10:24:05 mato Exp $
    00004 //
    00005 // GaudiHistory/AlgToolHistory.cpp
    00006 //
    00007 // Contains history information for an AlgTool
    00008 //
    00009 //
    00010 // @author: Charles Leggett
    00011 //
    00013
    00014 #include "GaudiKernel/AlgToolHistory.h"
    00015 #include "GaudiKernel/JobHistory.h"
    00016 #include "GaudiKernel/AlgTool.h"
    00017
    00018 #include <iostream>
    00019
    00020 using std::ostream;
    00021 using std::endl;
    00022
    00023 AlgToolHistory::AlgToolHistory(const AlgTool& alg, const JobHistory* job)
    00024 :
    00025   m_type(alg.type()),
    00026   m_version("UNKNOWN"),
    00027   m_name(alg.name()),
    00028   m_tool( &alg ),
    00029   m_properties(alg.getProperties()),
    00030   m_jobHistory(job)
    00031 {
    00032 }
    00033
    00034 //**********************************************************************
    00035
    00036 AlgToolHistory::AlgToolHistory(const std::string& algVersion,
    00037                                const std::string& algName,
    00038                                const std::string& algType,
    00039                                const AlgTool* tool,
    00040                                const PropertyList& props,
    00041                                const JobHistory* job):
    00042   m_type(algType),   // FIXME type_info???
    00043   m_version(algVersion),
    00044   m_name(algName),
    00045   m_tool(tool),
    00046   m_properties(props),
    00047   m_jobHistory(job)
    00048 {}
    00049
    00050 //**********************************************************************
    00051
    00052 const CLID& AlgToolHistory::classID() {
    00053
    00054   static CLID CLID_AlgToolHistory = 171959758;   // from `clid AlgToolHistory`
    00055   return CLID_AlgToolHistory;
    00056
    00057 }
    00058
    00059 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
    00060
    00061 void
    00062 AlgToolHistory::dump(std::ostream& ost, const bool isXML, int ind) const {
    00063
    00064   if (!isXML) {
    00065
    00066     ost << "Name: " << algtool_name() << endl;
    00067     ost << "Type: " << algtool_type() << endl;
    00068     ost << "Version: " << algtool_version() << endl;
    00069     ost << "Parent: " << algtool_instance()->name() << endl;
    00070
    00071     //Properties
    00072     ost << "Properties: [" << endl;
    00073
    00074     for ( AlgToolHistory::PropertyList::const_iterator
    00075             ipprop=properties().begin();
    00076           ipprop!=properties().end(); ++ipprop ) {
    00077       const Property& prop = **ipprop;
    00078       prop.fillStream(ost);
    00079       ost << endl;
    00080     }
    00081     ost << "]" << endl;
    00082
    00083   } else {
    00084
    00085     ind += 2;
    00086     indent(ost,ind);
    00087     ost << "<COMPONENT name=\"" << algtool_name()
    00088         << "\" class=\"" << convert_string(algtool_type())
    00089         << "\" version=\"" << convert_string(algtool_version())
    00090         << "\" parent=\"" << convert_string(algtool_instance()->name())
    00091         << "\">" << endl;
    00092
    00093     for ( AlgToolHistory::PropertyList::const_iterator
    00094             ipprop=properties().begin();
    00095           ipprop!=properties().end(); ++ipprop ) {
    00096       const Property& prop = **ipprop;
    00097
    00098       indent(ost,ind+2);
    00099       ost << "<PROPERTY name=\"" << prop.name()
    00100           << "\" value=\"" << convert_string(prop.toString())
    00101           << "\" documentation=\"" << convert_string(prop.documentation())
    00102           << "\">" << endl;
    00103     }
    00104
    00105     indent(ost,ind);
    00106     ost << "</COMPONENT>" << endl;
    00107
    00108   }
    00109
    00110 }
    00111
    00112 //**********************************************************************
    00113
    00114 ostream& operator<<(ostream& lhs, const AlgToolHistory& rhs) {
    00115
    00116   rhs.dump(lhs,false);
    00117
    00118   return lhs;
    00119 }

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines