11 #ifndef GAUDIUTILS_GETDATA_H 12 #define GAUDIUTILS_GETDATA_H 1 63 template <
class CONTAINER>
69 template <
class CONTAINER>
78 template <
class TYPE, std::enable_if_t<!std::is_constructible_v<TYPE>,
void*> =
nullptr>
96 template <
class TYPE, std::enable_if_t<std::is_constructible_v<TYPE>,
void*> =
nullptr>
106 if ( tobj2 ) { tobj = &( tobj2->
getData() ); }
122 template <
class TYPE>
139 template <
class COMMON>
141 const bool checkData =
true )
const {
150 << ( obj ?
"has been" :
"could not be" ) <<
" retrieved from TS at address '" <<
location 160 template <
class TYPE>
177 template <
class COMMON>
179 const bool checkData =
true )
const {
185 typedef typename TYPE::Selection Selection_;
186 const Selection_*
sel = dynamic_cast<Selection_*>(
object );
190 <<
"' has been retrieved from TS at address '" <<
location <<
"'" <<
endmsg;
195 typedef typename TYPE::Container Container_;
196 const Container_* cnt = dynamic_cast<Container_*>(
object );
200 <<
"' has been retrieved from TS at address '" <<
location <<
"'" <<
endmsg;
239 template <
class ITERATOR>
241 auto _begin = reinterpret_cast<typename return_type::const_iterator*>( &first );
242 auto _end = reinterpret_cast<typename return_type::const_iterator*>( &last );
249 template <
class TYPE>
266 template <
class COMMON>
268 const bool checkData =
true )
const {
306 template <
class TYPE>
310 template <
class TYPE>
314 template <
class TYPE>
325 template <
class TYPE>
337 return getFromTS<TYPE>( service,
location );
343 template <
class TYPE>
355 return object && ( dynamic_cast<typename TYPE::Selection*>(
object ) ||
356 dynamic_cast<typename TYPE::Container*>(
object ) );
376 template <
class TYPE>
378 :
public CheckData<Gaudi::Range_<std::vector<const TYPE*>>> {};
381 template <
class TYPE>
385 template <
class TYPE>
389 template <
class TYPE>
400 template <
class TYPE,
class TYPE2>
421 template <
class COMMON>
423 std::string_view location2 )
const {
426 auto o = std::make_unique<TYPE2>();
428 common.put( service,
std::move( o ), location2 );
431 <<
"' has been created from TS at address '" << location2 <<
"'" <<
endmsg;
435 auto ret = obj.ptr();
440 <<
"' has been retrieved from TS at address '" <<
location <<
"'" <<
endmsg;
448 template <
class TYPE,
class TYPE2>
472 template <
class COMMON>
474 std::string_view location2 )
const {
477 common.put( service, std::make_unique<TYPE2>(), location2 );
480 <<
"' has been created from TS at address '" << location2 <<
"'" <<
endmsg;
483 return m_getter( common, service,
location );
494 template <
class TYPE,
class TYPE2>
518 template <
class COMMON>
520 std::string_view location2 )
const {
521 auto range = m_range( common, service,
location, location2 );
532 template <
class TYPE,
class TYPE2>
534 template <
class TYPE,
class TYPE2>
536 template <
class TYPE,
class TYPE2>
539 template <
class TYPE,
class TYPE2>
541 template <
class TYPE,
class TYPE2>
543 template <
class TYPE,
class TYPE2>
546 template <
class TYPE,
class TYPE2>
548 template <
class TYPE,
class TYPE2>
550 template <
class TYPE,
class TYPE2>
559 #endif // GAUDIUTILS_GETDATA_H 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.
DataObject * getData(IDataProviderSvc *service, std::string location) const
get the data form transient store
_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
const T & getData() const
Getter::return_type return_type
the actual return type
return_type operator()(const COMMON &common, IDataProviderSvc *service, std::string location, std::string_view location2) const
the only one essential method
bool operator()(IDataProviderSvc *service, std::string location) const
the only one essential method
Helper m_range
the actual data getter
_GetType< TYPE >::return_type getFromTS(IDataProviderSvc *service, std::string_view location)
Helper function to provide the minimal lookup and cast functionality of SmartDataPtr used in the help...
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>
NamedRange_< CONTAINER > range(const CONTAINER &cnt, std::string name)
simple function to create the named range from arbitrary container
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"
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
return_type operator()(const COMMON &common, IDataProviderSvc *service, std::string_view location, const bool checkData=true) const
the only one essential method
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, std::string_view location, const bool checkData=true) const
the only one essential method
return_type operator()(const COMMON &common, IDataProviderSvc *service, std::string_view location, std::string_view 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 return_type
bool operator()(IDataProviderSvc *service, std::string_view location) const
the only one essential method
CheckData< Range > Checker
the actual data checker
GetData< Gaudi::Range_< std::vector< const TYPE * > > > m_range
===================================================================== the actual processor
return_type operator()(const COMMON &common, IDataProviderSvc *service, std::string_view location, std::string_view 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.
DataObject * getData(IDataProviderSvc *service, std::string location) const
get the data form transient store
return_type operator()(const COMMON &common, IDataProviderSvc *service, std::string_view location, const bool checkData=true) const
the only one essential method
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
DataObject * getData(IDataProviderSvc *service, std::string location) const
get the data form transient store
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 make_range(const typename TYPE::Selection *cnt) const
GetData< TYPE > Getter
the actual data getter