The Gaudi Framework  v31r0 (aeb156f0)
EventSlot Struct Reference

Class representing an event slot. More...

#include <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 14 of file EventSlot.h.

Constructor & Destructor Documentation

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 ){};
std::vector< int > controlFlowState
State of the control flow.
Definition: EventSlot.h:77
AlgsExecutionStates algsStates
Vector of algorithms states.
Definition: EventSlot.h:75
EventSlot::EventSlot ( const EventSlot )
delete

Copy constructor.

EventSlot::EventSlot ( EventSlot &&  )
default

Move constructor.

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

Member Function Documentation

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  }
T forward_as_tuple(T...args)
std::vector< EventSlot > allSubSlots
Actual sub-slot instances.
Definition: EventSlot.h:90
void push_back(Container &c, const Value &v, std::true_type)
void setSubSlot(const ContextID_t subslot)
Definition: EventContext.h:72
T move(T...args)
T find(T...args)
T size(T...args)
T emplace(T...args)
T search(T...args)
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
T emplace_back(T...args)
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  }
T forward_as_tuple(T...args)
T emplace(T...args)
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& EventSlot::operator= ( const EventSlot )
delete

Assignment operator.

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

Move assignment.

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();
43  complete = false;
44  entryPoint.clear();
45  parentSlot = nullptr;
48  };
std::string entryPoint
Event Views bookkeeping (TODO: optimize view bookkeeping)
Definition: EventSlot.h:84
std::vector< int > controlFlowState
State of the control flow.
Definition: EventSlot.h:77
std::vector< EventSlot > allSubSlots
Actual sub-slot instances.
Definition: EventSlot.h:90
T reset(T...args)
T clear(T...args)
T size(T...args)
T assign(T...args)
EventSlot * parentSlot
Pointer to parent slot (null for top level)
Definition: EventSlot.h:86
bool complete
Flags completion of the event.
Definition: EventSlot.h:79
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::unique_ptr< EventContext > eventContext
Cache for the eventContext.
Definition: EventSlot.h:73
AlgsExecutionStates algsStates
Vector of algorithms states.
Definition: EventSlot.h:75

Member Data Documentation

AlgsExecutionStates EventSlot::algsStates

Vector of algorithms states.

Definition at line 75 of file EventSlot.h.

std::vector<EventSlot> EventSlot::allSubSlots

Actual sub-slot instances.

Definition at line 90 of file EventSlot.h.

bool EventSlot::complete = false

Flags completion of the event.

Definition at line 79 of file EventSlot.h.

std::vector<int> EventSlot::controlFlowState

State of the control flow.

Definition at line 77 of file EventSlot.h.

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.

std::unique_ptr<EventContext> EventSlot::eventContext

Cache for the eventContext.

Definition at line 73 of file EventSlot.h.

EventSlot* EventSlot::parentSlot = nullptr

Pointer to parent slot (null for top level)

Definition at line 86 of file EventSlot.h.

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: