#include <RawDataConSvc.h>
Inheritance diagram for RawDataConSvc:
Public Types | |
typedef std::vector< WorkerEntry > | Workers |
SUCCESS | |
NO_INTERFACE | |
VERSMISMATCH | |
LAST_ERROR | |
CONVERSIONSVC_NO_ERROR | |
NO_CONVERTER | |
INVALID_ADDRESS | |
INVALID_OBJECT | |
NO_MEMORY | |
BAD_STORAGE_TYPE | |
NO_SOURCE_OBJECT | |
ICONVERSIONSVC_LAST_ERROR | |
enum | Status |
enum | Status |
Public Member Functions | |
RawDataConSvc (const string &name, ISvcLocator *svc) | |
virtual | ~RawDataConSvc () |
virtual StatusCode | initialize () |
virtual StatusCode | finalize () |
virtual StatusCode | queryInterface (const InterfaceID &riid, void **ppv) |
virtual StatusCode | declareObject (const IRawDataConSvc::Leaf &leaf) |
virtual StatusCode | createAddress (long svc_type, const CLID &clid, const string *par, const unsigned long *ip, IOpaqueAddress *&refpAddr) |
virtual StatusCode | createAddress (long svc_type, const CLID &clid, const string &par, IOpaqueAddress *&refpAddr) |
virtual StatusCode | addConverters () |
virtual StatusCode | updateServiceState (IOpaqueAddress *pAddress) |
virtual long | repSvcType () const |
const CLID & | objType () const |
virtual StatusCode | setDataProvider (IDataProviderSvc *pService) |
virtual IDataProviderSvc * | dataProvider () const |
virtual StatusCode | setConversionSvc (IConversionSvc *svc) |
virtual IConversionSvc * | conversionSvc () const |
virtual StatusCode | setAddressCreator (IAddressCreator *creator) |
virtual IAddressCreator * | addressCreator () const |
virtual StatusCode | createObj (IOpaqueAddress *pAddress, DataObject *&refpObject) |
virtual StatusCode | fillObjRefs (IOpaqueAddress *pAddress, DataObject *pObject) |
virtual StatusCode | updateObj (IOpaqueAddress *pAddress, DataObject *refpObject) |
virtual StatusCode | updateObjRefs (IOpaqueAddress *pAddress, DataObject *pObject) |
virtual StatusCode | createRep (DataObject *pObject, IOpaqueAddress *&refpAddress) |
virtual StatusCode | fillRepRefs (IOpaqueAddress *pAddress, DataObject *pObject) |
virtual StatusCode | updateRep (IOpaqueAddress *pAddress, DataObject *pObject) |
virtual StatusCode | updateRepRefs (IOpaqueAddress *pAddress, DataObject *pObject) |
virtual StatusCode | addConverter (const CLID &clid) |
virtual StatusCode | addConverter (IConverter *pConverter) |
virtual StatusCode | removeConverter (const CLID &clid) |
virtual IConverter * | converter (const CLID &wanted) |
virtual StatusCode | connectOutput (const std::string &outputFile, const std::string &openMode) |
virtual StatusCode | connectOutput (const std::string &output) |
virtual StatusCode | commitOutput (const std::string &output, bool do_commit) |
virtual StatusCode | createAddress (long svc_type, const CLID &clid, const std::string *par, const unsigned long *ip, IOpaqueAddress *&refpAddress) |
virtual StatusCode | createAddress (long svc_type, const CLID &clid, const std::string &refAddress, IOpaqueAddress *&refpAddress) |
virtual StatusCode | convertAddress (const IOpaqueAddress *pAddress, std::string &refAddress) |
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 |
Static Public Member Functions | |
static const InterfaceID & | interfaceID () |
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 | |
CONVERSIONSVC_NO_ERROR | |
NO_CONVERTER | |
Protected Member Functions | |
virtual IAddressCreator * | addressCreator () |
virtual IConverter * | createConverter (long typ, const CLID &clid, const ICnvFactory *fac) |
virtual StatusCode | configureConverter (long typ, const CLID &clid, IConverter *cnv) |
virtual StatusCode | initializeConverter (long typ, const CLID &clid, IConverter *cnv) |
virtual StatusCode | activateConverter (long typ, const CLID &clid, IConverter *cnv) |
virtual void | loadConverter (DataObject *pObject) |
StatusCode | makeCall (int typ, bool ignore_add, bool ignore_obj, bool update, IOpaqueAddress *&pAddress, DataObject *&pObject) |
int | outputLevel () const |
Protected Attributes | |
IDataProviderSvc * | m_dataSvc |
IAddressCreator * | m_addressCreator |
long | m_type |
Workers * | m_workers |
IntegerProperty | m_outputLevel |
Gaudi::StateMachine::State | m_state |
Gaudi::StateMachine::State | m_targetState |
IMessageSvc * | m_messageSvc |
Private Attributes | |
MsgStream | m_log |
std::map< std::string, Leaf * > | m_leaves |
Friends | |
friend class | ServiceManager |
Definition at line 13 of file RawDataConSvc.h.
RawDataConSvc::RawDataConSvc | ( | const string & | name, | |
ISvcLocator * | svc | |||
) |
Definition at line 19 of file RawDataConSvc.cc.
00020 : ConversionSvc(name, svc, RAWDATA_StorageType) 00021 , m_log(msgSvc(), name) 00022 { 00023 m_log << MSG::DEBUG << "constructor" << endreq; 00024 }
virtual RawDataConSvc::~RawDataConSvc | ( | ) | [inline, virtual] |
StatusCode RawDataConSvc::initialize | ( | ) | [virtual] |
Reimplemented from ConversionSvc.
Definition at line 26 of file RawDataConSvc.cc.
00027 { 00028 m_log << MSG::DEBUG << "initialize()" << endreq; 00029 StatusCode iret; 00030 StatusCode status = ConversionSvc::initialize(); 00031 if (status.isSuccess()) { 00032 IDataProviderSvc *pIDP = 0; 00033 status = service("EventDataSvc", pIDP, true); 00034 if (status.isSuccess()) { 00035 status = setDataProvider(pIDP); 00036 } else return status; 00037 00038 status = addConverters(); 00039 if (!status.isSuccess()) { 00040 m_log << MSG::ERROR << "Unable to add converters to the service" << endreq; 00041 return status; 00042 } 00043 00044 // Now we have to configure the map of leaves 00045 // Which should contain the association of converters with 00046 // paths on the TDS 00047 for (map<string, Leaf*>::iterator k = m_leaves.begin(); k != m_leaves.end(); k++) { 00048 string path = (*k).first; 00049 m_log << MSG::DEBUG << path <<endreq; 00050 for (map<string, Leaf*>::iterator j = m_leaves.begin(); j != m_leaves.end(); j++) { 00051 string pp = (*j).first.substr(0, (*j).first.rfind("/")); 00052 m_log << MSG::DEBUG << pp <<endreq; 00053 if (path == pp && path != (*j).first)(*k).second->push_back((*j).second); 00054 } 00055 } 00056 } 00057 return status; 00058 }
StatusCode RawDataConSvc::finalize | ( | ) | [virtual] |
Reimplemented from ConversionSvc.
Definition at line 60 of file RawDataConSvc.cc.
00061 { 00062 m_log << MSG::DEBUG << "finalize()" << endreq; 00063 StatusCode status = ConversionSvc::finalize(); 00064 for (map<string, Leaf*>::iterator k = m_leaves.begin(); k != m_leaves.end(); k++) { 00065 delete(*k).second; 00066 } 00067 m_leaves.erase(m_leaves.begin(), m_leaves.end()); 00068 00069 if (status.isFailure()) { 00070 m_log << MSG::ERROR << "Unable to finalize service " << endreq; 00071 return status; 00072 } 00073 return StatusCode::SUCCESS; 00074 }
StatusCode RawDataConSvc::queryInterface | ( | const InterfaceID & | riid, | |
void ** | ppv | |||
) | [virtual] |
Reimplemented from ConversionSvc.
Definition at line 77 of file RawDataConSvc.cc.
00078 { 00079 m_log << MSG::DEBUG << "queryInterface()" << endreq; 00080 if (IID_IRawDataConSvc.versionMatch(riid)) { 00081 *ppvInterface = (IRawDataConSvc*)this; 00082 } else { 00083 // Interface is not directly availible: try out a base class 00084 return ConversionSvc::queryInterface(riid, ppvInterface); 00085 } 00086 addRef(); 00087 return StatusCode::SUCCESS; 00088 }
StatusCode RawDataConSvc::declareObject | ( | const IRawDataConSvc::Leaf & | leaf | ) | [virtual] |
Implements IRawDataConSvc.
Definition at line 90 of file RawDataConSvc.cc.
00091 { 00092 m_log << MSG::DEBUG << "declareObject() " << leaf.path << endreq; 00093 // Purpose and Method: Callback from each of the individual converters that allows 00094 // association of TDS path and converter. 00095 Leaf* ll = new Leaf(leaf); 00096 pair<map<string, Leaf*>::iterator, bool> p = m_leaves.insert(map<string, Leaf*>::value_type(leaf.path, ll)); 00097 if (p.second) return StatusCode::SUCCESS; 00098 else return StatusCode::FAILURE; 00099 delete ll; 00100 }
StatusCode RawDataConSvc::createAddress | ( | long | svc_type, | |
const CLID & | clid, | |||
const string * | par, | |||
const unsigned long * | ip, | |||
IOpaqueAddress *& | refpAddr | |||
) | [virtual] |
Definition at line 102 of file RawDataConSvc.cc.
00107 { 00108 m_log << MSG::DEBUG << "createAddress(storageType=" << storageType << ", CLID=" << clid << ", IOpaqueAddress*=" << refpAddr << ")" << endreq; 00109 if (storageType != repSvcType()) { 00110 m_log << MSG::ERROR << "bad storage type" << storageType << endreq; 00111 return StatusCode::FAILURE; 00112 } 00113 00114 refpAddr = new RawDataAddress(clid, "", ""); 00115 00116 return StatusCode::SUCCESS; 00117 }
StatusCode RawDataConSvc::createAddress | ( | long | svc_type, | |
const CLID & | clid, | |||
const string & | par, | |||
IOpaqueAddress *& | refpAddr | |||
) | [virtual] |
Definition at line 119 of file RawDataConSvc.cc.
00123 { 00124 return createAddress(storageType, clid, NULL, NULL, refpAddr); 00125 }
StatusCode RawDataConSvc::addConverters | ( | ) | [virtual] |
Definition at line 127 of file RawDataConSvc.cc.
00128 { 00129 m_log << MSG::DEBUG << "addConverters(): RawReadoutHeaderCnv" << endreq; 00130 declareObject(IRawDataConSvc::Leaf("/Event", RawDataObjectCnv::classID())); 00131 declareObject(IRawDataConSvc::Leaf("/Event/Readout", RawDataObjectCnv::classID())); 00132 declareObject(IRawDataConSvc::Leaf("/Event/Readout/ReadoutHeader", RawReadoutHeaderCnv::classID())); 00133 declareObject(IRawDataConSvc::Leaf("/Event/Raw", RawDataObjectCnv::classID())); 00134 declareObject(IRawDataConSvc::Leaf("/Event/Raw/RawEventHeader", RawEventHeaderCnv::classID())); 00135 return StatusCode::SUCCESS; 00136 }
StatusCode RawDataConSvc::updateServiceState | ( | IOpaqueAddress * | pAddress | ) | [virtual] |
Reimplemented from ConversionSvc.
Definition at line 139 of file RawDataConSvc.cc.
00140 { 00141 00142 m_log << MSG::DEBUG << "updateServiceState(" << pAddress << ")" << endreq; 00143 StatusCode status = INVALID_ADDRESS; 00144 IRegistry* ent = pAddress->registry(); 00145 if (0 != ent) { 00146 SmartIF<IDataManagerSvc> iaddrReg(IID_IDataManagerSvc, dataProvider()); 00147 status = StatusCode::SUCCESS; 00148 std::string path = ent->identifier(); 00149 m_log << MSG::DEBUG << "... for path: " << path << endreq; 00150 map<string, Leaf*>::iterator itm = m_leaves.find(path); 00151 if (itm != m_leaves.end()) { 00152 IRawDataConSvc::Leaf* leaf = (*itm).second; 00153 if (0 != leaf) { 00154 for (Leaf::iterator il = leaf->begin(); il != leaf->end(); il++) { 00155 IOpaqueAddress* newAddr = 0; 00156 unsigned long ipars[2] = {0, 0}; 00157 const std::string spars[2] = {"", ""}; 00158 StatusCode ir = createAddress(repSvcType(), 00159 (*il)->clid, 00160 spars, 00161 ipars, 00162 newAddr); 00163 if (ir.isSuccess()) { 00164 ir = iaddrReg->registerAddress((*il)->path, newAddr); 00165 if (!ir.isSuccess()) { 00166 newAddr->release(); 00167 status = ir; 00168 } 00169 } 00170 } 00171 } 00172 } 00173 } else { 00174 status = NO_INTERFACE; 00175 } 00176 return status; 00177 }
static const InterfaceID& IRawDataConSvc::interfaceID | ( | ) | [inline, static, inherited] |
Reimplemented from IInterface.
Definition at line 46 of file IRawDataConSvc.h.
00046 { 00047 return IID_IRawDataConSvc; 00048 }
MsgStream RawDataConSvc::m_log [mutable, private] |
Definition at line 41 of file RawDataConSvc.h.
std::map<std::string, Leaf*> RawDataConSvc::m_leaves [private] |
Definition at line 43 of file RawDataConSvc.h.