| The Gaudi Framework v32r1 (f65d50dc)

Public Member Functions | Public Attributes | List of all members
EventSlot Struct Reference

Class representing an event slot. More...

`#include <src/EventSlot.h>`

Collaboration diagram for EventSlot:
[legend]

## Public Member Functions
| EventSlot (unsigned int numberOfAlgorithms, unsigned int numberOfControlFlowNodes, SmartIF< IMessageSvc > MS)
| Construct a slot. More...
| EventSlot (const EventSlot &)=delete
| Copy constructor. More...
EventSlot & | operator= (const EventSlot &)=delete
| Assignment operator. More...
| EventSlot (EventSlot &&)=default
| Move constructor. More...
EventSlot & | operator= (EventSlot &&)=default
| Move assignment. More...
| EventSlot (EventSlot &original, std::unique_ptr< EventContext > theeventContext, const std::string &nodeName)
| Construct a (sub)slot, nested to 'original' parent slot, with CF states copied from the parent. More...
void | reset (EventContext *theeventContext)
| Reset all resources in order to reuse the slot (thread-unsafe) More...
void | addSubSlot (std::unique_ptr< EventContext > viewContext, const std::string &nodeName)
| Add a subslot to the slot (this constructs a new slot and registers it with the parent one) More...
void | disableSubSlots (const std::string &nodeName)
| Disable event views for a given CF view node by registering an empty container Contact B. More...

## Public Attributes
std::unique_ptr< EventContext > | eventContext
| Cache for the eventContext. More...
AlgsExecutionStates | algsStates
| Vector of algorithms states. More...
std::vector< int > | controlFlowState
| State of the control flow. More...
bool | complete = false
| Flags completion of the event. More...
std::string | entryPoint
| Event Views bookkeeping (TODO: optimize view bookkeeping) More...
EventSlot * | parentSlot = nullptr
| Pointer to parent slot (null for top level) More...
std::unordered_map< std::string, std::vector< unsigned int > > | subSlotsByNode
| Listing of sub-slots by the node (name) they are attached to. More...
std::vector< EventSlot > | allSubSlots
| Actual sub-slot instances. More...

## Detailed Description

Class representing an event slot.

Definition at line 14 of file EventSlot.h.

## Constructor & Destructor Documentation

## ◆ EventSlot() [1/4]

EventSlot::EventSlot | ( | unsigned int | numberOfAlgorithms,
|  | unsigned int | numberOfControlFlowNodes,
|  | SmartIF< IMessageSvc > | MS
| ) |  |
| inline

Construct a slot.

Definition at line 16 of file EventSlot.h.

17 : algsStates( numberOfAlgorithms, MS ), controlFlowState( numberOfControlFlowNodes, -1 ){};
EventSlot::controlFlowState
std::vector< int > controlFlowState
State of the control flow.
Definition: EventSlot.h:77
EventSlot::algsStates
AlgsExecutionStates algsStates
Vector of algorithms states.
Definition: EventSlot.h:75

## ◆ EventSlot() [2/4]

EventSlot::EventSlot | ( | const EventSlot & |  | ) |
| delete

Copy constructor.

## ◆ EventSlot() [3/4]

EventSlot::EventSlot | ( | EventSlot && |  | ) |
| default

Move constructor.

## ◆ EventSlot() [4/4]

EventSlot::EventSlot | ( | EventSlot & | original,
|  | std::unique_ptr< EventContext > | theeventContext,
|  | const std::string & | nodeName
| ) |  |
| inline

Construct a (sub)slot, nested to 'original' parent slot, with CF states copied from the parent.

Definition at line 29 of file EventSlot.h.

30 : eventContext( std::move( theeventContext ) )
31 , algsStates( original.algsStates )
32 , controlFlowState( original.controlFlowState )
33 , entryPoint( nodeName )
34 , parentSlot( &original ) {
35 algsStates.reset();
36 };
EventSlot::entryPoint
std::string entryPoint
Event Views bookkeeping (TODO: optimize view bookkeeping)
Definition: EventSlot.h:84
EventSlot::controlFlowState
std::vector< int > controlFlowState
State of the control flow.
Definition: EventSlot.h:77
std::move
T move(T... args)
AlgsExecutionStates::reset
void reset()
Definition: AlgsExecutionStates.h:44
EventSlot::parentSlot
EventSlot * parentSlot
Pointer to parent slot (null for top level)
Definition: EventSlot.h:86
EventSlot::eventContext
std::unique_ptr< EventContext > eventContext
Cache for the eventContext.
Definition: EventSlot.h:73
EventSlot::algsStates
AlgsExecutionStates algsStates
Vector of algorithms states.
Definition: EventSlot.h:75

## Member Function Documentation

## ◆ addSubSlot()

void EventSlot::addSubSlot | ( | std::unique_ptr< EventContext > | viewContext,
|  | const std::string & | nodeName
| ) |  |
| inline

Add a subslot to the slot (this constructs a new slot and registers it with the parent one)

Definition at line 51 of file EventSlot.h.

51 {
52 unsigned int lastIndex = allSubSlots.size();
53
54 auto search = subSlotsByNode.find( nodeName );
55 if ( search != subSlotsByNode.end() )
56 subSlotsByNode[nodeName].push_back( lastIndex );
57 else
58 subSlotsByNode.emplace( std::piecewise_construct, std::forward_as_tuple( nodeName ),
59 std::forward_as_tuple( 1, lastIndex ) );
60
61 // Make new slot and nest it into the top slot
62 viewContext->setSubSlot( lastIndex );
63 allSubSlots.emplace_back( *this, std::move( viewContext ), nodeName );
64 }
std::forward_as_tuple
T forward_as_tuple(T... args)
std::unordered_map::end
T end(T... args)
EventSlot::allSubSlots
std::vector< EventSlot > allSubSlots
Actual sub-slot instances.
Definition: EventSlot.h:90
Gaudi::Functional::details::details2::push_back
void push_back(Container &c, const Value &v, std::true_type)
Definition: FunctionalDetails.h:184
EventContext::setSubSlot
void setSubSlot(const ContextID_t subslot)
Definition: EventContext.h:65
std::move
T move(T... args)
std::unordered_map::find
T find(T... args)
std::vector::size
T size(T... args)
std::unordered_map::emplace
T emplace(T... args)
std::search
T search(T... args)
EventSlot::subSlotsByNode
std::unordered_map< std::string, std::vector< unsigned int > > subSlotsByNode
Listing of sub-slots by the node (name) they are attached to.
Definition: EventSlot.h:88
std::vector::emplace_back
T emplace_back(T... args)

## ◆ disableSubSlots()

void EventSlot::disableSubSlots | ( | const std::string & | nodeName | ) |
| inline

Disable event views for a given CF view node by registering an empty container Contact B.

W. Wynne for more details on the reasoning about this design choice

Definition at line 68 of file EventSlot.h.

68 {
69 subSlotsByNode.emplace( std::piecewise_construct, std::forward_as_tuple( nodeName ), std::forward_as_tuple() );
70 }
std::forward_as_tuple
T forward_as_tuple(T... args)
std::unordered_map::emplace
T emplace(T... args)
EventSlot::subSlotsByNode
std::unordered_map< std::string, std::vector< unsigned int > > subSlotsByNode
Listing of sub-slots by the node (name) they are attached to.
Definition: EventSlot.h:88

## ◆ operator=() [1/2]

EventSlot& EventSlot::operator= | ( | const EventSlot & |  | ) |
| delete

Assignment operator.

## ◆ operator=() [2/2]

EventSlot& EventSlot::operator= | ( | EventSlot && |  | ) |
| default

Move assignment.

## ◆ reset()

void EventSlot::reset | ( | EventContext * | theeventContext | ) |
| inline

Reset all resources in order to reuse the slot (thread-unsafe)

Definition at line 39 of file EventSlot.h.

39 {
40 eventContext.reset( theeventContext );
41 algsStates.reset();
42 controlFlowState.assign( controlFlowState.size(), -1 );
43 complete = false;
44 entryPoint.clear();
45 parentSlot = nullptr;
46 subSlotsByNode.clear();
47 allSubSlots.clear();
48 };
EventSlot::entryPoint
std::string entryPoint
Event Views bookkeeping (TODO: optimize view bookkeeping)
Definition: EventSlot.h:84
EventSlot::controlFlowState
std::vector< int > controlFlowState
State of the control flow.
Definition: EventSlot.h:77
EventSlot::allSubSlots
std::vector< EventSlot > allSubSlots
Actual sub-slot instances.
Definition: EventSlot.h:90
std::unique_ptr::reset
T reset(T... args)
std::string::clear
T clear(T... args)
std::vector::size
T size(T... args)
std::vector::assign
T assign(T... args)
AlgsExecutionStates::reset
void reset()
Definition: AlgsExecutionStates.h:44
EventSlot::parentSlot
EventSlot * parentSlot
Pointer to parent slot (null for top level)
Definition: EventSlot.h:86
EventSlot::complete
bool complete
Flags completion of the event.
Definition: EventSlot.h:79
EventSlot::subSlotsByNode
std::unordered_map< std::string, std::vector< unsigned int > > subSlotsByNode
Listing of sub-slots by the node (name) they are attached to.
Definition: EventSlot.h:88
EventSlot::eventContext
std::unique_ptr< EventContext > eventContext
Cache for the eventContext.
Definition: EventSlot.h:73
EventSlot::algsStates
AlgsExecutionStates algsStates
Vector of algorithms states.
Definition: EventSlot.h:75

## Member Data Documentation

## ◆ algsStates

AlgsExecutionStates EventSlot::algsStates

Vector of algorithms states.

Definition at line 75 of file EventSlot.h.

## ◆ allSubSlots

std::vector<EventSlot> EventSlot::allSubSlots

Actual sub-slot instances.

Definition at line 90 of file EventSlot.h.

## ◆ complete

bool EventSlot::complete = false

Flags completion of the event.

Definition at line 79 of file EventSlot.h.

## ◆ controlFlowState

std::vector<int> EventSlot::controlFlowState

State of the control flow.

Definition at line 77 of file EventSlot.h.

## ◆ entryPoint

std::string EventSlot::entryPoint

Event Views bookkeeping (TODO: optimize view bookkeeping)

Name of the node this slot is attached to ("" for top level)

Definition at line 84 of file EventSlot.h.

## ◆ eventContext

std::unique_ptr<EventContext> EventSlot::eventContext

Cache for the eventContext.

Definition at line 73 of file EventSlot.h.

## ◆ parentSlot

EventSlot* EventSlot::parentSlot = nullptr

Pointer to parent slot (null for top level)

Definition at line 86 of file EventSlot.h.

## ◆ subSlotsByNode

std::unordered_map<std::string, std::vector<unsigned int> > EventSlot::subSlotsByNode

Listing of sub-slots by the node (name) they are attached to.

Definition at line 88 of file EventSlot.h.

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

- GaudiHive/src/EventSlot.h