71 const SpartaHandler & consumer_startupevent_handler)
74 "You cannot create a StartupEvent outside of resource construction");
77 scheduler =
dynamic_cast<Scheduler*
>(node);
80 std::ostringstream oss;
81 oss <<
"Could not resolve the Scheduler from the node given to a StartupEvent at location '"
85 scheduler->scheduleStartupHandler_(consumer_startupevent_handler);
90 friend class trigger::CycleTrigger;
91 friend class trigger::TimeTrigger;
92 friend class trigger::CounterTrigger;
93 friend class trigger::ManagedTrigger;
96 const SpartaHandler & consumer_startupevent_handler)
99 "You cannot create a StartupEvent outside of resource construction");
100 scheduler->scheduleStartupHandler_(consumer_startupevent_handler);
File that defines the EventNode class.
A simple time-based, event precedence based scheduler.
#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.
TreePhase getPhase() const
Gets the trees current phase.
@ TREE_FINALIZED
Tree and all resources have been instantiated. No more configuration/connection allowed.
A class that lets you schedule events now and in the future.
bool isFinalized() const noexcept override
Is the scheduler finalized.
Used to construct and throw a standard C++ exception. Inherits from std::exception.
StartupEvent is a simple class for scheduling a starting event on the Scheduler. It does not support ...
StartupEvent(TreeNode *node, const SpartaHandler &consumer_startupevent_handler)
Create and schedule a StartupEvent with the given handler.
Node in a composite tree representing a sparta Tree item.
std::string getLocation() const override final
Scheduler * getScheduler(const bool must_exist=false)
Get the scheduler associated with this tree node's root.
Macros for handling exponential backoff.