Gaudi::Utils::GetOrCreateData< TYPE, TYPE2 > Struct Template Reference

Helper structure for implementation of "getOrCreate"-functions for GaudiCommon<BASE> More...

#include </scratch/z5/marcocle/GaudiDocs/lhcb-release/996/GAUDI/GAUDI_v26r4/InstallArea/x86_64-slc6-gcc48-opt/include/GaudiAlg/GetData.h>

Inheritance diagram for Gaudi::Utils::GetOrCreateData< TYPE, TYPE2 >:

Public Types

typedef Getter::Type Type
 
typedef Getter::return_type return_type
 the actual return type More...
 
typedef Getter::Type Type
 
typedef Getter::return_type return_type
 the actual return type More...
 

Public Member Functions

template<class COMMON >
return_type operator() (const COMMON &common, IDataProviderSvc *service, const std::string &location, const std::string &location2) const
 the only one essential method More...
 
template<class COMMON >
return_type operator() (const COMMON &common, IDataProviderSvc *service, const std::string &location, const std::string &location2) const
 the only one essential method More...
 

Private Types

typedef GetData< TYPE > Getter
 the actual data getter More...
 
typedef GetData< TYPE > Getter
 the actual data getter More...
 

Detailed Description

template<class TYPE, class TYPE2>
struct Gaudi::Utils::GetOrCreateData< TYPE, TYPE2 >

Helper structure for implementation of "getOrCreate"-functions for GaudiCommon<BASE>

Author
Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@n.nosp@m.ikhe.nosp@m.f.nl
Date
2008-07-22

Definition at line 402 of file GetData.h.

Member Typedef Documentation

template<class TYPE, class TYPE2>
typedef GetData<TYPE> Gaudi::Utils::GetOrCreateData< TYPE, TYPE2 >::Getter
private

the actual data getter

Definition at line 407 of file GetData.h.

template<class TYPE, class TYPE2>
typedef GetData<TYPE> Gaudi::Utils::GetOrCreateData< TYPE, TYPE2 >::Getter
private

the actual data getter

Definition at line 407 of file GetData.h.

template<class TYPE, class TYPE2>
typedef Getter::return_type Gaudi::Utils::GetOrCreateData< TYPE, TYPE2 >::return_type

the actual return type

Definition at line 413 of file GetData.h.

template<class TYPE, class TYPE2>
typedef Getter::return_type Gaudi::Utils::GetOrCreateData< TYPE, TYPE2 >::return_type

the actual return type

Definition at line 413 of file GetData.h.

template<class TYPE, class TYPE2>
typedef Getter::Type Gaudi::Utils::GetOrCreateData< TYPE, TYPE2 >::Type

Definition at line 411 of file GetData.h.

template<class TYPE, class TYPE2>
typedef Getter::Type Gaudi::Utils::GetOrCreateData< TYPE, TYPE2 >::Type

Definition at line 411 of file GetData.h.

Member Function Documentation

template<class TYPE, class TYPE2>
template<class COMMON >
return_type Gaudi::Utils::GetOrCreateData< TYPE, TYPE2 >::operator() ( const COMMON &  common,
IDataProviderSvc service,
const std::string &  location,
const std::string &  location2 
) const
inline

the only one essential method

Parameters
commonthe actual "worker"
servicepointer to Data Provider Service
locationlocation of objects in TES
Returns
the data

check the data

Definition at line 425 of file GetData.h.

429  {
430  SmartDataPtr<TYPE> obj ( service , location ) ;
431  if ( !obj )
432  {
433  TYPE2* o = new TYPE2() ;
434  common.put ( service , o , location2 ) ;
435  if ( common.msgLevel ( MSG::DEBUG ) )
436  { common.debug() << "The object of type '"
437  << System::typeinfoName(typeid(*o))
438  << "' has been created from TS at address '"
439  << location2 << "'" << endmsg ; }
440  return o ;
441  }
442  return_type ret = obj ;
444  common.Assert ( !(!ret) , "get():: No valid data at '" + location + "'" ) ;
445  if ( common.msgLevel ( MSG::DEBUG ) )
446  { common.debug() << "The object of type '"
447  << System::typeinfoName(typeid(*ret))
448  << "' has been retrieved from TS at address '"
449  << location << "'" << endmsg ; }
450  // return *VALID* data
451  return ret ;
452  // ====================================================================
453  }
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:299
Getter::return_type return_type
the actual return type
Definition: GetData.h:413
A small class used to access easily (and efficiently) data items residing in data stores...
Definition: SmartDataPtr.h:46
template<class TYPE, class TYPE2>
template<class COMMON >
return_type Gaudi::Utils::GetOrCreateData< TYPE, TYPE2 >::operator() ( const COMMON &  common,
IDataProviderSvc service,
const std::string &  location,
const std::string &  location2 
) const
inline

the only one essential method

Parameters
commonthe actual "worker"
servicepointer to Data Provider Service
locationlocation of objects in TES
Returns
the data

check the data

Definition at line 425 of file GetData.h.

429  {
430  SmartDataPtr<TYPE> obj ( service , location ) ;
431  if ( !obj )
432  {
433  TYPE2* o = new TYPE2() ;
434  common.put ( service , o , location2 ) ;
435  if ( common.msgLevel ( MSG::DEBUG ) )
436  { common.debug() << "The object of type '"
437  << System::typeinfoName(typeid(*o))
438  << "' has been created from TS at address '"
439  << location2 << "'" << endmsg ; }
440  return o ;
441  }
442  return_type ret = obj ;
444  common.Assert ( !(!ret) , "get():: No valid data at '" + location + "'" ) ;
445  if ( common.msgLevel ( MSG::DEBUG ) )
446  { common.debug() << "The object of type '"
447  << System::typeinfoName(typeid(*ret))
448  << "' has been retrieved from TS at address '"
449  << location << "'" << endmsg ; }
450  // return *VALID* data
451  return ret ;
452  // ====================================================================
453  }
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:299
Getter::return_type return_type
the actual return type
Definition: GetData.h:413
A small class used to access easily (and efficiently) data items residing in data stores...
Definition: SmartDataPtr.h:46

The documentation for this struct was generated from the following file: