Go to the documentation of this file.
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>
92 template <
class TYPE, std::enable_if_t<std::is_constructible_v<TYPE>,
void*> =
nullptr>
101 if (
auto tobj2 =
dynamic_cast<AnyDataWrapper<TYPE>*
>( obj ); tobj2 ) { tobj = &( tobj2->getData() ); }
114 template <
class TYPE>
131 template <
class COMMON>
133 const bool checkData =
true )
const {
142 << ( obj ?
"has been" :
"could not be" ) <<
" retrieved from TS at address '" <<
location
152 template <
class TYPE>
169 template <
class COMMON>
171 const bool checkData =
true )
const {
177 typedef typename TYPE::Selection Selection_;
178 const Selection_*
sel =
dynamic_cast<Selection_*
>( object );
182 <<
"' has been retrieved from TS at address '" <<
location <<
"'" <<
endmsg;
187 typedef typename TYPE::Container Container_;
188 const Container_* cnt =
dynamic_cast<Container_*
>( object );
192 <<
"' has been retrieved from TS at address '" <<
location <<
"'" <<
endmsg;
231 template <
class ITERATOR>
233 auto _begin =
reinterpret_cast<typename return_type::const_iterator*
>( &first );
234 auto _end =
reinterpret_cast<typename return_type::const_iterator*
>( &last );
241 template <
class TYPE>
258 template <
class COMMON>
260 const bool checkData =
true )
const {
298 template <
class TYPE>
302 template <
class TYPE>
306 template <
class TYPE>
317 template <
class TYPE>
329 return getFromTS<TYPE>( service,
location );
335 template <
class TYPE>
347 return object && (
dynamic_cast<typename TYPE::Selection*
>( object ) ||
348 dynamic_cast<typename TYPE::Container*
>(
object ) );
368 template <
class TYPE>
370 :
public CheckData<Gaudi::Range_<std::vector<const TYPE*>>> {};
373 template <
class TYPE>
377 template <
class TYPE>
381 template <
class TYPE>
392 template <
class TYPE,
class TYPE2>
413 template <
class COMMON>
415 std::string_view location2 )
const {
418 auto o = std::make_unique<TYPE2>();
420 common.put( service,
std::move( o ), location2 );
423 <<
"' has been created from TS at address '" << location2 <<
"'" <<
endmsg;
427 auto ret = obj.ptr();
432 <<
"' has been retrieved from TS at address '" <<
location <<
"'" <<
endmsg;
440 template <
class TYPE,
class TYPE2>
464 template <
class COMMON>
466 std::string_view location2 )
const {
469 common.put( service, std::make_unique<TYPE2>(), location2 );
472 <<
"' has been created from TS at address '" << location2 <<
"'" <<
endmsg;
475 return m_getter( common, service,
location );
486 template <
class TYPE,
class TYPE2>
510 template <
class COMMON>
512 std::string_view location2 )
const {
513 auto range = m_range( common, service,
location, location2 );
524 template <
class TYPE,
class TYPE2>
526 template <
class TYPE,
class TYPE2>
528 template <
class TYPE,
class TYPE2>
531 template <
class TYPE,
class TYPE2>
533 template <
class TYPE,
class TYPE2>
535 template <
class TYPE,
class TYPE2>
538 template <
class TYPE,
class TYPE2>
540 template <
class TYPE,
class TYPE2>
542 template <
class TYPE,
class TYPE2>
551 #endif // GAUDIUTILS_GETDATA_H
static AccessFunction access()
CheckData< Range > Checker
the actual data checker
return_type make_range(const typename TYPE::Container *cnt) const
Getter m_getter
the actual data getter
DataObject * getData(IDataProviderSvc *service, std::string location) const
get the data form transient store
return_type operator()(const COMMON &common, IDataProviderSvc *service, std::string location, std::string_view location2) const
the only one essential method
return_type operator()(const COMMON &common, IDataProviderSvc *service, std::string_view location, const bool checkData=true) const
the only one essential method
return_type make_range(const typename TYPE::Selection *cnt) const
Gaudi::NamedRange_< std::vector< const TYPE * > > Range
return_type operator()(const COMMON &common, IDataProviderSvc *service, std::string_view location, std::string_view location2) const
the only one essential method
return_type make_range(const typename TYPE::Selection *cnt) const
Getter::return_type return_type
the actual return type
_GetType< Type >::return_type return_type
Gaudi::Range_< std::vector< const TYPE * > > Range_
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
bool operator()(IDataProviderSvc *service, std::string location) const
the only one essential method
GetData< Range > Getter
the actual data getter
GetData< Gaudi::Range_< std::vector< const TYPE * > > > m_range
===================================================================== the actual processor
bool operator()(IDataProviderSvc *service, std::string_view location) const
the only one essential method
NamedRange_< CONTAINER > range(const CONTAINER &cnt, std::string name)
simple function to create the named range from arbitrary container
GetData< TYPE > Getter
the actual data getter
Gaudi::Range_< std::vector< const TYPE * > > Range
Gaudi::Range_< std::vector< const TYPE * > > Type
the actual return type
virtual StatusCode retrieveObject(IRegistry *pDirectory, std::string_view path, DataObject *&pObject)=0
Retrieve object identified by its directory entry.
Range make_range(const DataObject *obj)
Gaudi::Range_< CONTAINER > return_type
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
return_type make_range(ITERATOR first, ITERATOR last) const
GetOrCreateData< Range_, TYPE2 > Helper
Gaudi::NamedRange_< std::vector< const TYPE * > > Type
the actual return type
Header file for std:chrono::duration-based Counters.
return_type operator()(const COMMON &common, IDataProviderSvc *service, std::string_view location, const bool checkData=true) const
the only one essential method
Helper m_range
the actual data getter
Getter::return_type return_type
the actual return type
GetData< Range > Getter
the actual data getter
Gaudi::NamedRange_< CONTAINER > return_type
DataObject * getData(IDataProviderSvc *service, std::string location) const
get the data form transient store
A small class used to access easily (and efficiently) data items residing in data stores.
return_type operator()(const COMMON &common, IDataProviderSvc *service, std::string_view location, std::string_view location2) const
the only one essential method
_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
virtual const id_type & identifier() const =0
Full identifier (or key)
DataObject * getData(IDataProviderSvc *service, std::string location) const
get the data form transient store
return_type make_range(const typename TYPE::Container *cnt) const
_GetType< Type >::return_type return_type
Getter::return_type return_type
the actual return type
_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...
DataObject * accessData()
Static Object retrieval method: must call specific function.