![]() |
ATLAS Offline Software
|
Helper for holding non-const raw data prior to recording in SG. More...
#include <TileMutableDataContainer.h>
Public Types | |
| typedef BASE_T | BASE |
| typedef BASE::TYPE | TYPE |
| typedef BASE::UNIT | UNIT |
| typedef BASE::IDENTIFIABLE | Collection |
| typedef BASE::TElement | Element |
Public Member Functions | |
| TileMutableDataContainer (bool createColl=false, TYPE type=TileFragHash::Default, UNIT unit=TileRawChannelUnit::ADCcounts, SG::OwnershipPolicy ownPolicy=SG::OWN_ELEMENTS) | |
| Constructor. | |
| TileMutableDataContainer (const BASE &other) | |
| Copy constructor. | |
| TileMutableDataContainer (const TileMutableDataContainer &)=delete | |
| TileMutableDataContainer & | operator= (const TileMutableDataContainer &)=delete |
| StatusCode | addCollection (std::unique_ptr< Collection > coll, IdentifierHash hash) |
| Add a collection to the container. | |
| StatusCode | push_back (std::unique_ptr< Element > rch) |
| Add a new channel. | |
| StatusCode | push_back (Element *rch) |
| Add a new channel. | |
| Collection * | indexFindPtr (IdentifierHash hash) |
| Look up a (non-const) collection via hash. | |
| StatusCode | status () const |
| Return the error status from the constructors. | |
| virtual void | lock () override |
| Lock this object. | |
Protected Member Functions | |
| void | recycle () |
| Recycle this object for use in another event. | |
Private Attributes | |
| std::vector< Collection * > | m_mutableCollections |
| Non-const references to collections, indexed by hash value. | |
| bool | m_locked |
| Is the container locked? | |
| StatusCode | m_sc |
| StatusCode from constructors. | |
| TYPE | m_defaultType |
| Default type; reset to this on recycle. | |
| UNIT | m_defaultUnit |
| Default unit; reset to this on recycle. | |
Helper for holding non-const raw data prior to recording in SG.
Sometimes one wants to construct a tile raw data container and then, before it is recorded in SG, modify the contents. This is problematic as the container classes only support const access to the contents.
This helper derives from a specific tile raw data container and also maintains non-const pointers to the collections, which we can return. However, once the object has been made const in SG, we set a flag so that non-const access is no longer possible.
After constructing one of these objects, one should call status() to check for errors.
This class does not have its own CLID. Record in SG via a handle of type matching the base tile raw data container.
Definition at line 48 of file TileMutableDataContainer.h.
| typedef BASE_T TileMutableDataContainer< BASE_T >::BASE |
Definition at line 52 of file TileMutableDataContainer.h.
| typedef BASE::IDENTIFIABLE TileMutableDataContainer< BASE_T >::Collection |
Definition at line 55 of file TileMutableDataContainer.h.
| typedef BASE::TElement TileMutableDataContainer< BASE_T >::Element |
Definition at line 56 of file TileMutableDataContainer.h.
| typedef BASE::TYPE TileMutableDataContainer< BASE_T >::TYPE |
Definition at line 53 of file TileMutableDataContainer.h.
| typedef BASE::UNIT TileMutableDataContainer< BASE_T >::UNIT |
Definition at line 54 of file TileMutableDataContainer.h.
| TileMutableDataContainer< BASE_T >::TileMutableDataContainer | ( | bool | createColl = false, |
| TYPE | type = TileFragHash::Default, | ||
| UNIT | unit = TileRawChannelUnit::ADCcounts, | ||
| SG::OwnershipPolicy | ownPolicy = SG::OWN_ELEMENTS ) |
Constructor.
| createColl | If true, create all collections now. |
| type | Hash type (from TileFragHash::TYPE). |
| unit | Measurement units for amplitude data. |
| ownPolicy | Ownership mode for collections. |
Call status() after this to check for errors.
| TileMutableDataContainer< BASE_T >::TileMutableDataContainer | ( | const BASE & | other | ) |
|
delete |
| StatusCode TileMutableDataContainer< BASE_T >::addCollection | ( | std::unique_ptr< Collection > | coll, |
| IdentifierHash | hash ) |
Add a collection to the container.
| coll | Collection ot add. |
| hash | Hash value for the collection. |
We maintain a non-const reference to the collection.
| Collection * TileMutableDataContainer< BASE_T >::indexFindPtr | ( | IdentifierHash | hash | ) |
Look up a (non-const) collection via hash.
| hash | Hash value to find. |
|
overridevirtual |
|
delete |
| StatusCode TileMutableDataContainer< BASE_T >::push_back | ( | Element * | rch | ) |
Add a new channel.
| rch | Channel to add. |
This should be used for non-owning container (created with SG::VIEW_ELEMENTS). A new collection will be created if needed. In that case, we maintain a non-const reference to it.
| StatusCode TileMutableDataContainer< BASE_T >::push_back | ( | std::unique_ptr< Element > | rch | ) |
Add a new channel.
| rch | Channel to add. |
This should be used for owning container (created with SG::OWN_ELEMENTS). A new collection will be created if needed. In that case, we maintain a non-const reference to it.
|
protected |
Recycle this object for use in another event.
This is called from AthenaKernel/RecyclableDataObject when this object is released by StoreGate. Unlock the object so that non-const access is again possible, and clear out the contents if the collections.
| StatusCode TileMutableDataContainer< BASE_T >::status | ( | ) | const |
Return the error status from the constructors.
|
private |
Default type; reset to this on recycle.
Definition at line 174 of file TileMutableDataContainer.h.
|
private |
Default unit; reset to this on recycle.
Definition at line 177 of file TileMutableDataContainer.h.
|
private |
Is the container locked?
Definition at line 168 of file TileMutableDataContainer.h.
|
private |
Non-const references to collections, indexed by hash value.
Definition at line 165 of file TileMutableDataContainer.h.
|
private |
StatusCode from constructors.
Definition at line 171 of file TileMutableDataContainer.h.