1 #ifndef GAUDIUTILS_GETDATA_H 2 #define GAUDIUTILS_GETDATA_H 1 53 template <
class CONTAINER>
59 template <
class CONTAINER>
68 template <
class TYPE, std::enable_if_t<!std::is_constructible_v<TYPE>,
void*> =
nullptr>
86 template <
class TYPE, std::enable_if_t<std::is_constructible_v<TYPE>,
void*> =
nullptr>
96 if ( tobj2 ) { tobj = &( tobj2->
getData() ); }
112 template <
class TYPE>
129 template <
class COMMON>
131 const bool checkData =
true )
const {
135 common.Assert( obj,
"get():: No valid data at '" +
location +
"'" );
140 << ( obj ?
"has been" :
"could not be" ) <<
" retrieved from TS at address '" <<
location 150 template <
class TYPE>
167 template <
class COMMON>
169 const bool checkData =
true )
const {
175 typedef typename TYPE::Selection Selection_;
176 const Selection_*
sel = dynamic_cast<Selection_*>(
object );
180 <<
"' has been retrieved from TS at address '" <<
location <<
"'" <<
endmsg;
185 typedef typename TYPE::Container Container_;
186 const Container_* cnt = dynamic_cast<Container_*>(
object );
190 <<
"' has been retrieved from TS at address '" <<
location <<
"'" <<
endmsg;
195 if ( checkData ) common.Assert(
false,
"get():: No valid data at '" +
location +
"'" );
198 if ( checkData ) common.Assert(
false,
"get():: No data at '" +
location +
"'" );
227 template <
class ITERATOR>
229 auto _begin = reinterpret_cast<typename return_type::const_iterator*>( &first );
230 auto _end = reinterpret_cast<typename return_type::const_iterator*>( &last );
237 template <
class TYPE>
254 template <
class COMMON>
256 const bool checkData =
true )
const {
283 return m_range.getData( service,
location );
294 template <
class TYPE>
298 template <
class TYPE>
302 template <
class TYPE>
313 template <
class TYPE>
325 return getFromTS<TYPE>( service,
location );
331 template <
class TYPE>
343 if ( !
object ) {
return false; }
344 return dynamic_cast<typename TYPE::Selection*>(
object ) || dynamic_cast<typename TYPE::Container*>(
object );
363 template <
class TYPE>
365 :
public CheckData<Gaudi::Range_<std::vector<const TYPE*>>> {};
368 template <
class TYPE>
372 template <
class TYPE>
376 template <
class TYPE>
387 template <
class TYPE,
class TYPE2>
408 template <
class COMMON>
413 auto o = std::make_unique<TYPE2>();
415 common.put( service,
std::move( o ), location2 );
418 <<
"' has been created from TS at address '" << location2 <<
"'" <<
endmsg;
422 auto ret = obj.
ptr();
424 common.Assert( !( !ret ),
"get():: No valid data at '" +
location +
"'" );
427 <<
"' has been retrieved from TS at address '" <<
location <<
"'" <<
endmsg;
435 template <
class TYPE,
class TYPE2>
459 template <
class COMMON>
464 common.put( service, std::make_unique<TYPE2>(), location2 );
467 <<
"' has been created from TS at address '" << location2 <<
"'" <<
endmsg;
470 return m_getter( common, service,
location );
481 template <
class TYPE,
class TYPE2>
505 template <
class COMMON>
518 template <
class TYPE,
class TYPE2>
520 template <
class TYPE,
class TYPE2>
522 template <
class TYPE,
class TYPE2>
525 template <
class TYPE,
class TYPE2>
527 template <
class TYPE,
class TYPE2>
529 template <
class TYPE,
class TYPE2>
532 template <
class TYPE,
class TYPE2>
534 template <
class TYPE,
class TYPE2>
536 template <
class TYPE,
class TYPE2>
545 #endif // GAUDIUTILS_GETDATA_H DataObject * getData(IDataProviderSvc *service, const std::string &location) const
get the data form transient store
return_type operator()(const COMMON &common, IDataProviderSvc *service, const std::string &location, const bool checkData=true) const
the only one essential method
Gaudi::NamedRange_< CONTAINER > return_type
Helper structure to define the proper return type for "get"-functions.
Gaudi::NamedRange_< std::vector< const TYPE * > > Range
Getter m_getter
the actual data getter
GetData< Range > Getter
the actual data getter
Gaudi::NamedRange_< std::vector< const TYPE * > > Type
the actual return type
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
return_type operator()(const COMMON &common, IDataProviderSvc *service, const std::string &location, const bool checkData=true) const
the only one essential method
_GetType< Type >::return_type return_type
GetData< Range > Getter
the actual data getter
Helper structure for implementation of "get"-functions for GaudiCommon<BASE>
Data provider interface definition.
GetOrCreateData< Range_, TYPE2 > Helper
DataObject * getData(IDataProviderSvc *service, const std::string &location) const
get the data form transient store
const T & getData() const
Getter::return_type return_type
the actual return type
TYPE * ptr()
Automatic conversion to data type.
Helper m_range
the actual data getter
return_type make_range(ITERATOR first, ITERATOR last) const
Range make_range(const DataObject *obj)
Helper structure for implementation of "exists"-functions for GaudiCommon<BASE>
return_type operator()(const COMMON &common, IDataProviderSvc *service, const std::string &location, const bool checkData=true) const
the only one essential method
DataObject * getData(IDataProviderSvc *service, const std::string &location) const
get the data form transient store
This class is used for returning status codes from appropriate routines.
This file has been imported from LoKi project "C++ ToolKit for Smart and Friendly Physics Analysis"
bool operator()(IDataProviderSvc *service, const std::string &location) const
the only one essential method
DataObject * accessData()
Static Object retrieval method: must call specific function.
Helper structure for implementation of "getOrCreate"-functions for GaudiCommon<BASE>
return_type make_range(const typename TYPE::Selection *cnt) const
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Getter::return_type return_type
the actual return type
This file has been imported from LoKi project "C++ ToolKit for Smart and Friendly Physics Analysis"
_GetType< Type >::return_type return_type
the actual return type
return_type operator()(const COMMON &common, IDataProviderSvc *service, const std::string &location, const std::string &location2) const
the only one essential method
Getter::return_type return_type
the actual return type
A small class used to access easily (and efficiently) data items residing in data stores.
virtual StatusCode retrieveObject(IRegistry *pDirectory, std::string_view path, DataObject *&pObject)=0
Retrieve object identified by its directory entry.
_GetType< TYPE >::return_type getFromTS(IDataProviderSvc *service, const std::string &location)
Helper function to provide the minimal lookup and cast functionality of SmartDataPtr used in the help...
_GetType< Type >::return_type return_type
CheckData< Range > Checker
the actual data checker
GetData< Gaudi::Range_< std::vector< const TYPE * > > > m_range
===================================================================== the actual processor
bool operator()(IDataProviderSvc *service, const std::string &location) const
the only one essential method
return_type operator()(const COMMON &common, IDataProviderSvc *service, const std::string &location, const std::string &location2) const
the only one essential method
static AccessFunction access()
Gaudi::Range_< std::vector< const TYPE * > > Type
the actual return type
return_type make_range(const typename TYPE::Container *cnt) const
Useful class for representation of "sequence" of the objects through the range of valid iterators.
A small class used to access easily (and efficiently) data items residing in data stores.
Implements the common functionality between GaudiTools and GaudiAlgorithms.
Gaudi::Range_< std::vector< const TYPE * > > Range
virtual const id_type & identifier() const =0
Full identifier (or key)
return_type make_range(const typename TYPE::Container *cnt) const
Gaudi::Range_< std::vector< const TYPE * > > Range_
A DataObject is the base class of any identifiable object on any data store.
Gaudi::Range_< CONTAINER > return_type
Header file for std:chrono::duration-based Counters.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
return_type operator()(const COMMON &common, IDataProviderSvc *service, const std::string &location, const std::string &location2) const
the only one essential method
return_type make_range(const typename TYPE::Selection *cnt) const
GetData< TYPE > Getter
the actual data getter