| # Gaudi Framework, version v22r0 |

Home |  | Generated: 9 Feb 2011

# ServiceHistory.cpp

Go to the documentation of this file.

    00001
    00002 //
    00003 // $Id: ServiceHistory.cpp,v 1.2 2008/06/04 12:35:15 marcocle Exp $
    00004 //
    00005 // GaudiHistory/ServiceHistory.cpp
    00006 //
    00007 // Contains history information for a Service
    00008 //
    00009 //
    00010 // @author: Charles Leggett
    00011 //
    00013
    00014 #include "GaudiKernel/ServiceHistory.h"
    00015 #include "GaudiKernel/JobHistory.h"
    00016 #include "GaudiKernel/IService.h"
    00017 #include "GaudiKernel/Service.h"
    00018 #include <iostream>
    00019
    00020 using namespace std;
    00021
    00022
    00023 //
    00025 //
    00026
    00027 ServiceHistory::ServiceHistory():
    00028   //  HistoryObj(),
    00029   m_pService(0),
    00030   m_name("none"),
    00031   m_type("none")
    00032 {
    00033
    00034 }
    00035
    00036
    00037 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
    00038 ServiceHistory::ServiceHistory(const IService* isv, const JobHistory* job):
    00039   //  HistoryObj(),
    00040   m_pService(isv),
    00041   m_jobHistory(job),
    00042   m_name(isv->name())
    00043 {
    00044
    00045   const Service *svc = dynamic_cast<const Service*>(isv);
    00046   m_type = System::typeinfoName(typeid(*svc));
    00047   m_properties = svc->getProperties();
    00048
    00049 }
    00050
    00051
    00052 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
    00053
    00054 ServiceHistory::ServiceHistory(const IService& isv, const JobHistory* job):
    00055   //  HistoryObj(),
    00056   m_pService(&isv),
    00057   m_jobHistory(job),
    00058   m_name(isv.name())
    00059 {
    00060
    00061   const Service *svc = dynamic_cast<const Service*>(&isv);
    00062   m_type = System::typeinfoName(typeid(*svc));
    00063   m_properties = svc->getProperties();
    00064
    00065 }
    00066
    00067 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
    00068
    00069 ServiceHistory::~ServiceHistory() {
    00070
    00071 }
    00072
    00073 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
    00074
    00075 const CLID& ServiceHistory::classID() {
    00076
    00077   static CLID CLID_ServiceHistory = 187225489;   // from `clid ServiceHistory`
    00078   return CLID_ServiceHistory;
    00079
    00080 }
    00081
    00082 //**********************************************************************
    00083 // Free functions.
    00084 //**********************************************************************
    00085
    00086 // Output stream.
    00087
    00088 ostream& operator<<(ostream& lhs, const ServiceHistory& rhs) {
    00089   lhs << "Name: " << rhs.name() << endl;
    00090   lhs << "Type: " << rhs.type() << endl;
    00091
    00092   //Properties
    00093   lhs << "Properties: [" << endl;
    00094
    00095   for ( ServiceHistory::PropertyList::const_iterator
    00096         ipprop=rhs.properties().begin();
    00097         ipprop!=rhs.properties().end(); ++ipprop ) {
    00098     const Property& prop = **ipprop;
    00099     prop.fillStream(lhs);
    00100     lhs << endl;
    00101   }
    00102   lhs << "]" << endl;
    00103
    00104   return lhs;
    00105 }

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