The Gaudi Framework  master (37c0b60a)
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. More...
 
 EventSlot (const EventSlot &)=delete
 Copy constructor. More...
 
EventSlotoperator= (const EventSlot &)=delete
 Assignment operator. More...
 
 EventSlot (EventSlot &&)=default
 Move constructor. More...
 
EventSlotoperator= (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< EventContexteventContext
 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...
 
EventSlotparentSlot = 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< EventSlotallSubSlots
 Actual sub-slot instances. More...
 

Detailed Description

Class representing an event slot.

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

27  : algsStates( numberOfAlgorithms, MS ), controlFlowState( numberOfControlFlowNodes, -1 ) {}

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

40  : eventContext( std::move( theeventContext ) )
41  , algsStates( original.algsStates )
43  , entryPoint( nodeName )
44  , parentSlot( &original ) {
45  algsStates.reset();
46  }

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

61  {
62  unsigned int lastIndex = allSubSlots.size();
63 
64  auto search = subSlotsByNode.find( nodeName );
65  if ( search != subSlotsByNode.end() )
66  subSlotsByNode[nodeName].push_back( lastIndex );
67  else
68  subSlotsByNode.emplace( std::piecewise_construct, std::forward_as_tuple( nodeName ),
69  std::forward_as_tuple( 1, lastIndex ) );
70 
71  // Make new slot and nest it into the top slot
72  viewContext->setSubSlot( lastIndex );
73  allSubSlots.emplace_back( *this, std::move( viewContext ), nodeName );
74  }

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

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

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

49  {
50  eventContext.reset( theeventContext );
51  algsStates.reset();
53  complete = false;
54  entryPoint.clear();
55  parentSlot = nullptr;
58  }

Member Data Documentation

◆ algsStates

AlgsExecutionStates EventSlot::algsStates

Vector of algorithms states.

Definition at line 85 of file EventSlot.h.

◆ allSubSlots

std::vector<EventSlot> EventSlot::allSubSlots

Actual sub-slot instances.

Definition at line 100 of file EventSlot.h.

◆ complete

bool EventSlot::complete = false

Flags completion of the event.

Definition at line 89 of file EventSlot.h.

◆ controlFlowState

std::vector<int> EventSlot::controlFlowState

State of the control flow.

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

◆ eventContext

std::unique_ptr<EventContext> EventSlot::eventContext

Cache for the eventContext.

Definition at line 83 of file EventSlot.h.

◆ parentSlot

EventSlot* EventSlot::parentSlot = nullptr

Pointer to parent slot (null for top level)

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


The documentation for this struct was generated from the following file:
EventSlot::eventContext
std::unique_ptr< EventContext > eventContext
Cache for the eventContext.
Definition: EventSlot.h:83
std::move
T move(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:98
EventContext::setSubSlot
void setSubSlot(const ContextID_t subslot)
Definition: EventContext.h:75
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)
std::unique_ptr::reset
T reset(T... args)
std::string::clear
T clear(T... args)
EventSlot::entryPoint
std::string entryPoint
Event Views bookkeeping (TODO: optimize view bookkeeping)
Definition: EventSlot.h:94
EventSlot::complete
bool complete
Flags completion of the event.
Definition: EventSlot.h:89
EventSlot::parentSlot
EventSlot * parentSlot
Pointer to parent slot (null for top level)
Definition: EventSlot.h:96
EventSlot::allSubSlots
std::vector< EventSlot > allSubSlots
Actual sub-slot instances.
Definition: EventSlot.h:100
AlgsExecutionStates::reset
void reset()
Definition: AlgsExecutionStates.h:63
std::forward_as_tuple
T forward_as_tuple(T... args)
std::vector::emplace_back
T emplace_back(T... args)
std::vector::assign
T assign(T... args)
EventSlot::controlFlowState
std::vector< int > controlFlowState
State of the control flow.
Definition: EventSlot.h:87
std::unordered_map::end
T end(T... args)
EventSlot::algsStates
AlgsExecutionStates algsStates
Vector of algorithms states.
Definition: EventSlot.h:85