| The Gaudi Framework v29r0 (ff2e7097)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Private Member Functions | List of all members
Gaudi::Utils::GetData< Gaudi::Range_< std::vector< const TYPE * > > > Struct Template Reference

the template specialization for ranges More...

`#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, 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
DataObject * | getData (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

## Detailed Description

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

the template specialization for ranges

Definition at line 158 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 163 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 162 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

  service | pointer to data provider service
  location | the location

Returns
  the object for TES

Try to be efficient

Definition at line 229 of file GetData.h.

230 {
232 SmartDataObjectPtr getter( SmartDataObjectPtr::ObjectLoader::access(), service, nullptr, location );
233 return getter.accessData();
234 }
SmartDataObjectPtr
A small class used to access easily (and efficiently) data items residing in data stores...
Definition: SmartDataObjectPtr.h:32
SmartDataObjectPtr::ObjectLoader::access
static AccessFunction access()
Definition: SmartDataObjectPtr.cpp:17
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 214 of file GetData.h.

215 {
216 return 0 == cnt ? return_type() : make_range( cnt->begin(), cnt->end() );
217 }
Gaudi::Utils::end
AttribStringParser::Iterator end(const AttribStringParser &)
Definition: AttribStringParser.h:133
Gaudi::Utils::GetData< Gaudi::Range_< std::vector< const TYPE * > > >::return_type
_GetType< Type >::return_type return_type
Definition: GetData.h:163
Gaudi::Utils::GetData< Gaudi::Range_< std::vector< const TYPE * > > >::make_range
return_type make_range(const typename TYPE::Container *cnt) const
Definition: GetData.h:214
Gaudi::Utils::begin
AttribStringParser::Iterator begin(const AttribStringParser &parser)
Definition: AttribStringParser.h:129
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 219 of file GetData.h.

220 {
221 return 0 == cnt ? return_type() : return_type( cnt->begin(), cnt->end() );
222 }
Gaudi::Utils::end
AttribStringParser::Iterator end(const AttribStringParser &)
Definition: AttribStringParser.h:133
Gaudi::Utils::GetData< Gaudi::Range_< std::vector< const TYPE * > > >::return_type
_GetType< Type >::return_type return_type
Definition: GetData.h:163
Gaudi::Utils::begin
AttribStringParser::Iterator begin(const AttribStringParser &parser)
Definition: AttribStringParser.h:129
template<class TYPE >
template<class ITERATOR >

return_type Gaudi::Utils::GetData< Gaudi::Range_< std::vector< const TYPE * > > >::make_range | ( | ITERATOR | first,
|  | ITERATOR | last
| ) |  | const
| inline private

Definition at line 239 of file GetData.h.

240 {
241 auto _begin = reinterpret_cast<typename return_type::const_iterator*>( &first );
242 auto _end = reinterpret_cast<typename return_type::const_iterator*>( &last );
243 return return_type( *_begin, *_end );
244 }
Gaudi::Utils::GetData< Gaudi::Range_< std::vector< const TYPE * > > >::return_type
_GetType< Type >::return_type return_type
Definition: GetData.h:163
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

  common | the actual "worker"
  service | pointer to Data Provider Service
  location | location of objects in TES
  checkData | whether 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 175 of file GetData.h.

177 {
180 DataObject* object = this->getData( service, location );
181 if ( object ) {
183 typedef typename TYPE::Selection Selection_;
184 const Selection_* sel = dynamic_cast<Selection_*>( object );
185 if ( sel ) {
186 if ( common.msgLevel( MSG::DEBUG ) ) {
187 common.debug() << "The object of type '" << System::typeinfoName( typeid( *object ) )
188 << "' has been retrieved from TS at address '" << location << "'" << endmsg;
189 }
190 return make_range( sel );
191 }
193 typedef typename TYPE::Container Container_;
194 const Container_* cnt = dynamic_cast<Container_*>( object );
195 if ( cnt ) {
196 if ( common.msgLevel( MSG::DEBUG ) ) {
197 common.debug() << "The object of type '" << System::typeinfoName( typeid( *object ) )
198 << "' has been retrieved from TS at address '" << location << "'" << endmsg;
199 }
200 return make_range( cnt );
201 }
202 // no valid data
203 if ( checkData ) common.Assert( false, "get():: No valid data at '" + location + "'" );
204 }
205 // no valid data
206 if ( checkData ) common.Assert( false, "get():: No data at '" + location + "'" );
207 // the fictive return
208 return return_type();
209 }
System::typeinfoName
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:329
Gaudi::Utils::GetData< Gaudi::Range_< std::vector< const TYPE * > > >::getData
DataObject * getData(IDataProviderSvc *service, const std::string &location) const
get the data form transient store
Definition: GetData.h:229
MSG::DEBUG
Definition: IMessageSvc.h:16
IOTest.sel
sel
Definition: IOTest.py:95
Gaudi::Utils::GetData< Gaudi::Range_< std::vector< const TYPE * > > >::return_type
_GetType< Type >::return_type return_type
Definition: GetData.h:163
Gaudi::Utils::GetData< Gaudi::Range_< std::vector< const TYPE * > > >::make_range
return_type make_range(const typename TYPE::Container *cnt) const
Definition: GetData.h:214
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:29
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209

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

- GaudiAlg/GaudiAlg/GetData.h