The Sparta Modeling Framework
Loading...
Searching...
No Matches
sparta::StartupEvent Class Reference

StartupEvent is a simple class for scheduling a starting event on the Scheduler. It does not support precedence. More...

#include <StartupEvent.hpp>

Public Member Functions

 StartupEvent (TreeNode *node, const SpartaHandler &consumer_startupevent_handler)
 Create and schedule a StartupEvent with the given handler.
 

Friends

class trigger::CycleTrigger
 
class trigger::TimeTrigger
 
class trigger::CounterTrigger
 
class trigger::ManagedTrigger
 

Detailed Description

StartupEvent is a simple class for scheduling a starting event on the Scheduler. It does not support precedence.

The purpose of this class is for a user to create a StartupEvent and place a given handler on the sparta Scheduler to be called before simulation starts. This is required since a modeler cannot schedule any events during resource construction – the Scheduler's internal graphs have not been finalized.

Note
This class can only be created in pre-finalized state.

Example usage:

MyResource::MyResource(TreeNode * node, MyResourceParams * params) :
// ...
{
// ... other stuff
// Set a startup event
sparta::StartupEvent(node, CREATE_SPARTA_HANDLER(MyResource, myStartUpFunction));
}
void MyResource::myStartUpFunction()
{
my_unique_tick_event_.schedule();
}
#define CREATE_SPARTA_HANDLER(clname, meth)
StartupEvent is a simple class for scheduling a starting event on the Scheduler. It does not support ...
Node in a composite tree representing a sparta Tree item.
Definition TreeNode.hpp:205

Definition at line 61 of file StartupEvent.hpp.

Constructor & Destructor Documentation

◆ StartupEvent()

sparta::StartupEvent::StartupEvent ( TreeNode node,
const SpartaHandler &  consumer_startupevent_handler 
)
inline

Create and schedule a StartupEvent with the given handler.

Parameters
nodeThe parent node this StartupEvent is created from. Used to find the Scheduler.

Definition at line 70 of file StartupEvent.hpp.

Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ trigger::CounterTrigger

friend class trigger::CounterTrigger
friend

Definition at line 92 of file StartupEvent.hpp.

◆ trigger::CycleTrigger

friend class trigger::CycleTrigger
friend

Definition at line 90 of file StartupEvent.hpp.

◆ trigger::ManagedTrigger

friend class trigger::ManagedTrigger
friend

Definition at line 93 of file StartupEvent.hpp.

◆ trigger::TimeTrigger

friend class trigger::TimeTrigger
friend

Definition at line 91 of file StartupEvent.hpp.


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