Gaudi Framework, version v25r1

Home   Generated: Mon Mar 24 2014
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 <GetData.h>

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

Public Types

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

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
 

Private Types

typedef GetData< TYPE > Getter
 the actual data getter
 

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 404 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 409 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 415 of file GetData.h.

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

Definition at line 413 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 427 of file GetData.h.

{
SmartDataPtr<TYPE> obj ( service , location ) ;
if ( !obj )
{
TYPE2* o = new TYPE2() ;
common.put ( service , o , location2 ) ;
if ( common.msgLevel ( MSG::DEBUG ) )
{ common.debug() << "The object of type '"
<< System::typeinfoName(typeid(*o))
<< "' has been created from TS at address '"
<< location2 << "'" << endmsg ; }
return_type _o = o ;
return _o ;
}
return_type ret = obj ;
common.Assert ( !(!ret) , "get():: No valid data at '" + location + "'" ) ;
if ( common.msgLevel ( MSG::DEBUG ) )
{ common.debug() << "The object of type '"
<< System::typeinfoName(typeid(*ret))
<< "' has been retrieved from TS at address '"
<< location << "'" << endmsg ; }
// return *VALID* data
return ret ;
// ====================================================================
}

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

Generated at Mon Mar 24 2014 18:27:52 for Gaudi Framework, version v25r1 by Doxygen version 1.8.2 written by Dimitri van Heesch, © 1997-2004