Gaudi Framework, version v20r2

Generated: 18 Jul 2008

FastContainersSvc Class Reference

#include <FastContainersSvc/FastContainersSvc.h>

Inheritance diagram for FastContainersSvc:

Inheritance graph
[legend]
Collaboration diagram for FastContainersSvc:

Collaboration graph
[legend]
List of all members.

Detailed Description

Data service for objects of type TransientFastContainer.

Pointers to objects in this transient store are always valid. The instances of TransientFastContainer are cleared before each event.

Author:
Marco Clemencic
Date:
2006-05-03

Definition at line 22 of file FastContainersSvc.h.

Public Member Functions

virtual StatusCode initialize ()
 Initialize the service.
virtual StatusCode reinitialize ()
 Initialize the service.
virtual StatusCode finalize ()
 Finalize the service.
virtual void resetStore ()
 Reset all the instances of TransientFastContainerBase in the store.
virtual StatusCode queryInterface (const InterfaceID &riid, void **ppvInterface)
 Query the interface of the service.
virtual void handle (const Incident &incident)
 Handle the new incident.

Protected Member Functions

 FastContainersSvc (const std::string &name, ISvcLocator *svc)
 Standard service constructor.
virtual ~FastContainersSvc ()
 Destructor.

Private Attributes

std::string m_rootDirName
 Name of the root node (property "RootDirName").
FastContainersSvc::StoreResetter m_storeResetter
 Internal data store agent used to find and clear objects of type TransientFastContainerBase.

Friends

class SvcFactory< FastContainersSvc >

Classes

class  StoreResetter
 Internal data store agent used to find and clear objects of type TransientFastContainerBase. More...


Constructor & Destructor Documentation

FastContainersSvc::FastContainersSvc ( const std::string name,
ISvcLocator svc 
) [protected]

Standard service constructor.

Definition at line 26 of file FastContainersSvc.cpp.

00026                                                                           :
00027   DataSvc(name,svc)
00028 {
00029   declareProperty("RootDirName", m_rootDirName = "fc" );
00030   m_rootName = "/" + m_rootDirName;
00031 }

FastContainersSvc::~FastContainersSvc (  )  [protected, virtual]

Destructor.

Definition at line 36 of file FastContainersSvc.cpp.

00036 {}


Member Function Documentation

StatusCode FastContainersSvc::initialize (  )  [virtual]

Initialize the service.

Reimplemented from DataSvc.

Definition at line 57 of file FastContainersSvc.cpp.

References IIncidentSvc::addListener(), IncidentType::BeginEvent, endmsg(), MSG::FATAL, DataSvc::initialize(), StatusCode::isSuccess(), DataSvc::m_incidentSvc, DataSvc::m_rootName, Service::msgSvc(), Service::name(), DataSvc::setRoot(), and MSG::VERBOSE.

00057                                          {
00058   // initialize base class
00059   StatusCode status = DataSvc::initialize();
00060   if (!status.isSuccess()) return status;
00061 
00062   MsgStream log(msgSvc(), name());
00063   // create root node
00064   log << MSG::VERBOSE << "creating root node" << endmsg;
00065   status = setRoot(m_rootName,new DataObject);
00066   if (!status.isSuccess()){
00067     log << MSG::FATAL << "failed to create the root node" << endmsg;
00068     return status;
00069   }
00070 
00071   // register to the incident service
00072   log << MSG::VERBOSE << "registering to the incident service for " << IncidentType::BeginEvent << endmsg;
00073   m_incidentSvc->addListener(this,IncidentType::BeginEvent);
00074 
00075   return status;
00076 }

StatusCode FastContainersSvc::reinitialize (  )  [virtual]

Initialize the service.

Reimplemented from DataSvc.

Definition at line 81 of file FastContainersSvc.cpp.

References StatusCode::SUCCESS.

00081                                            {
00082   // do nothing
00083   return StatusCode::SUCCESS;
00084 }

StatusCode FastContainersSvc::finalize (  )  [virtual]

Finalize the service.

Reimplemented from DataSvc.

Definition at line 89 of file FastContainersSvc.cpp.

References IncidentType::BeginEvent, endmsg(), DataSvc::finalize(), DataSvc::m_incidentSvc, Service::msgSvc(), Service::name(), IIncidentSvc::removeListener(), and MSG::VERBOSE.

00089                                        {
00090   MsgStream log(msgSvc(), name());
00091   // de-register to the incident service
00092   log << MSG::VERBOSE << "de-registering from the incident service" << endmsg;
00093   m_incidentSvc->removeListener(this,IncidentType::BeginEvent);
00094 
00095   return DataSvc::finalize();
00096 }

void FastContainersSvc::resetStore (  )  [virtual]

Reset all the instances of TransientFastContainerBase in the store.

Definition at line 101 of file FastContainersSvc.cpp.

References StatusCode::ignore(), m_storeResetter, and DataSvc::traverseTree().

Referenced by handle().

00101                                    {
00102   traverseTree(&m_storeResetter).ignore();
00103 }

StatusCode FastContainersSvc::queryInterface ( const InterfaceID riid,
void **  ppvInterface 
) [virtual]

Query the interface of the service.

Reimplemented from DataSvc.

Definition at line 41 of file FastContainersSvc.cpp.

References IInterface::addRef(), IIncidentListener::interfaceID(), DataSvc::queryInterface(), and StatusCode::SUCCESS.

00041                                                                                          {
00042 
00043   if ( IIncidentListener::interfaceID().versionMatch(riid) ) {
00044     *ppvInterface = (IIncidentListener*)this;
00045   }
00046   else {
00047     return DataSvc::queryInterface(riid, ppvInterface);
00048   }
00049 
00050   addRef();
00051   return StatusCode::SUCCESS;
00052 }

void FastContainersSvc::handle ( const Incident incident  )  [virtual]

Handle the new incident.

Implements IIncidentListener.

Definition at line 108 of file FastContainersSvc.cpp.

References IncidentType::BeginEvent, resetStore(), and Incident::type().

00108                                                        {
00109   if (incident.type() == IncidentType::BeginEvent)
00110     resetStore();
00111 }


Friends And Related Function Documentation

friend class SvcFactory< FastContainersSvc > [friend]

Definition at line 61 of file FastContainersSvc.h.


Member Data Documentation

std::string FastContainersSvc::m_rootDirName [private]

Name of the root node (property "RootDirName").

Definition at line 64 of file FastContainersSvc.h.

FastContainersSvc::StoreResetter FastContainersSvc::m_storeResetter [private]

Internal data store agent used to find and clear objects of type TransientFastContainerBase.

Referenced by resetStore().


The documentation for this class was generated from the following files:
Generated at Fri Jul 18 12:07:17 2008 for Gaudi Framework, version v20r2 by Doxygen version 1.5.1 written by Dimitri van Heesch, © 1997-2004