#include <GiGaCnv/GiGaCnvBase.h>
Inheritance diagram for GiGaCnvBase:
Public Types | |
typedef std::vector< GiGaLeaf > | Leaves |
INVALID_ADDRESS | |
INVALID_OBJECT | |
NO_MEMORY | |
BAD_STORAGE_TYPE | |
NO_SOURCE_OBJECT | |
ICONVERSIONSVC_LAST_ERROR | |
SUCCESS | |
NO_INTERFACE | |
VERSMISMATCH | |
LAST_ERROR | |
enum | Status |
Public Member Functions | |
long | repSvcType () const |
virtual StatusCode | initialize () |
initialization | |
virtual StatusCode | finalize () |
finalization | |
virtual StatusCode | queryInterface (const InterfaceID &riid, void **ppvInterface) |
virtual unsigned long | addRef () |
virtual unsigned long | release () |
virtual StatusCode | setDataProvider (IDataProviderSvc *svc) |
virtual IDataProviderSvc * | dataProvider () const |
virtual StatusCode | setConversionSvc (IConversionSvc *svc) |
virtual IConversionSvc * | conversionSvc () const |
virtual StatusCode | setAddressCreator (IAddressCreator *creator) |
virtual IAddressCreator * | addressCreator () const |
virtual const CLID & | objType () const |
virtual long | i_repSvcType () 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) |
StatusCode | service (const std::string &name, T *&psvc, bool createIf=false) const |
StatusCode | service (const std::string &type, const std::string &name, T *&psvc) const |
Static Public Member Functions | |
static const InterfaceID & | interfaceID () |
Public Attributes | |
INVALID_ADDRESS | |
INVALID_OBJECT | |
NO_MEMORY | |
BAD_STORAGE_TYPE | |
NO_SOURCE_OBJECT | |
ICONVERSIONSVC_LAST_ERROR | |
Protected Member Functions | |
GiGaCnvBase (const long StorageType, const CLID &ClassType, ISvcLocator *Locator) | |
standard constructor | |
virtual | ~GiGaCnvBase () |
virtual destructor | |
ISvcLocator * | svcLoc () const |
acessor to teh service locator | |
IGiGaCnvSvc * | cnvSvc () const |
accessor to own conversion service | |
IGiGaGeomCnvSvc * | geoSvc () const |
accessor to geometry conversion service | |
IGiGaKineCnvSvc * | kineSvc () const |
accessor to kinematics conversion service | |
IGiGaHitsCnvSvc * | hitsSvc () const |
accessor to hits conversion service | |
IDataProviderSvc * | evtSvc () const |
accessor to event data service | |
IDataProviderSvc * | detSvc () const |
accessor to detector data service | |
IChronoStatSvc * | chronoSvc () const |
accessor to Chrono & Stat service | |
IToolSvc * | toolSvc () const |
accessor to Tool Service | |
IGiGaSvc * | gigaSvc () const |
accessor to GiGa service | |
IGiGaSetUpSvc * | setupSvc () const |
accessor to GiGa SetUp service | |
IParticlePropertySvc * | ppSvc () const |
accessor to Particle Properties service | |
template<class TYPE> | |
TYPE * | get (IDataProviderSvc *svc, const std::string &location, const TYPE *) const |
templated access to the data in Gaudi transient store | |
template<class TOOL> | |
TOOL * | tool (const std::string &type, const std::string &name, TOOL *&Tool, const IInterface *parent=0, bool create=true) const |
the useful method for location of tools. | |
template<class TOOL> | |
TOOL * | tool (const std::string &type, TOOL *&Tool, const IInterface *parent=0, bool create=true) const |
the useful method for location of tools. | |
StatusCode | Error (const std::string &Message, const StatusCode &status=StatusCode::FAILURE, const size_t mx=10) const |
print and return the error | |
StatusCode | Warning (const std::string &Message, const StatusCode &status=StatusCode::FAILURE, const size_t mx=10) const |
print and return warning | |
StatusCode | Print (const std::string &Message, const StatusCode &Status=StatusCode::SUCCESS, const MSG::Level &level=MSG::INFO) const |
print the message and return status code | |
StatusCode | Exception (const std::string &msg, const GaudiException &exc, const MSG::Level &lvl=MSG::FATAL, const StatusCode &sc=StatusCode::FAILURE) const |
(re)-throw exception and print error message | |
StatusCode | Exception (const std::string &msg, const std::exception &exc, const MSG::Level &lvl=MSG::FATAL, const StatusCode &sc=StatusCode::FAILURE) const |
(re)-throw exception and print error message | |
StatusCode | Exception (const std::string &msg, const MSG::Level &lvl=MSG::FATAL, const StatusCode &sc=StatusCode::FAILURE) const |
throw exception and print error message | |
StatusCode | Assert (bool assertion, const std::string &msg="GiGaCnvBase::unknown", const StatusCode &sc=StatusCode::FAILURE) const |
assertion | |
StatusCode | Assert (bool assertion, const char *msg, const StatusCode &sc=StatusCode::FAILURE) const |
assertion | |
const std::string & | name () const |
Retrieve name of converter. | |
void | setNameOfGiGaConversionService (const std::string &CnvSvc) |
set name of own conversion service | |
void | setConverterName (const std::string &ConverterName) |
set own name | |
StatusCode | declareObject (const GiGaLeaf &leaf) |
declare the object to conversion service | |
ISvcLocator * | serviceLocator () const |
IMessageSvc * | msgSvc () const |
IMessageSvc * | messageService () const |
IDataManagerSvc * | dataManager () const |
Protected Attributes | |
std::string | m_NameOfGiGaConversionService |
std::string | m_ConverterName |
Leaves | m_leaves |
Private Types | |
typedef std::map< std::string, unsigned int > | Counter |
Private Attributes | |
IGiGaCnvSvc * | m_GiGaCnvSvc |
IGiGaGeomCnvSvc * | m_GiGaGeomCnvSvc |
IGiGaKineCnvSvc * | m_GiGaKineCnvSvc |
IGiGaHitsCnvSvc * | m_GiGaHitsCnvSvc |
IDataProviderSvc * | m_evtSvc |
IDataProviderSvc * | m_detSvc |
IChronoStatSvc * | m_chronoSvc |
IToolSvc * | m_toolSvc |
CLID | m_local |
Counter | m_errors |
counter of errors | |
Counter | m_warnings |
counter of warning | |
Counter | m_exceptions |
counter of exceptions |
Definition at line 49 of file GiGaCnvBase.h.
typedef std::vector<GiGaLeaf> GiGaCnvBase::Leaves |
Definition at line 52 of file GiGaCnvBase.h.
typedef std::map<std::string,unsigned int> GiGaCnvBase::Counter [private] |
Definition at line 439 of file GiGaCnvBase.h.
GiGaCnvBase::GiGaCnvBase | ( | const long | StorageType, | |
const CLID & | ClassType, | |||
ISvcLocator * | Locator | |||
) | [protected] |
standard constructor
StorageType | type identifier of external storage | |
ClassType | class identifier | |
Locatopr | pointer to service locator |
virtual GiGaCnvBase::~GiGaCnvBase | ( | ) | [protected, virtual] |
virtual destructor
long GiGaCnvBase::repSvcType | ( | ) | const [inline, virtual] |
virtual StatusCode GiGaCnvBase::initialize | ( | ) | [virtual] |
virtual StatusCode GiGaCnvBase::finalize | ( | ) | [virtual] |
ISvcLocator* GiGaCnvBase::svcLoc | ( | ) | const [inline, protected] |
acessor to teh service locator
Definition at line 92 of file GiGaCnvBase.h.
00093 { return serviceLocator () ; }
IGiGaCnvSvc* GiGaCnvBase::cnvSvc | ( | ) | const [inline, protected] |
accessor to own conversion service
Definition at line 98 of file GiGaCnvBase.h.
00099 { return m_GiGaCnvSvc ; }
IGiGaGeomCnvSvc* GiGaCnvBase::geoSvc | ( | ) | const [inline, protected] |
accessor to geometry conversion service
Definition at line 104 of file GiGaCnvBase.h.
00105 { return m_GiGaGeomCnvSvc ; }
IGiGaKineCnvSvc* GiGaCnvBase::kineSvc | ( | ) | const [inline, protected] |
accessor to kinematics conversion service
Definition at line 110 of file GiGaCnvBase.h.
00111 { return m_GiGaKineCnvSvc ; }
IGiGaHitsCnvSvc* GiGaCnvBase::hitsSvc | ( | ) | const [inline, protected] |
accessor to hits conversion service
Definition at line 116 of file GiGaCnvBase.h.
00117 { return m_GiGaHitsCnvSvc ; }
IDataProviderSvc* GiGaCnvBase::evtSvc | ( | ) | const [inline, protected] |
accessor to event data service
Definition at line 122 of file GiGaCnvBase.h.
00123 { return m_evtSvc ; }
IDataProviderSvc* GiGaCnvBase::detSvc | ( | ) | const [inline, protected] |
accessor to detector data service
Definition at line 128 of file GiGaCnvBase.h.
00129 { return m_detSvc ; }
IChronoStatSvc* GiGaCnvBase::chronoSvc | ( | ) | const [inline, protected] |
accessor to Chrono & Stat service
Definition at line 135 of file GiGaCnvBase.h.
00136 { return m_chronoSvc ; }
IToolSvc* GiGaCnvBase::toolSvc | ( | ) | const [inline, protected] |
accessor to Tool Service
Definition at line 141 of file GiGaCnvBase.h.
00142 { return m_toolSvc ; }
IGiGaSvc* GiGaCnvBase::gigaSvc | ( | ) | const [inline, protected] |
accessor to GiGa service
Definition at line 147 of file GiGaCnvBase.h.
IGiGaSetUpSvc* GiGaCnvBase::setupSvc | ( | ) | const [inline, protected] |
accessor to GiGa SetUp service
Definition at line 153 of file GiGaCnvBase.h.
IParticlePropertySvc* GiGaCnvBase::ppSvc | ( | ) | const [inline, protected] |
accessor to Particle Properties service
Definition at line 159 of file GiGaCnvBase.h.
TYPE* GiGaCnvBase::get | ( | IDataProviderSvc * | svc, | |
const std::string & | location, | |||
const TYPE * | ||||
) | const [inline, protected] |
templated access to the data in Gaudi transient store
Quick and safe access to the data in Gaudi transient store. The method located the data at given address and perform the debug printout about located data
Usage:
GiGaException | for Invalid Data Provider Service | |
GiGaException | for invalid/unavailable data |
svc | pointer to data service (data provider) | |
location | data location/address in Gaudi Transient Store | |
type | artificial algument (to please MicroSoft compiler) |
Definition at line 193 of file GiGaCnvBase.h.
00196 { 00197 // check the environment 00198 Assert( 0 != svc , " get():: IDataProvider* points to NULL!" ); 00199 SmartDataPtr<TYPE> object( svc, location ) ; 00200 Assert( !(!object) , " get():: No valid data at '" + location + "'" ); 00201 TYPE* aux = object ; 00202 Assert( 0 != aux , " get():: No valid data at '" + location + "'" ); 00203 const std::string type( System::typeinfoName( typeid( *aux ) ) ); 00204 // debug printout 00205 // return located valid data 00206 Print( " The data from address '" + location + 00207 "' are retrieved from TS " , 00208 StatusCode::SUCCESS , MSG::DEBUG ) ; 00209 Print( " [ The actual data type is '" + type + 00210 "' ] " , 00211 StatusCode::SUCCESS , MSG::DEBUG ) ; 00212 return aux ; 00213 };
TOOL* GiGaCnvBase::tool | ( | const std::string & | type, | |
const std::string & | name, | |||
TOOL *& | Tool, | |||
const IInterface * | parent = 0 , |
|||
bool | create = true | |||
) | const [inline, protected] |
the useful method for location of tools.
for empty "name" delegates to another method
GiGaException | for invalid Tool Service | |
GiGaException | for error from Tool Service | |
GiGaException | for invalid tool |
type | tool type | |
name | tool name | |
Tool | tool itself (return) | |
parent | tool parent | |
create | flag for creation of nonexisting tools |
Definition at line 233 of file GiGaCnvBase.h.
00238 { 00239 // for empty names delegate to another method 00240 if( name.empty() ) { return tool( type , Tool , parent , create ) ; } 00241 Assert( 0 != toolSvc() , "IToolSvc* points toNULL!" ); 00242 // get the tool from Tool Service 00243 StatusCode sc = toolSvc () 00244 -> retrieveTool ( type , name , Tool, parent , create ); 00245 Assert( sc.isSuccess() , 00246 "Could not retrieve Tool'" + type + "'/'" + name + "'", sc ) ; 00247 Assert( 0 != Tool , 00248 "Could not retrieve Tool'" + type + "'/'" + name + "'" ) ; 00249 // debug printout 00250 Print( " The Tool of type '" + Tool->type() + 00251 "'/'" + Tool->name() + 00252 "' is retrieved from IToolSvc " , MSG::DEBUG , sc ) ; 00253 // return located tool 00254 return Tool ; 00255 };
TOOL* GiGaCnvBase::tool | ( | const std::string & | type, | |
TOOL *& | Tool, | |||
const IInterface * | parent = 0 , |
|||
bool | create = true | |||
) | const [inline, protected] |
the useful method for location of tools.
GiGaException | for invalid Tool Service | |
GiGaException | for error from Tool Service | |
GiGaException | for invalid tool |
type | tool type, could be of "Type/Name" format | |
Tool | tool itself (return) | |
parent | tool parent | |
create | flag for creation of nonexisting tools |
Definition at line 273 of file GiGaCnvBase.h.
00277 { 00278 // check the environment 00279 Assert( 0 != toolSvc() , "IToolSvc* points toNULL!" ); 00280 // "type" or "type/name" ? 00281 std::string::const_iterator it = 00282 std::find( type.begin() , type.end () , '/' ); 00283 // "type" is compound! 00284 if( type.end() != it ) 00285 { 00286 std::string::size_type pos = it - type.begin() ; 00287 const std::string ntype( type , 0 , pos ); 00288 const std::string nname( type , pos + 1 , std::string::npos ); 00289 return tool( ntype , // new type 00290 nname , // new name 00291 Tool , parent , create ) ; 00292 } 00293 // retrieve the tool from Tool Service 00294 StatusCode sc = toolSvc () 00295 -> retrieveTool ( type , Tool, parent , create ); 00296 Assert( sc.isSuccess() , "Could not retrieve Tool'" + type + "'" , sc ) ; 00297 Assert( 0 != Tool , "Could not retrieve Tool'" + type + "'" ) ; 00298 // debug printout 00299 Print( " The Tool of type '" + Tool->type() + 00300 "'/'" + Tool->name() + 00301 "' is retrieved from IToolSvc " , MSG::DEBUG , sc ) ; 00302 // return located tool 00303 return Tool ; 00304 };
StatusCode GiGaCnvBase::Error | ( | const std::string & | Message, | |
const StatusCode & | status = StatusCode::FAILURE , |
|||
const size_t | mx = 10 | |||
) | const [protected] |
print and return the error
Message | message to be printed | |
status | status code to be returned |
StatusCode GiGaCnvBase::Warning | ( | const std::string & | Message, | |
const StatusCode & | status = StatusCode::FAILURE , |
|||
const size_t | mx = 10 | |||
) | const [protected] |
print and return warning
Message | message to be printed | |
status | status code to be returned |
StatusCode GiGaCnvBase::Print | ( | const std::string & | Message, | |
const StatusCode & | Status = StatusCode::SUCCESS , |
|||
const MSG::Level & | level = MSG::INFO | |||
) | const [protected] |
print the message and return status code
msg | error message | |
lvl | print level | |
sc | status code |
StatusCode GiGaCnvBase::Exception | ( | const std::string & | msg, | |
const GaudiException & | exc, | |||
const MSG::Level & | lvl = MSG::FATAL , |
|||
const StatusCode & | sc = StatusCode::FAILURE | |||
) | const [protected] |
(re)-throw exception and print error message
msg | error message | |
exc | previous exception | |
lvl | print level | |
sc | status code |
StatusCode GiGaCnvBase::Exception | ( | const std::string & | msg, | |
const std::exception & | exc, | |||
const MSG::Level & | lvl = MSG::FATAL , |
|||
const StatusCode & | sc = StatusCode::FAILURE | |||
) | const [protected] |
(re)-throw exception and print error message
msg | error message | |
exc | previous exception | |
lvl | print level | |
sc | status code |
StatusCode GiGaCnvBase::Exception | ( | const std::string & | msg, | |
const MSG::Level & | lvl = MSG::FATAL , |
|||
const StatusCode & | sc = StatusCode::FAILURE | |||
) | const [protected] |
throw exception and print error message
msg | error message | |
lvl | print level | |
sc | status code |
StatusCode GiGaCnvBase::Assert | ( | bool | assertion, | |
const std::string & | msg = "GiGaCnvBase::unknown" , |
|||
const StatusCode & | sc = StatusCode::FAILURE | |||
) | const [inline, protected] |
assertion
assertion | assertion condition | |
msg | assertion message | |
sc | assertion status code |
Definition at line 458 of file GiGaCnvBase.h.
00461 { 00462 StatusCode status = StatusCode::SUCCESS ; 00463 return (assertion) ? status : Exception( msg , MSG::FATAL , sc ) ; 00464 };
StatusCode GiGaCnvBase::Assert | ( | bool | assertion, | |
const char * | msg, | |||
const StatusCode & | sc = StatusCode::FAILURE | |||
) | const [inline, protected] |
assertion
assertion | assertion condition | |
msg | assertion message | |
sc | assertion status code |
Definition at line 475 of file GiGaCnvBase.h.
00478 { 00479 StatusCode status = StatusCode::SUCCESS ; 00480 return (assertion) ? status : Exception( msg , MSG::FATAL , sc ) ; 00481 };
const std::string& GiGaCnvBase::name | ( | ) | const [inline, protected] |
Retrieve name of converter.
Definition at line 400 of file GiGaCnvBase.h.
00400 { return m_ConverterName; }
void GiGaCnvBase::setNameOfGiGaConversionService | ( | const std::string & | CnvSvc | ) | [inline, protected] |
set name of own conversion service
Definition at line 404 of file GiGaCnvBase.h.
00405 { m_NameOfGiGaConversionService = CnvSvc ; }
void GiGaCnvBase::setConverterName | ( | const std::string & | ConverterName | ) | [inline, protected] |
set own name
Definition at line 409 of file GiGaCnvBase.h.
00410 { m_ConverterName = ConverterName ; }
StatusCode GiGaCnvBase::declareObject | ( | const GiGaLeaf & | leaf | ) | [protected] |
declare the object to conversion service
leaf | object leaf |
std::string GiGaCnvBase::m_NameOfGiGaConversionService [protected] |
Definition at line 420 of file GiGaCnvBase.h.
std::string GiGaCnvBase::m_ConverterName [protected] |
Definition at line 421 of file GiGaCnvBase.h.
Leaves GiGaCnvBase::m_leaves [protected] |
Definition at line 423 of file GiGaCnvBase.h.
IGiGaCnvSvc* GiGaCnvBase::m_GiGaCnvSvc [private] |
Definition at line 427 of file GiGaCnvBase.h.
IGiGaGeomCnvSvc* GiGaCnvBase::m_GiGaGeomCnvSvc [private] |
Definition at line 428 of file GiGaCnvBase.h.
IGiGaKineCnvSvc* GiGaCnvBase::m_GiGaKineCnvSvc [private] |
Definition at line 429 of file GiGaCnvBase.h.
IGiGaHitsCnvSvc* GiGaCnvBase::m_GiGaHitsCnvSvc [private] |
Definition at line 430 of file GiGaCnvBase.h.
IDataProviderSvc* GiGaCnvBase::m_evtSvc [private] |
Definition at line 432 of file GiGaCnvBase.h.
IDataProviderSvc* GiGaCnvBase::m_detSvc [private] |
Definition at line 433 of file GiGaCnvBase.h.
IChronoStatSvc* GiGaCnvBase::m_chronoSvc [private] |
Definition at line 434 of file GiGaCnvBase.h.
IToolSvc* GiGaCnvBase::m_toolSvc [private] |
Definition at line 435 of file GiGaCnvBase.h.
CLID GiGaCnvBase::m_local [private] |
Definition at line 437 of file GiGaCnvBase.h.
Counter GiGaCnvBase::m_errors [mutable, private] |
Counter GiGaCnvBase::m_warnings [mutable, private] |
Counter GiGaCnvBase::m_exceptions [mutable, private] |