The Gaudi Framework  master (ff829712)
Loading...
Searching...
No Matches
EventSlot Struct Reference

Class representing an event slot. More...

#include </builds/gaudi/Gaudi/GaudiHive/src/EventSlot.h>

Collaboration diagram for EventSlot:

Public Member Functions

 EventSlot (unsigned int numberOfAlgorithms, unsigned int numberOfControlFlowNodes, SmartIF< IMessageSvc > MS)
 Construct a slot.
 
 EventSlot (const EventSlot &)=delete
 Copy constructor.
 
EventSlotoperator= (const EventSlot &)=delete
 Assignment operator.
 
 EventSlot (EventSlot &&)=default
 Move constructor.
 
EventSlotoperator= (EventSlot &&)=default
 Move assignment.
 
 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.
 
void reset (EventContext *theeventContext)
 Reset all resources in order to reuse the slot (thread-unsafe)
 
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)
 
void disableSubSlots (const std::string &nodeName)
 Disable event views for a given CF view node by registering an empty container Contact B.
 

Public Attributes

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

Detailed Description

Class representing an event slot.

Definition at line 23 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 25 of file EventSlot.h.

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

◆ 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 38 of file EventSlot.h.

39 : eventContext( std::move( theeventContext ) )
40 , algsStates( original.algsStates )
42 , entryPoint( nodeName )
43 , parentSlot( &original ) {
44 algsStates.reset();
45 }
std::unique_ptr< EventContext > eventContext
Cache for the eventContext.
Definition EventSlot.h:82
EventSlot * parentSlot
Pointer to parent slot (null for top level)
Definition EventSlot.h:95
std::string entryPoint
Event Views bookkeeping (TODO: optimize view bookkeeping)
Definition EventSlot.h:93

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 60 of file EventSlot.h.

60 {
61 unsigned int lastIndex = allSubSlots.size();
62
63 auto search = subSlotsByNode.find( nodeName );
64 if ( search != subSlotsByNode.end() )
65 subSlotsByNode[nodeName].push_back( lastIndex );
66 else
67 subSlotsByNode.emplace( std::piecewise_construct, std::forward_as_tuple( nodeName ),
68 std::forward_as_tuple( 1, lastIndex ) );
69
70 // Make new slot and nest it into the top slot
71 viewContext->setSubSlot( lastIndex );
72 allSubSlots.emplace_back( *this, std::move( viewContext ), nodeName );
73 }
void setSubSlot(const ContextID_t subslot)
std::vector< EventSlot > allSubSlots
Actual sub-slot instances.
Definition EventSlot.h:99
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:97

◆ 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 77 of file EventSlot.h.

77 {
78 subSlotsByNode.emplace( std::piecewise_construct, std::forward_as_tuple( nodeName ), std::forward_as_tuple() );
79 }

◆ 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 48 of file EventSlot.h.

48 {
49 eventContext.reset( theeventContext );
50 algsStates.reset();
51 controlFlowState.assign( controlFlowState.size(), -1 );
52 complete = false;
53 entryPoint.clear();
54 parentSlot = nullptr;
55 subSlotsByNode.clear();
56 allSubSlots.clear();
57 }
bool complete
Flags completion of the event.
Definition EventSlot.h:88

Member Data Documentation

◆ algsStates

AlgsExecutionStates EventSlot::algsStates

Vector of algorithms states.

Definition at line 84 of file EventSlot.h.

◆ allSubSlots

std::vector<EventSlot> EventSlot::allSubSlots

Actual sub-slot instances.

Definition at line 99 of file EventSlot.h.

◆ complete

bool EventSlot::complete = false

Flags completion of the event.

Definition at line 88 of file EventSlot.h.

◆ controlFlowState

std::vector<int> EventSlot::controlFlowState

State of the control flow.

Definition at line 86 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 93 of file EventSlot.h.

◆ eventContext

std::unique_ptr<EventContext> EventSlot::eventContext

Cache for the eventContext.

Definition at line 82 of file EventSlot.h.

◆ parentSlot

EventSlot* EventSlot::parentSlot = nullptr

Pointer to parent slot (null for top level)

Definition at line 95 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 97 of file EventSlot.h.


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