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

Class representing an event slot. More...

#include <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.
EventSlot & operator= (const EventSlot &)=delete
 Assignment operator.
 EventSlot (EventSlot &&)=default
 Move constructor.
EventSlot & operator= (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< EventContext > eventContext
 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).
EventSlot * parentSlot = 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< EventSlot > allSubSlots
 Actual sub-slot instances.

Detailed Description

Class representing an event slot.

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

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

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

44 : eventContext( std::move( theeventContext ) )
45 , algsStates( original.algsStates )
47 , entryPoint( nodeName )
48 , parentSlot( &original ) {
50 }
constexpr _OI move(_II __first, _II __last, _OI __result)
std::unique_ptr< EventContext > eventContext
Cache for the eventContext.
Definition EventSlot.h:87
EventSlot * parentSlot
Pointer to parent slot (null for top level).
Definition EventSlot.h:100
std::string entryPoint
Event Views bookkeeping (TODO: optimize view bookkeeping).
Definition EventSlot.h:98

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

65 {
66 unsigned int lastIndex = allSubSlots.size();
67
68 const auto search = subSlotsByNode.find( nodeName );
69 if ( search != subSlotsByNode.end() )
70 search->second.push_back( lastIndex );
71 else
73 std::forward_as_tuple( 1, lastIndex ) );
74
75 // Make new slot and nest it into the top slot
76 viewContext->setSubSlot( lastIndex );
77 allSubSlots.emplace_back( *this, std::move( viewContext ), nodeName );
78 }
constexpr tuple< _Elements &&... > forward_as_tuple(_Elements &&... __args) noexcept
constexpr piecewise_construct_t piecewise_construct
constexpr _ForwardIterator search(_ForwardIterator __first, _ForwardIterator __last, const _Searcher &__searcher)
constexpr size_type size() const noexcept
iterator end() noexcept
std::pair< iterator, bool > emplace(_Args &&... __args)
iterator find(const key_type &__x)
std::vector< EventSlot > allSubSlots
Actual sub-slot instances.
Definition EventSlot.h:104
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:102

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

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

53 {
54 eventContext.reset( theeventContext );
57 complete = false;
59 parentSlot = nullptr;
62 }
void clear() noexcept
constexpr void assign(_InputIterator __first, _InputIterator __last)
constexpr void clear() noexcept
constexpr void reset(pointer __p=pointer()) noexcept
void clear() noexcept
bool complete
Flags completion of the event.
Definition EventSlot.h:93

Member Data Documentation

◆ algsStates

AlgsExecutionStates EventSlot::algsStates

Vector of algorithms states.

Definition at line 89 of file EventSlot.h.

◆ allSubSlots

std::vector<EventSlot> EventSlot::allSubSlots

Actual sub-slot instances.

Definition at line 104 of file EventSlot.h.

◆ complete

bool EventSlot::complete = false

Flags completion of the event.

Definition at line 93 of file EventSlot.h.

◆ controlFlowState

std::vector<int> EventSlot::controlFlowState

State of the control flow.

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

◆ eventContext

std::unique_ptr<EventContext> EventSlot::eventContext

Cache for the eventContext.

Definition at line 87 of file EventSlot.h.

◆ parentSlot

EventSlot* EventSlot::parentSlot = nullptr

Pointer to parent slot (null for top level).

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


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