46 const std::string & name,
48 TreeNode(nullptr, name, name +
" EventNode"),
49 sched_phase_(sched_phase)
52 "Events must created with an EventSet: " << name);
54 ensureParentIsEventSet_(event_set);
76 sparta_assert(scheduler,
"Clock with no scheduler passed to EventNode::determineScheduler()");
116 participate_in_auto_precedence_ = participate;
123 return participate_in_auto_precedence_;
135 bool participate_in_auto_precedence_ =
true;
File that defines the Clock class.
File that defines the phases used in simulation.
Set of macros for Sparta assertions. Caught by the framework.
#define sparta_assert(...)
Simple variadic assertion that will throw a sparta_exception if the condition fails.
Basic Node framework in sparta device tree composite pattern.
A representation of simulated time.
Scheduler * getScheduler() const
EventNode is the base class for all event types in SPARTA. Not to be used by the modeler....
EventNode(TreeNode *event_set, const std::string &name, sparta::SchedulingPhase sched_phase)
Create an Event Node.
const char * getLabel() const
Get the name of this EventNode as registered in the consumer handler for the TopoSortable.
virtual ~EventNode()=default
Destroy! Does nothing.
virtual void participateInAutoPrecedence(bool participate)
Turn on/off auto precedence for this EvendNode.
EventNode(EventNode &&)=delete
Do not allow moves.
EventNode & operator=(const EventNode &)=delete
Do not allow assignments.
sparta::SchedulingPhase getSchedulingPhase() const
Get the scheduling phase of this event node.
EventNode(const EventNode &)=delete
Do not allow copies.
virtual Scheduleable & getScheduleable()=0
Get the scheduleable associated with this event node.
virtual bool doesParticipateInAutoPrecedence() const
Does this EventNode participate in auto-precedence establishment by sparta::Unit?
static Scheduler * determineScheduler(const Clock *clk)
Center point of Scheduler location.
A class that defines the basic scheduling interface to the Scheduler. Not intended to be used by mode...
A class that lets you schedule events now and in the future.
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.
void addChild(TreeNode *child, bool inherit_phase=true)
Adds a TreeNode to this node as a child.
const std::string & getName() const override
Gets the name of this node.
void setExpectedParent_(const TreeNode *parent)
Tracks a node as an expected parent without actually adding this node as a child. This is used almost...
Macros for handling exponential backoff.
SchedulingPhase
The SchedulingPhases used for events (Tick, Update, PortUpdate, etc)