fesaGSI::TimingSimulationEventSource Class Reference

This class extends the AbstractEventSource to return RTEvents according to the simulation sequence specified in the Timing-Simulation configuration document. More...

#include <TimingSimulationEventSource.h>

List of all members.

Classes

class  SimulationEvent
 This is the list-object of the linked list used in the TimingSimulationEventSource. The linked list stores the complete sequence of events on which the TimingSimulationEventSource is iterating. More...

Public Member Functions

 TimingSimulationEventSource (const std::string &name, const std::string &timingSimulationConfigFile, fesa::EventSourceType type)
 constructor
 ~TimingSimulationEventSource ()
 destructor
fesa::RTEvent * wait ()
 This method gets stuck, until a internal timer generates and returns the next RTEvent from the linked list of EventElements.
void connect (boost::shared_ptr< fesa::EventElement > &eventElement)
 In this method we check, if the event, to which a FESA-class wants to connect exists in our configuration. If yes, we link the classname to the event. Later the event will be fired once per connected class.

Private Member Functions

void buildEventSequence ()
 this method builds the event simulation sequence according to the specification in the timing configuration file
void checkTimingSimulationConfig ()
 this method checks if the provided configuration is valid
void fillEventCollection ()
 this method fills the acceptedEventsCol_
void insertSorted (SimulationEvent *newEvent)
 This method inserts the newEvent and sorts it into the linked list, according to its offset.
void computeDelays ()
 compute the delays for each event after having built the entire sequence
void computeSuperCycleLength ()
 computes the leangth of the supercycle in ms
void createSimulationEvent (EventConfig *config, long absStartCycleOffset, CycleConfig &cycle, DomainConfig *domain)
 This method creates and inserts a new simulation event using the information from the event passed by parameter.

Private Attributes

TimingSimulationConfigtimingConfiguration_
 the configuration, read out from an XML file
SimulationEventsimulationEventSequence_
 the event sequence as linked list. Thats the hearth of this class
SimulationEventcurrentEvent_
 The event which is currently processed (has to be on class-scope, since wait() returns.
int superCycleCount_
 decreasing number. Is filled with the number of supercycles to play. The TimingSimulation event source will stop when 0 is reached (or run for infinite time in case of -1)
long superCycleLength_
 the length of the supercycle in ms
std::map< std::string,
std::vector< std::string > > 
eventClassRelationCol_
 map<[event],vector<[class]> > stores all events which are provided by the TimingSimulation Config file and all FWK classes which did a "connect" to these events
bool eventSequenceBuild_
 indicates if the event sequence was already build.

Detailed Description

This class extends the AbstractEventSource to return RTEvents according to the simulation sequence specified in the Timing-Simulation configuration document.

Definition at line 23 of file TimingSimulationEventSource.h.


Constructor & Destructor Documentation

fesaGSI::TimingSimulationEventSource::TimingSimulationEventSource ( const std::string &  name,
const std::string &  timingSimulationConfigFile,
fesa::EventSourceType  type 
)

constructor

Parameters:
name The unique name of the eventsource
timingSimulationConfigFile The configuration file, used for this event source
type The type of this event source

Definition at line 56 of file TimingSimulationEventSource.cpp.

References eventSequenceBuild_, fillEventCollection(), simulationEventSequence_, and timingConfiguration_.

fesaGSI::TimingSimulationEventSource::~TimingSimulationEventSource (  ) 

Member Function Documentation

void fesaGSI::TimingSimulationEventSource::buildEventSequence (  )  [private]
void fesaGSI::TimingSimulationEventSource::checkTimingSimulationConfig (  )  [private]
void fesaGSI::TimingSimulationEventSource::computeDelays (  )  [private]
void fesaGSI::TimingSimulationEventSource::computeSuperCycleLength (  )  [private]
void fesaGSI::TimingSimulationEventSource::connect ( boost::shared_ptr< fesa::EventElement > &  eventElement  ) 

In this method we check, if the event, to which a FESA-class wants to connect exists in our configuration. If yes, we link the classname to the event. Later the event will be fired once per connected class.

Parameters:
The event element, to which FESA wants to connect

Definition at line 172 of file TimingSimulationEventSource.cpp.

References eventClassRelationCol_, and FesaGSIMissingEventConfiguration.

void fesaGSI::TimingSimulationEventSource::createSimulationEvent ( EventConfig config,
long  absStartCycleOffset,
CycleConfig cycle,
DomainConfig domain 
) [private]

This method creates and inserts a new simulation event using the information from the event passed by parameter.

Parameters:
config the configuration of the new event
absStartCycleOffset The offset-time (in ms), when the related cycle "cycle" starts
cycle Link to the cycle configuration of this event
domain Link to the domain configuration of this event

Definition at line 367 of file TimingSimulationEventSource.cpp.

References fesaGSI::EventConfig::delay_, fesaGSI::EventBurst, eventClassRelationCol_, fesaGSI::EventConfig::eventName_, insertSorted(), fesaGSI::EventBurstConfig::occurrences_, fesaGSI::EventBurstConfig::period_, superCycleLength_, and fesaGSI::EventConfig::type_.

Referenced by buildEventSequence().

void fesaGSI::TimingSimulationEventSource::fillEventCollection (  )  [private]

this method fills the acceptedEventsCol_

Definition at line 148 of file TimingSimulationEventSource.cpp.

References eventClassRelationCol_, timingConfiguration_, and fesaGSI::TimingSimulationConfig::timingDomainCol_.

Referenced by TimingSimulationEventSource().

void fesaGSI::TimingSimulationEventSource::insertSorted ( SimulationEvent newEvent  )  [private]

This method inserts the newEvent and sorts it into the linked list, according to its offset.

Parameters:
newEvent The event to be inserted

Definition at line 234 of file TimingSimulationEventSource.cpp.

References fesaGSI::TimingSimulationEventSource::SimulationEvent::absOffset_, fesaGSI::TimingSimulationEventSource::SimulationEvent::nextEvent_, and simulationEventSequence_.

Referenced by createSimulationEvent().

fesa::RTEvent * fesaGSI::TimingSimulationEventSource::wait (  ) 

Member Data Documentation

The event which is currently processed (has to be on class-scope, since wait() returns.

Definition at line 150 of file TimingSimulationEventSource.h.

Referenced by wait().

std::map<std::string,std::vector<std::string> > fesaGSI::TimingSimulationEventSource::eventClassRelationCol_ [private]

map<[event],vector<[class]> > stores all events which are provided by the TimingSimulation Config file and all FWK classes which did a "connect" to these events

Definition at line 166 of file TimingSimulationEventSource.h.

Referenced by connect(), createSimulationEvent(), and fillEventCollection().

indicates if the event sequence was already build.

Definition at line 171 of file TimingSimulationEventSource.h.

Referenced by buildEventSequence(), TimingSimulationEventSource(), and wait().

the event sequence as linked list. Thats the hearth of this class

Definition at line 145 of file TimingSimulationEventSource.h.

Referenced by computeDelays(), insertSorted(), TimingSimulationEventSource(), wait(), and ~TimingSimulationEventSource().

decreasing number. Is filled with the number of supercycles to play. The TimingSimulation event source will stop when 0 is reached (or run for infinite time in case of -1)

Definition at line 156 of file TimingSimulationEventSource.h.

Referenced by wait().

the length of the supercycle in ms

Definition at line 161 of file TimingSimulationEventSource.h.

Referenced by buildEventSequence(), checkTimingSimulationConfig(), computeSuperCycleLength(), and createSimulationEvent().


The documentation for this class was generated from the following files:

Generated on 25 Jan 2013 for fesa-core-gsi by  doxygen 1.6.1