Gaudi::Utils::GetData< Gaudi::Range_< std::vector< const TYPE * > > > Struct Template Reference

the template specialization for ranges More...

#include </scratch/z5/marcocle/GaudiDocs/lhcb-release/825/GAUDI/GAUDI_v26r3/InstallArea/x86_64-slc6-gcc48-opt/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
 
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, const std::string &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
 
DataObjectgetData (IDataProviderSvc *service, const std::string &location) const
 get the data form transient store More...
 
template<class COMMON >
return_type operator() (const COMMON &common, IDataProviderSvc *service, const std::string &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
 
DataObjectgetData (IDataProviderSvc *service, const 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
 
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 127 of file GetData.h.

Member Typedef Documentation

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

Definition at line 133 of file GetData.h.

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

Definition at line 133 of file GetData.h.

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 132 of file GetData.h.

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 132 of file GetData.h.

Member Function Documentation

template<class TYPE >
DataObject* Gaudi::Utils::GetData< Gaudi::Range_< std::vector< const TYPE * > > >::getData ( IDataProviderSvc service,
const 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 205 of file GetData.h.

207  {
209  SmartDataObjectPtr getter
211  service , 0 , location ) ;
212  return getter.accessData () ;
213  }
A small class used to access easily (and efficiently) data items residing in data stores...
template<class TYPE >
DataObject* Gaudi::Utils::GetData< Gaudi::Range_< std::vector< const TYPE * > > >::getData ( IDataProviderSvc service,
const 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 205 of file GetData.h.

207  {
209  SmartDataObjectPtr getter
211  service , 0 , location ) ;
212  return getter.accessData () ;
213  }
A small class used to access easily (and efficiently) data items residing in data stores...
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 194 of file GetData.h.

195  { return 0 == cnt ? return_type() : make_range ( cnt->begin() , cnt->end() ) ; }
return_type make_range(const typename TYPE::Container *cnt) const
Definition: GetData.h:194
tuple end
Definition: IOTest.py:101
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 194 of file GetData.h.

195  { return 0 == cnt ? return_type() : make_range ( cnt->begin() , cnt->end() ) ; }
return_type make_range(const typename TYPE::Container *cnt) const
Definition: GetData.h:194
tuple end
Definition: IOTest.py:101
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 197 of file GetData.h.

198  { return 0 == cnt ? return_type() : return_type ( cnt->begin() , cnt->end() ) ; }
tuple end
Definition: IOTest.py:101
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 197 of file GetData.h.

198  { return 0 == cnt ? return_type() : return_type ( cnt->begin() , cnt->end() ) ; }
tuple end
Definition: IOTest.py:101
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 219 of file GetData.h.

221  {
222  typename return_type::const_iterator* _begin = reinterpret_cast<typename return_type::const_iterator*>(&first);
223  typename return_type::const_iterator* _end = reinterpret_cast<typename return_type::const_iterator*>(&last);
224  return return_type(*_begin, *_end);
225  }
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 219 of file GetData.h.

221  {
222  typename return_type::const_iterator* _begin = reinterpret_cast<typename return_type::const_iterator*>(&first);
223  typename return_type::const_iterator* _end = reinterpret_cast<typename return_type::const_iterator*>(&last);
224  return return_type(*_begin, *_end);
225  }
template<class TYPE >
template<class COMMON >
return_type Gaudi::Utils::GetData< Gaudi::Range_< std::vector< const TYPE * > > >::operator() ( const COMMON &  common,
IDataProviderSvc service,
const std::string &  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 146 of file GetData.h.

150  {
153  DataObject* object = this -> getData ( service , location ) ;
154  if ( 0 != object )
155  {
157  typedef typename TYPE::Selection Selection_;
158  const Selection_* sel = dynamic_cast<Selection_*> ( object ) ;
159  if ( 0 != sel )
160  {
161  if ( common.msgLevel ( MSG::DEBUG ) )
162  { common.debug() << "The object of type '"
163  << System::typeinfoName(typeid(*object))
164  << "' has been retrieved from TS at address '"
165  << location << "'" << endmsg ; }
166  return make_range ( sel ) ;
167  }
169  typedef typename TYPE::Container Container_ ;
170  const Container_* cnt = dynamic_cast<Container_*> ( object ) ;
171  if ( 0 != cnt )
172  {
173  if ( common.msgLevel ( MSG::DEBUG ) )
174  { common.debug() << "The object of type '"
175  << System::typeinfoName(typeid(*object))
176  << "' has been retrieved from TS at address '"
177  << location << "'" << endmsg ; }
178  return make_range ( cnt ) ;
179  }
180  // no valid data
181  if (checkData)
182  common.Assert ( false , "get():: No valid data at '" + location + "'" ) ;
183  }
184  // no valid data
185  if (checkData)
186  common.Assert ( false , "get():: No data at '" + location + "'" ) ;
187  // the fictive return
188  return return_type () ;
189  }
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
DataObject * getData(IDataProviderSvc *service, const std::string &location) const
get the data form transient store
Definition: GetData.h:205
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:299
return_type make_range(const typename TYPE::Container *cnt) const
Definition: GetData.h:194
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:31
template<class TYPE >
template<class COMMON >
return_type Gaudi::Utils::GetData< Gaudi::Range_< std::vector< const TYPE * > > >::operator() ( const COMMON &  common,
IDataProviderSvc service,
const std::string &  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 146 of file GetData.h.

150  {
153  DataObject* object = this -> getData ( service , location ) ;
154  if ( 0 != object )
155  {
157  typedef typename TYPE::Selection Selection_;
158  const Selection_* sel = dynamic_cast<Selection_*> ( object ) ;
159  if ( 0 != sel )
160  {
161  if ( common.msgLevel ( MSG::DEBUG ) )
162  { common.debug() << "The object of type '"
163  << System::typeinfoName(typeid(*object))
164  << "' has been retrieved from TS at address '"
165  << location << "'" << endmsg ; }
166  return make_range ( sel ) ;
167  }
169  typedef typename TYPE::Container Container_ ;
170  const Container_* cnt = dynamic_cast<Container_*> ( object ) ;
171  if ( 0 != cnt )
172  {
173  if ( common.msgLevel ( MSG::DEBUG ) )
174  { common.debug() << "The object of type '"
175  << System::typeinfoName(typeid(*object))
176  << "' has been retrieved from TS at address '"
177  << location << "'" << endmsg ; }
178  return make_range ( cnt ) ;
179  }
180  // no valid data
181  if (checkData)
182  common.Assert ( false , "get():: No valid data at '" + location + "'" ) ;
183  }
184  // no valid data
185  if (checkData)
186  common.Assert ( false , "get():: No data at '" + location + "'" ) ;
187  // the fictive return
188  return return_type () ;
189  }
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
DataObject * getData(IDataProviderSvc *service, const std::string &location) const
get the data form transient store
Definition: GetData.h:205
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:299
return_type make_range(const typename TYPE::Container *cnt) const
Definition: GetData.h:194
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:31

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