ATLAS Offline Software
Loading...
Searching...
No Matches
D3PD::SGTileRawChannelGetterTool Class Referenceabstract

#include <SGTileRawChannelGetterTool.h>

Inheritance diagram for D3PD::SGTileRawChannelGetterTool:
Collaboration diagram for D3PD::SGTileRawChannelGetterTool:

Public Types

typedef D3PD::SGCollectionGetterTool< TileRawChannelContainerBase

Public Member Functions

 SGTileRawChannelGetterTool (const std::string &type, const std::string &name, const IInterface *parent)
 Standard Gaudi tool constructor.
virtual ~SGTileRawChannelGetterTool ()
StatusCode initialize ()
 Standard Gaudi initialize method.
size_t sizeHint (bool allowMissing=false)
 Return an estimate of the number of elements in the iteration.
StatusCode reset (bool allowMissing=false)
 Reset the iteration to the start of the collection.
const void * nextUntyped ()
 Return a pointer to the next element in the collection.
const std::type_info & typeinfo () const
 Return the type of object retrieved by this tool.
const std::type_info & elementTypeinfo () const
 Return the element type of the collection.
virtual const void * getUntyped (bool allowMissing=false)
 Return the target object.
virtual const TileRawChannelContainerget (bool allowMissing=false)
 Type-safe wrapper for get.
CLID clid () const
 Return the class ID being read by this tool.
virtual void releaseObject (const TileRawChannelContainer *p)
 Release an object retrieved from the getter.
void releaseObject (const T *p)
 Type-safe wrapper for releaseObjectUntyped.
virtual void releaseObject (const CONT *p)
 Release an object retrieved from the getter.
virtual void releaseObjectUntyped (const void *p)
 Release an object retrieved from the getter.
virtual void releaseObjectUntyped (const void *p)
 Release an object retrieved from the getter.
 CollectionGetterToolImpl (const std::string &type, const std::string &name, const IInterface *parent)
 Standard Gaudi tool constructor.
const void * nextTypeinfo (const std::type_info &ti)
 Return the next object cast to a different pointer type.
StatusCode configureElementTypeinfo (const std::type_info &ti)
 Test type compatibility.
void releaseElementTypeinfo (const void *p, const std::type_info &ti)
 Release an element retrieved from the getter.
 DeclareInterfaceID (IObjGetterTool, 1, 0)
 Gaudi interface definition.
StatusCode configureD3PD ()
 Test type compatibility.
virtual const void * getTypeinfo (const std::type_info &ti, bool allowMissing=false)=0
 Return the target object cast to a different pointer type.
void releaseObjectTypeinfo (const void *p, const std::type_info &ti)
 Release an object retrieved from the getter.
virtual StatusCode configureTypeinfo (const std::type_info &ti)=0
 Test type compatibility.

Protected Member Functions

StatusCode initializeImpl ()
 Initialize this mixin class.

Protected Attributes

std::string m_typename
 Property: Name of the type of the object being retrieved.
std::string m_sgkey
 Property: StoreGate key of the object being retrieved.
ServiceHandle< IClassIDSvc > m_clidsvc
 Property: Instance of the ClassIDSvc to use.
SGKeyResolver m_resolver
 Helper: Resolve the SG key to use.

Private Attributes

TileRawChannelContainer::const_iterator m_evtItr
TileRawChannelContainer::const_iterator m_evtEnd
TileRawChannelCollection::const_iterator m_digItr
TileRawChannelCollection::const_iterator m_digEnd
CLID m_clid
 CLID for the object being retrieved.
ServiceHandle< StoreGateSvc > & m_sg
 The event storage service.
TileRawChannelContainer::const_iterator m_it
 The current iterator.
TileRawChannelContainer::const_iterator m_end
 The iterator at the end of the container.
std::string m_label
 Property: label to assign to this getter (or null).
ToolHandle< ICollectionGetterRegistryToolm_registry
 The collection getter registry tool.
TypeConverter m_converter
 Helper to convert pointers.
TypeConverter m_backConverter
 Helper to convert pointers back, for releaseElement.

Detailed Description

Definition at line 20 of file SGTileRawChannelGetterTool.h.

Member Typedef Documentation

◆ Base

Constructor & Destructor Documentation

◆ SGTileRawChannelGetterTool()

D3PD::SGTileRawChannelGetterTool::SGTileRawChannelGetterTool ( const std::string & type,
const std::string & name,
const IInterface * parent )

Standard Gaudi tool constructor.

Parameters
typeThe name of the tool type.
nameThe tool name.
parentThe tool's Gaudi parent.

Definition at line 16 of file SGTileRawChannelGetterTool.cxx.

18 :
19 Base(type,name,parent) {
20 }
D3PD::SGCollectionGetterTool< TileRawChannelContainer > Base

◆ ~SGTileRawChannelGetterTool()

D3PD::SGTileRawChannelGetterTool::~SGTileRawChannelGetterTool ( )
virtual

Definition at line 23 of file SGTileRawChannelGetterTool.cxx.

23 {
24 }

Member Function Documentation

◆ clid()

CLID D3PD::SGGetterImpl::clid ( ) const
inherited

Return the class ID being read by this tool.

Definition at line 71 of file SGGetterImpl.cxx.

55{
56 return m_clid;
57}
Collection getter tool retrieving a container from StoreGate.

◆ CollectionGetterToolImpl()

D3PD::CollectionGetterToolImpl::CollectionGetterToolImpl ( const std::string & type,
const std::string & name,
const IInterface * parent )
inherited

Standard Gaudi tool constructor.

Parameters
typeThe name of the tool type.
nameThe tool name.
parentThe tool's Gaudi parent.

Definition at line 45 of file CollectionGetterToolImpl.cxx.

32{
33 declareProperty ("Label", m_label,
34 "Label to assign to this getter, to be able to reference "
35 "it from an association tool. Leave blank if no label "
36 "is needed.");
37 declareProperty ("CollectionGetterRegistry", m_registry,
38 "Collection getter registry tool");
39}

◆ configureD3PD()

StatusCode D3PD::IObjGetterTool::configureD3PD ( )
inherited

Test type compatibility.

Test to see if the object being returned by the tool can be converted to a pointer to T. This can be used to perform type checks during job initialization.

This is implemented in terms of configureTypeinfo.

◆ configureElementTypeinfo()

StatusCode D3PD::CollectionGetterToolImpl::configureElementTypeinfo ( const std::type_info & ti)
inherited

Test type compatibility.

Parameters
tiThe desired type.

Test to see if the object being returned by the tool can be converted to a pointer to T. This can be used to perform type checks during job initialization.

Definition at line 78 of file CollectionGetterToolImpl.cxx.

148{
149 return this->m_converter.init(this->elementTypeinfo(), ti);
150}
virtual const std::type_info & elementTypeinfo() const

◆ configureTypeinfo()

virtual StatusCode D3PD::IObjGetterTool::configureTypeinfo ( const std::type_info & ti)
pure virtualinherited

Test type compatibility.

Parameters
tiThe desired type.

Test to see if the object being returned by the tool can be converted to a pointer to T. This can be used to perform type checks during job initialization.

◆ DeclareInterfaceID()

D3PD::IObjGetterTool::DeclareInterfaceID ( IObjGetterTool ,
1 ,
0  )
inherited

Gaudi interface definition.

◆ elementTypeinfo()

const std::type_info & D3PD::SGTileRawChannelGetterTool::elementTypeinfo ( ) const
virtual

Return the element type of the collection.

I.e., nextUntyped returns a pointer to this type.

Reimplemented from D3PD::CollectionGetterTool< CONT >.

Definition at line 35 of file SGTileRawChannelGetterTool.cxx.

35 {
36 return typeid(TileRawChannel);
37 }

◆ get()

virtual const TileRawChannelContainer * D3PD::SGCollectionGetterTool< TileRawChannelContainer >::get ( bool allowMissing = false)
virtualinherited

Type-safe wrapper for get.

Parameters
allowMissingIf true, then we should not generate errors if the requested object is missing.

Return the object as a pointer to T. Return 0 if the get fails or if the pointer can't be converted.

Implements D3PD::CollectionGetterTool< CONT >.

◆ getTypeinfo()

virtual const void * D3PD::IObjGetterTool::getTypeinfo ( const std::type_info & ti,
bool allowMissing = false )
pure virtualinherited

Return the target object cast to a different pointer type.

Parameters
tiThe desired type.
allowMissingIf true, then we should not generate errors if the requested object is missing.

Return the object as a pointer to the ti type. Return 0 if the get fails or if the pointer can't be converted.

◆ getUntyped()

virtual const void * D3PD::SGCollectionGetterTool< TileRawChannelContainer >::getUntyped ( bool allowMissing = false)
virtualinherited

Return the target object.

Parameters
allowMissingIf true, then we should not generate errors if the requested object is missing.

Should be of the type given by typeinfo. Return 0 on failure.

Reimplemented from D3PD::SGGetterImpl.

◆ initialize()

StatusCode D3PD::SGTileRawChannelGetterTool::initialize ( )
virtual

Standard Gaudi initialize method.

Reimplemented from D3PD::SGCollectionGetterTool< TileRawChannelContainer >.

Definition at line 26 of file SGTileRawChannelGetterTool.cxx.

26 {
28 return StatusCode::SUCCESS;
29 }
#define CHECK(...)
Evaluate an expression and check for errors.

◆ initializeImpl()

StatusCode D3PD::SGGetterImpl::initializeImpl ( )
protectedinherited

Initialize this mixin class.

Call this from initialize.

Definition at line 109 of file SGGetterImpl.cxx.

106{
107 CHECK( m_clidsvc.retrieve() );
108
110
112
113 return StatusCode::SUCCESS;
114}

◆ nextTypeinfo()

const void * D3PD::CollectionGetterToolImpl::nextTypeinfo ( const std::type_info & ti)
inherited

Return the next object cast to a different pointer type.

Return the next element from the collection as a pointer to the ti type. Return 0 if the pointer can't be converted or at the end of the iteration.

Definition at line 67 of file CollectionGetterToolImpl.cxx.

69{
70 // Configure the converter.
71 if (!this->m_converter.isValid() ||
73 {
75 return 0;
76 }
77
78 // Get the next object. If the conversion fails, loop until we get
79 // a good one.
80 while (true) {
81 const void* p = this->nextUntyped();
82 if (!p) return 0;
83 const void* pconv = this->m_converter.convertUntyped (p);
84 if (pconv) return pconv;
87 << "Pointer conversion from " << m_converter.srcName() << " to "
88 << m_converter.dstName() << "failed.";
89 }
90}
#define REPORT_MESSAGE(LVL)
Report a message.
TypeConverter m_converter
Helper to convert pointers.
const std::type_info & dstTypeinfo() const
Return the configured destination type.

◆ nextUntyped()

const void * D3PD::SGTileRawChannelGetterTool::nextUntyped ( )
virtual

Return a pointer to the next element in the collection.

Return 0 when the collection has been exhausted.

Reimplemented from D3PD::CollectionGetterTool< CONT >.

Definition at line 70 of file SGTileRawChannelGetterTool.cxx.

70 {
71 const TileRawChannel* tileR=0;
72 const TileRawChannelCollection* col=0;
73 do{
74 if(m_evtItr==m_evtEnd)return 0;
75 if(m_digItr==m_digEnd){
76 tileR=0;
77 ++m_evtItr;
78 if(m_evtItr!=m_evtEnd){
79 col=*m_evtItr;
80 m_digItr=col->begin();
81 m_digEnd=col->end();
82 }
83 }
84 else {
85 tileR=*m_digItr;
86 ++m_digItr;
87 }
88 }while(!tileR);
89
90 // if(m_evtItr==m_evtEnd)return 0;
91 // col=*m_evtItr;
92 // ++m_evtItr;
93
94 return tileR;
95 }
TileRawChannelCollection::const_iterator m_digItr
TileRawChannelContainer::const_iterator m_evtEnd
TileRawChannelContainer::const_iterator m_evtItr
TileRawChannelCollection::const_iterator m_digEnd
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.

◆ releaseElementTypeinfo()

void D3PD::CollectionGetterToolImpl::releaseElementTypeinfo ( const void * p,
const std::type_info & ti )
inherited

Release an element retrieved from the getter.

Parameters
pThe element to release.
tiThe type of p.

Call this when you are done with the element returned by nextUntyped(). The default implementation is a no-op, but if the getter dynamically allocated the object which it returned, this gives it a chance to free it.

Definition at line 91 of file CollectionGetterToolImpl.cxx.

106{
107 if (!p)
108 return;
109
110 // Configure the converter if needed.
111 if (!this->m_backConverter.isValid() ||
113 {
114 if (this->m_backConverter.init (ti, this->typeinfo()).isFailure()) {
116 << "Can't configure pointer conversion from "
117 << System::typeinfoName (ti) << " to "
118 << System::typeinfoName (this->typeinfo());
119 return;
120 }
121 }
122
123 // Convert to the desired type.
124 p = this->m_backConverter.convertUntyped (p);
125
126 // Release.
127 if (p)
128 this->releaseElementUntyped (p);
129 else {
131 << "Pointer conversion from " << m_backConverter.srcName() << " to "
132 << m_backConverter.dstName() << "failed.";
133 }
134}
TypeConverter m_backConverter
Helper to convert pointers back, for releaseElement.
virtual const std::type_info & typeinfo() const
Return the type of object retrieved by this tool.
const std::type_info & srcTypeinfo() const
Return the configured source type.

◆ releaseObject() [1/3]

template<class CONT>
virtual void D3PD::CollectionGetterTool< CONT >::releaseObject ( const CONT * p)
virtualinherited

Release an object retrieved from the getter.

Parameters
pThe object to release.

Call this when you are done with the object returned by get(). The default implementation is a no-op, but if the getter dynamically allocated the object which it returned, this gives it a chance to free it.

◆ releaseObject() [2/3]

void D3PD::IObjGetterTool::releaseObject ( const T * p)
inherited

Type-safe wrapper for releaseObjectUntyped.

Parameters
pThe object to release.

Call this when you are done with the object returned by get(). The default implementation is a no-op, but if the getter dynamically allocated the object which it returned, this gives it a chance to free it.

This is implemented in terms of releaseObjectTypeinfo().

◆ releaseObject() [3/3]

virtual void D3PD::CollectionGetterTool< TileRawChannelContainer >::releaseObject ( const TileRawChannelContainer * p)
virtualinherited

Release an object retrieved from the getter.

Parameters
pThe object to release.

Call this when you are done with the object returned by get(). The default implementation is a no-op, but if the getter dynamically allocated the object which it returned, this gives it a chance to free it.

◆ releaseObjectTypeinfo()

void D3PD::IObjGetterTool::releaseObjectTypeinfo ( const void * p,
const std::type_info & ti )
inherited

Release an object retrieved from the getter.

Parameters
pThe object to release.
tiThe type of p.

Call this when you are done with the object returned by getUntyped(). The default implementation is a no-op, but if the getter dynamically allocated the object which it returned, this gives it a chance to free it.

◆ releaseObjectUntyped() [1/2]

virtual void D3PD::IObjGetterTool::releaseObjectUntyped ( const void * p)
virtualinherited

Release an object retrieved from the getter.

Parameters
pThe object to release.

Call this when you are done with the object returned by getUntyped(). The default implementation is a no-op, but if the getter dynamically allocated the object which it returned, this gives it a chance to free it.

◆ releaseObjectUntyped() [2/2]

virtual void D3PD::CollectionGetterTool< TileRawChannelContainer >::releaseObjectUntyped ( const void * p)
virtualinherited

Release an object retrieved from the getter.

Parameters
pThe object to release.

Call this when you are done with the object returned by getUntyped(). The default implementation is a no-op, but if the getter dynamically allocated the object which it returned, this gives it a chance to free it.

◆ reset()

StatusCode D3PD::SGTileRawChannelGetterTool::reset ( bool allowMissing = false)
virtual

Reset the iteration to the start of the collection.

Parameters
allowMissingIf true, then we should not generate errors if the requested object is missing.

Return failure if the container cannot be retrieved.

Reimplemented from D3PD::CollectionGetterTool< CONT >.

Definition at line 50 of file SGTileRawChannelGetterTool.cxx.

50 {
51 const TileRawChannelContainer* tdc=get(allowMissing);
52 if(!tdc){
55 return StatusCode::FAILURE;
56 }
57 m_evtItr=tdc->begin();
58 m_evtEnd=tdc->end();
59 if(m_evtItr==m_evtEnd){
61 return StatusCode::SUCCESS;
62 }
63 const TileRawChannelCollection* col=*m_evtItr;
64 m_digItr=col->begin();
65 m_digEnd=col->end();
66
67 return StatusCode::SUCCESS;
68 }
Athena::TPCnvVers::Old Athena::TPCnvVers::Old Athena::TPCnvVers::Current Athena::TPCnvVers::Old Athena::TPCnvVers::Current TileRawChannelContainer
virtual const TileRawChannelContainer * get(bool allowMissing=false)
const_iterator end() const
return const_iterator for end of container
const_iterator begin() const
return const_iterator for first entry

◆ sizeHint()

size_t D3PD::SGTileRawChannelGetterTool::sizeHint ( bool allowMissing = false)
virtual

Return an estimate of the number of elements in the iteration.

Parameters
allowMissingIf true, then we should not generate errors if the requested object is missing.

This can be used to pre-allocate memory. (It's possible that this isn't known in advance of iterating over the entire collection, for example if a selection is being applied, so this is only a hint.)

Reimplemented from D3PD::CollectionGetterTool< CONT >.

Definition at line 39 of file SGTileRawChannelGetterTool.cxx.

39 {
40 const TileRawChannelContainer* tdc=get(allowMissing);
41 if(!tdc)return 0;
42 const TileRawChannelCollection* col=*(tdc->begin());
43 size_t rval=0;
44 size_t digSize=sizeof(TileRawChannel);
46 for(it=col->begin();it<col->end();++it)++rval;
47 return rval*digSize;
48 }
DataModel_detail::const_iterator< DataVector > const_iterator
Standard const_iterator.
Definition DataVector.h:838

◆ typeinfo()

const std::type_info & D3PD::SGTileRawChannelGetterTool::typeinfo ( ) const
virtual

Return the type of object retrieved by this tool.

Reimplemented from D3PD::SGCollectionGetterTool< TileRawChannelContainer >.

Definition at line 31 of file SGTileRawChannelGetterTool.cxx.

31 {
32 return typeid(TileRawChannelContainer);
33 }

Member Data Documentation

◆ m_backConverter

TypeConverter D3PD::CollectionGetterToolImpl::m_backConverter
privateinherited

Helper to convert pointers back, for releaseElement.

Definition at line 106 of file CollectionGetterToolImpl.h.

◆ m_clid

CLID D3PD::SGGetterImpl::m_clid
privateinherited

CLID for the object being retrieved.

Definition at line 126 of file SGGetterImpl.h.

◆ m_clidsvc

ServiceHandle<IClassIDSvc> D3PD::SGGetterImpl::m_clidsvc
protectedinherited

Property: Instance of the ClassIDSvc to use.

Definition at line 119 of file SGGetterImpl.h.

◆ m_converter

TypeConverter D3PD::CollectionGetterToolImpl::m_converter
privateinherited

Helper to convert pointers.

Definition at line 103 of file CollectionGetterToolImpl.h.

◆ m_digEnd

TileRawChannelCollection::const_iterator D3PD::SGTileRawChannelGetterTool::m_digEnd
private

Definition at line 44 of file SGTileRawChannelGetterTool.h.

◆ m_digItr

TileRawChannelCollection::const_iterator D3PD::SGTileRawChannelGetterTool::m_digItr
private

Definition at line 44 of file SGTileRawChannelGetterTool.h.

◆ m_end

The iterator at the end of the container.

Definition at line 143 of file CollectionGetterTool.h.

◆ m_evtEnd

TileRawChannelContainer::const_iterator D3PD::SGTileRawChannelGetterTool::m_evtEnd
private

Definition at line 43 of file SGTileRawChannelGetterTool.h.

◆ m_evtItr

TileRawChannelContainer::const_iterator D3PD::SGTileRawChannelGetterTool::m_evtItr
private

Definition at line 43 of file SGTileRawChannelGetterTool.h.

◆ m_it

The current iterator.

Definition at line 140 of file CollectionGetterTool.h.

◆ m_label

std::string D3PD::CollectionGetterToolImpl::m_label
privateinherited

Property: label to assign to this getter (or null).

Definition at line 97 of file CollectionGetterToolImpl.h.

◆ m_registry

ToolHandle<ICollectionGetterRegistryTool> D3PD::CollectionGetterToolImpl::m_registry
privateinherited

The collection getter registry tool.

Definition at line 100 of file CollectionGetterToolImpl.h.

◆ m_resolver

SGKeyResolver D3PD::SGGetterImpl::m_resolver
protectedinherited

Helper: Resolve the SG key to use.

Definition at line 122 of file SGGetterImpl.h.

◆ m_sg

ServiceHandle<StoreGateSvc>& D3PD::SGGetterImpl::m_sg
privateinherited

The event storage service.

Definition at line 129 of file SGGetterImpl.h.

◆ m_sgkey

std::string D3PD::SGGetterImpl::m_sgkey
protectedinherited

Property: StoreGate key of the object being retrieved.

Definition at line 116 of file SGGetterImpl.h.

◆ m_typename

std::string D3PD::SGGetterImpl::m_typename
protectedinherited

Property: Name of the type of the object being retrieved.

Definition at line 113 of file SGGetterImpl.h.


The documentation for this class was generated from the following files: