#include <RootIOFileStateSvc.h>
Inheritance diagram for RootIOFileStateSvc:
Public Types | |
SUCCESS | |
NO_INTERFACE | |
VERSMISMATCH | |
LAST_ERROR | |
enum | Status |
typedef std::vector< std::string > | FileList_t |
SUCCESS | |
NO_INTERFACE | |
VERSMISMATCH | |
LAST_ERROR | |
enum | Status |
Public Member Functions | |
RootIOFileStateSvc (const std::string &name, ISvcLocator *svc) | |
virtual | ~RootIOFileStateSvc () |
virtual StatusCode | initialize () |
virtual StatusCode | finalize () |
virtual StatusCode | queryInterface (const InterfaceID &riid, void **ppint) |
virtual void | handle (const Incident &incident) |
FileList_t | closedOutput () |
Return the names of output files that have been closed. | |
FileList_t | openOutput () |
Return the name of the currently open output files. | |
virtual unsigned long | addRef () |
virtual unsigned long | release () |
virtual const std::string & | name () const |
virtual const InterfaceID & | type () const |
virtual StatusCode | configure () |
virtual StatusCode | start () |
virtual StatusCode | stop () |
virtual StatusCode | terminate () |
virtual Gaudi::StateMachine::State | FSMState () const |
virtual Gaudi::StateMachine::State | targetFSMState () const |
virtual StatusCode | reinitialize () |
virtual StatusCode | restart () |
virtual StatusCode | sysInitialize () |
virtual StatusCode | sysStart () |
virtual StatusCode | sysStop () |
virtual StatusCode | sysFinalize () |
virtual StatusCode | sysReinitialize () |
virtual StatusCode | sysRestart () |
virtual StatusCode | setProperty (const Property &p) |
virtual StatusCode | setProperty (const std::string &s) |
virtual StatusCode | setProperty (const std::string &n, const std::string &v) |
StatusCode | setProperty (const std::string &name, const TYPE &value) |
virtual StatusCode | getProperty (Property *p) const |
virtual const Property & | getProperty (const std::string &name) const |
virtual StatusCode | getProperty (const std::string &n, std::string &v) const |
virtual const std::vector< Property * > & | getProperties () const |
ISvcLocator * | serviceLocator () const |
IMessageSvc * | msgSvc () |
IMessageSvc * | msgSvc () const |
IMessageSvc * | messageService () |
IMessageSvc * | messageService () const |
StatusCode | setProperties () |
StatusCode | service (const std::string &name, T *&psvc, bool createIf=true) const |
StatusCode | service (const std::string &svcType, const std::string &svcName, T *&psvc) const |
Property * | declareProperty (const std::string &name, T &property, const std::string &doc="none") const |
Property * | declareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="") const |
IAuditorSvc * | auditorSvc () const |
virtual unsigned long | addRef ()=0 |
virtual unsigned long | release ()=0 |
Static Public Member Functions | |
static const InterfaceID & | interfaceID () |
static const InterfaceID & | interfaceID () |
static const InterfaceID & | interfaceID () |
static const InterfaceID & | interfaceID () |
static const InterfaceID & | interfaceID () |
Public Attributes | |
SUCCESS | |
NO_INTERFACE | |
VERSMISMATCH | |
LAST_ERROR | |
Protected Member Functions | |
int | outputLevel () const |
virtual void | setServiceManager (ISvcManager *)=0 |
Protected Attributes | |
IntegerProperty | m_outputLevel |
Gaudi::StateMachine::State | m_state |
Gaudi::StateMachine::State | m_targetState |
IMessageSvc * | m_messageSvc |
Private Attributes | |
std::list< std::string > | m_closed |
std::list< std::string > | m_open |
IIncidentSvc * | m_incsvc |
Friends | |
friend class | ServiceManager |
Brett Viren <bv@bnl.gov> Thu Mar 10 13:12:32 2011
Definition at line 25 of file RootIOFileStateSvc.h.
typedef std::vector<std::string> IRootIOFileStateSvc::FileList_t [inherited] |
Definition at line 30 of file IRootIOFileStateSvc.h.
RootIOFileStateSvc::RootIOFileStateSvc | ( | const std::string & | name, | |
ISvcLocator * | svc | |||
) |
RootIOFileStateSvc::~RootIOFileStateSvc | ( | ) | [virtual] |
StatusCode RootIOFileStateSvc::initialize | ( | ) | [virtual] |
Reimplemented from Service.
Definition at line 18 of file RootIOFileStateSvc.cc.
00019 { 00020 MsgStream log(msgSvc(), "RootIOFileStateSvc"); 00021 00022 StatusCode sc = this->Service::initialize(); 00023 if (sc.isFailure()) return sc; 00024 00025 sc = this->service("IncidentSvc",m_incsvc,true); 00026 if (sc.isFailure()) { 00027 log << MSG::ERROR 00028 << "Failed to get IncidentSvc" << endreq; 00029 return sc; 00030 } 00031 m_incsvc->addListener(this,"RootIOIncident"); 00032 00033 return sc; 00034 }
StatusCode RootIOFileStateSvc::finalize | ( | ) | [virtual] |
Reimplemented from Service.
Definition at line 36 of file RootIOFileStateSvc.cc.
00037 { 00038 m_incsvc->removeListener(this,"RootIOIncident"); 00039 m_incsvc->release(); 00040 00041 return this->Service::finalize(); 00042 }
StatusCode RootIOFileStateSvc::queryInterface | ( | const InterfaceID & | riid, | |
void ** | ppint | |||
) | [virtual] |
Implements IIncidentListener.
Definition at line 44 of file RootIOFileStateSvc.cc.
00045 { 00046 if (IRootIOFileStateSvc::interfaceID().versionMatch(riid)) { 00047 *ppint = (IRootIOFileStateSvc*)this; 00048 this->addRef(); 00049 return StatusCode::SUCCESS; 00050 } 00051 return this->Service::queryInterface(riid,ppint); 00052 }
void RootIOFileStateSvc::handle | ( | const Incident & | incident | ) | [virtual] |
Implements IIncidentListener.
Definition at line 54 of file RootIOFileStateSvc.cc.
00055 { 00056 MsgStream log(msgSvc(), "RootIOFileStateSvc"); 00057 00058 // Handle the incident in a trivial manner 00059 00060 const RootIOIncident* rioinc = dynamic_cast<const RootIOIncident*>(&incident); 00061 if (!rioinc) { 00062 log << MSG::WARNING 00063 << "Ignoring unexpected incident not of class RootIOIncident" 00064 << endreq; 00065 return; 00066 } 00067 00068 if (rioinc->state() == RootIOIncident::opened_output) { 00069 std::string fn = rioinc->filename(); 00070 log << MSG::DEBUG 00071 << "Adding opened output \"" << fn 00072 << "\" to " << m_open.size() << " others" 00073 << endreq; 00074 m_open.push_back(fn); 00075 return; 00076 } 00077 00078 if (rioinc->state() == RootIOIncident::closed_output) { 00079 std::string fn = rioinc->filename(); 00080 log << MSG::DEBUG 00081 << "Adding closed output \"" << fn 00082 << "\" to " << m_closed.size() << " others" 00083 << endreq; 00084 m_closed.push_back(fn); 00085 00086 00087 std::list<std::string>::iterator it = std::find(m_open.begin(),m_open.end(),fn); 00088 if (it != m_open.end()) { 00089 m_open.erase(it); 00090 log << MSG::DEBUG 00091 << "Erased \"" << *it << "\" from open list, " << m_open.size() << " left" 00092 << endreq; 00093 } 00094 } 00095 }
IRootIOFileStateSvc::FileList_t RootIOFileStateSvc::closedOutput | ( | ) | [virtual] |
Return the names of output files that have been closed.
Implements IRootIOFileStateSvc.
Definition at line 97 of file RootIOFileStateSvc.cc.
00098 { 00099 return FileList_t(m_closed.begin(),m_closed.end()); 00100 }
IRootIOFileStateSvc::FileList_t RootIOFileStateSvc::openOutput | ( | ) | [virtual] |
Return the name of the currently open output files.
Implements IRootIOFileStateSvc.
Definition at line 102 of file RootIOFileStateSvc.cc.
00103 { 00104 return FileList_t(m_open.begin(),m_open.end()); 00105 }
const InterfaceID & IRootIOFileStateSvc::interfaceID | ( | ) | [static, inherited] |
Reimplemented from IService.
Definition at line 5 of file IRootIOFileStateSvc.cc.
00006 { 00007 static const InterfaceID booger("IRootIOFileStateSvc",0,0); 00008 return booger; 00009 }
std::list<std::string> RootIOFileStateSvc::m_closed [private] |
Definition at line 49 of file RootIOFileStateSvc.h.
std::list<std::string> RootIOFileStateSvc::m_open [private] |
Definition at line 49 of file RootIOFileStateSvc.h.
IIncidentSvc* RootIOFileStateSvc::m_incsvc [private] |
Definition at line 51 of file RootIOFileStateSvc.h.