12 #ifndef SST_CORE_ONESHOTMANAGER_H 13 #define SST_CORE_ONESHOTMANAGER_H 15 #include "sst/core/action.h" 16 #include "sst/core/sst_types.h" 17 #include "sst/core/ssthandler.h" 27 class Simulation_impl;
35 using TimeStamp_t = std::pair<SimTime_t, int>;
65 template <
typename classT, auto funcT,
typename dataT =
void>
68 using HandlerList_t = std::vector<OneShot::HandlerBase*>;
71 HandlerList_t& handlers;
97 using HandlerVectorMap_t = std::map<TimeStamp_t, std::pair<OneShot::HandlerList_t, bool>>;
112 template <
class classT, auto funcT,
typename dataT>
116 registerHandlerBase(trigger_time, priority,
true, handler);
120 template <
class classT, auto funcT>
124 registerHandlerBase(trigger_time, priority,
true, handler);
128 template <
class classT, auto funcT,
typename dataT>
132 registerHandlerBase(trigger_time, priority,
false, handler);
136 template <
class classT, auto funcT>
140 registerHandlerBase(trigger_time, priority,
false, handler);
147 HandlerVectorMap_t handler_vector_map_;
153 void registerHandlerBase(SimTime_t trigger_time,
int priority,
bool relative,
OneShot::HandlerBase* handler);
159 void scheduleNextOneShot();
164 void oneshotCallback(TimeStamp_t time,
OneShot* oneshot);
170 #endif // SST_CORE_ONESHOTMANAGER_H An Action is a schedulable Activity which is not an Event.
Definition: action.h:26
void setDeliveryTime(SimTime_t time)
Set the time for which this Activity should be delivered.
Definition: activity.h:147
void registerAbsoluteHandler(SimTime_t trigger_time, int priority, classT *obj)
Add a handler to be called on this OneShot Event.
Definition: oneshotManager.h:137
Base template for the class.
Definition: ssthandler.h:1273
Manages the OneShot actions for the core.
Definition: oneshotManager.h:94
void registerAbsoluteHandler(SimTime_t trigger_time, int priority, classT *obj, dataT metadata)
Add a handler to be called on this OneShot Event.
Definition: oneshotManager.h:129
void setPriority(uint64_t priority)
Set the priority of the Activity.
Definition: activity.h:200
void execute() override
Function which will be called when the time for this Activity comes to pass.
Definition: oneshotManager.cc:24
Definition: oneshotManager.h:38
Base template for handlers which don't take a class defined argument.
Definition: ssthandler.h:702
Main control class for a SST Simulation.
Definition: simulation_impl.h:122
void registerRelativeHandler(SimTime_t trigger_time, int priority, classT *obj)
Add a handler to be called on this OneShot Event.
Definition: oneshotManager.h:121
void registerRelativeHandler(SimTime_t trigger_time, int priority, classT *obj, dataT metadata)
Add a handler to be called on this OneShot Event.
Definition: oneshotManager.h:113
OneShotManager(Simulation_impl *sim)
Create a new One Shot for a specified time that will callback the handler function.
Definition: oneshotManager.cc:37