| The Gaudi Framework v29r1 (5cd95fa2)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Private Types | List of all members
Gaudi::Utils::GetOrCreateData< TYPE, TYPE2 > Struct Template Reference

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

`#include <GaudiAlg/GetData.h>`

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

## Public Types
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...

## Private Types
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 420 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 424 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 430 of file GetData.h.

template<class TYPE, class TYPE2>

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

Definition at line 428 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

  common | the actual "worker"
  service | pointer to Data Provider Service
  location | location of objects in TES

Returns
  the data

check the data

Definition at line 441 of file GetData.h.

443 {
444 SmartDataPtr<TYPE> obj( service, location );
445 if ( !obj ) {
446 TYPE2* o = new TYPE2();
447 common.put( service, o, location2 );
448 if ( common.msgLevel( MSG::DEBUG ) ) {
449 common.debug() << "The object of type '" << System::typeinfoName( typeid( *o ) )
450 << "' has been created from TS at address '" << location2 << "'" << endmsg;
451 }
452 return o;
453 }
454 auto ret = obj.ptr();
456 common.Assert( !( !ret ), "get():: No valid data at '" + location + "'" );
457 if ( common.msgLevel( MSG::DEBUG ) ) {
458 common.debug() << "The object of type '" << System::typeinfoName( typeid( *ret ) )
459 << "' has been retrieved from TS at address '" << location << "'" << endmsg;
460 }
461 // return *VALID* data
462 return ret;
463 // ====================================================================
464 }
System::typeinfoName
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:329
MSG::DEBUG
Definition: IMessageSvc.h:16
SmartDataPtr
A small class used to access easily (and efficiently) data items residing in data stores...
Definition: SmartDataPtr.h:47
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209

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

- GaudiAlg/GaudiAlg/GetData.h