![]() |
ATLAS Offline Software
|
Auxiliary class to instantiate WriteDecorHandles.The handles can be created in an empty state. More...
#include <ContainerDecorator.h>
Public Types | |
| using | Handle_t = SG::WriteDecorHandle<Cont_t, dType> |
Public Member Functions | |
| ContainerDecorator ()=default | |
| Empty default constructor. | |
| ContainerDecorator (const SG::WriteDecorHandleKey< Cont_t > &key, const EventContext &ctx, dType defValue={}) | |
| Construct the decorator with an initialized decorHandleKey, and the current EventContext. | |
| ~ContainerDecorator () | |
| Destructor. | |
| ContainerDecorator (ContainerDecorator &&other)=default | |
| Default move constructor. | |
| ContainerDecorator & | operator= (ContainerDecorator &&other)=default |
| Default move assignment operator. | |
| void | initialize (const SG::WriteDecorHandleKey< Cont_t > &key, const EventContext &ctx, dType defValue={}) |
| Instantiate the handle. | |
| dType & | operator() (const SG::AuxElement &auxElem) |
| Access the decoration value. | |
| constexpr bool | isValid () const |
| Returns whether the handle is instantiated. | |
| constexpr | operator bool () const |
| Returns whether the handle is instantiated. | |
| const Cont_t * | container () const |
| Returns the underlying container. | |
| const Cont_t * | operator-> () const |
| Returns the pointer to the underlying container. | |
Private Member Functions | |
| void | initDefault () |
| Decorate the default value to all elements in the container. | |
Private Attributes | |
| std::unique_ptr< Handle_t > | m_decorHandle {} |
| std::unordered_set< const SG::AuxElement * > | m_seenAux {} |
| dType | m_defValue {} |
Auxiliary class to instantiate WriteDecorHandles.The handles can be created in an empty state.
Once initialized, a default value is decorated to all objects in the container to ensure that the decoration is always set.
Definition at line 18 of file ContainerDecorator.h.
| using xAOD::ContainerDecorator< Cont_t, dType >::Handle_t = SG::WriteDecorHandle<Cont_t, dType> |
Definition at line 20 of file ContainerDecorator.h.
|
explicitdefault |
Empty default constructor.
|
inlineexplicit |
Construct the decorator with an initialized decorHandleKey, and the current EventContext.
| key | The initialized decorHandleKey with which the decorator is instantitated |
| ctx | EventContext to gain access to the underlying continer |
| defValue | Default value to be decorated onto the entire container at instantiation |
Definition at line 30 of file ContainerDecorator.h.
|
inline |
Destructor.
Definition at line 36 of file ContainerDecorator.h.
|
default |
Default move constructor.
|
inline |
Returns the underlying container.
Definition at line 76 of file ContainerDecorator.h.
|
inlineprivate |
Decorate the default value to all elements in the container.
Definition at line 81 of file ContainerDecorator.h.
|
inline |
Instantiate the handle.
| key | WriteDecorationKey to be used |
| ctx | The current event context |
| defValue | Default value to be used for all objects |
Definition at line 48 of file ContainerDecorator.h.
|
inlineconstexpr |
|
inlineconstexpr |
|
inline |
|
inline |
Returns the pointer to the underlying container.
Definition at line 78 of file ContainerDecorator.h.
|
default |
Default move assignment operator.
|
private |
Definition at line 94 of file ContainerDecorator.h.
|
private |
Definition at line 96 of file ContainerDecorator.h.
|
private |
Definition at line 95 of file ContainerDecorator.h.