The Gaudi Framework  v36r6 (b1ee9983)
Gaudi::Utils::GetData< Gaudi::Range_< std::vector< const TYPE * > > > Struct Template Reference

the template specialization for ranges More...

#include </builds/gaudi/Gaudi/GaudiAlg/include/GaudiAlg/GetData.h>

Public Types

typedef Gaudi::Range_< std::vector< const TYPE * > > Type
 the actual return type More...
 
typedef _GetType< Type >::return_type return_type
 

Public Member Functions

template<class COMMON >
return_type operator() (const COMMON &common, IDataProviderSvc *service, std::string_view location, const bool checkData=true) const
 the only one essential method More...
 
return_type make_range (const typename TYPE::Container *cnt) const
 
return_type make_range (const typename TYPE::Selection *cnt) const
 
DataObject * getData (IDataProviderSvc *service, std::string location) const
 get the data form transient store More...
 

Private Member Functions

template<class ITERATOR >
return_type make_range (ITERATOR first, ITERATOR last) const
 

Detailed Description

template<class TYPE>
struct Gaudi::Utils::GetData< Gaudi::Range_< std::vector< const TYPE * > > >

the template specialization for ranges

Definition at line 153 of file GetData.h.

Member Typedef Documentation

◆ return_type

template<class TYPE >
typedef _GetType<Type>::return_type Gaudi::Utils::GetData< Gaudi::Range_< std::vector< const TYPE * > > >::return_type

Definition at line 158 of file GetData.h.

◆ Type

template<class TYPE >
typedef Gaudi::Range_<std::vector<const TYPE*> > Gaudi::Utils::GetData< Gaudi::Range_< std::vector< const TYPE * > > >::Type

the actual return type

Definition at line 157 of file GetData.h.

Member Function Documentation

◆ getData()

template<class TYPE >
DataObject* Gaudi::Utils::GetData< Gaudi::Range_< std::vector< const TYPE * > > >::getData ( IDataProviderSvc *  service,
std::string  location 
) const
inline

get the data form transient store

Parameters
servicepointer to data provider service
locationthe location
Returns
the object for TES

Try to be efficient

Definition at line 222 of file GetData.h.

222  {
225  std::move( location ) );
226  return getter.accessData();
227  }

◆ make_range() [1/3]

template<class TYPE >
return_type Gaudi::Utils::GetData< Gaudi::Range_< std::vector< const TYPE * > > >::make_range ( const typename TYPE::Container *  cnt) const
inline

Definition at line 209 of file GetData.h.

209  {
210  return 0 == cnt ? return_type() : make_range( cnt->begin(), cnt->end() );
211  }

◆ make_range() [2/3]

template<class TYPE >
return_type Gaudi::Utils::GetData< Gaudi::Range_< std::vector< const TYPE * > > >::make_range ( const typename TYPE::Selection *  cnt) const
inline

Definition at line 213 of file GetData.h.

213  {
214  return 0 == cnt ? return_type() : return_type( cnt->begin(), cnt->end() );
215  }

◆ make_range() [3/3]

template<class TYPE >
template<class ITERATOR >
return_type Gaudi::Utils::GetData< Gaudi::Range_< std::vector< const TYPE * > > >::make_range ( ITERATOR  first,
ITERATOR  last 
) const
inlineprivate

Definition at line 232 of file GetData.h.

232  {
233  auto _begin = reinterpret_cast<typename return_type::const_iterator*>( &first );
234  auto _end = reinterpret_cast<typename return_type::const_iterator*>( &last );
235  return return_type( *_begin, *_end );
236  }

◆ operator()()

template<class TYPE >
template<class COMMON >
return_type Gaudi::Utils::GetData< Gaudi::Range_< std::vector< const TYPE * > > >::operator() ( const COMMON &  common,
IDataProviderSvc *  service,
std::string_view  location,
const bool  checkData = true 
) const
inline

the only one essential method

Parameters
commonthe actual "worker"
servicepointer to Data Provider Service
locationlocation of objects in TES
checkDatawhether to check if the pointer is valid before returning it
Returns
the data

try to be efficient:

  1. load object only once:
  2. try to get the selection
  3. try to get the container

Definition at line 170 of file GetData.h.

171  {
174  DataObject* object = this->getData( service, std::string{ location } );
175  if ( object ) {
177  typedef typename TYPE::Selection Selection_;
178  const Selection_* sel = dynamic_cast<Selection_*>( object );
179  if ( sel ) {
180  if ( common.msgLevel( MSG::DEBUG ) ) {
181  common.debug() << "The object of type '" << System::typeinfoName( typeid( *object ) )
182  << "' has been retrieved from TS at address '" << location << "'" << endmsg;
183  }
184  return make_range( sel );
185  }
187  typedef typename TYPE::Container Container_;
188  const Container_* cnt = dynamic_cast<Container_*>( object );
189  if ( cnt ) {
190  if ( common.msgLevel( MSG::DEBUG ) ) {
191  common.debug() << "The object of type '" << System::typeinfoName( typeid( *object ) )
192  << "' has been retrieved from TS at address '" << location << "'" << endmsg;
193  }
194  return make_range( cnt );
195  }
196  // no valid data
197  if ( checkData )
198  common.Assert( false, std::string{ "get():: No valid data at '" }.append( location ).append( "'" ) );
199  }
200  // no valid data
201  if ( checkData ) common.Assert( false, std::string{ "get():: No data at '" }.append( location ).append( "'" ) );
202  // the fictive return
203  return return_type();
204  }

The documentation for this struct was generated from the following file:
MSG::DEBUG
@ DEBUG
Definition: IMessageSvc.h:25
SmartDataObjectPtr::ObjectLoader::access
static AccessFunction access()
Definition: SmartDataObjectPtr.cpp:27
std::string
STL class.
GaudiPython.HistoUtils.location
location
Definition: HistoUtils.py:965
std::move
T move(T... args)
System::typeinfoName
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:308
Gaudi::Utils::begin
AttribStringParser::Iterator begin(const AttribStringParser &parser)
Definition: AttribStringParser.h:130
SmartDataObjectPtr
Definition: SmartDataObjectPtr.h:42
Gaudi::Utils::end
AttribStringParser::Iterator end(const AttribStringParser &)
Definition: AttribStringParser.h:133
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:203
IOTest.sel
sel
Definition: IOTest.py:109
std::string::append
T append(T... args)
DataObject
Definition: DataObject.h:40
Gaudi::Utils::GetData< Gaudi::Range_< std::vector< const TYPE * > > >::getData
DataObject * getData(IDataProviderSvc *service, std::string location) const
get the data form transient store
Definition: GetData.h:222
Gaudi::Utils::GetData< Gaudi::Range_< std::vector< const TYPE * > > >::make_range
return_type make_range(const typename TYPE::Container *cnt) const
Definition: GetData.h:209
Gaudi::Utils::GetData< Gaudi::Range_< std::vector< const TYPE * > > >::return_type
_GetType< Type >::return_type return_type
Definition: GetData.h:158