12#ifndef SST_CORE_CLOCK_H
13#define SST_CORE_CLOCK_H
15#include "sst/core/action.h"
16#include "sst/core/ssthandler.h"
17#include "sst/core/timeConverter.h"
23#define _CLE_DBG(fmt, args...) __DBG(DBG_CLOCK, Clock, fmt, ##args)
69 template <
typename classT, auto funcT,
typename dataT =
void>
75 template <
typename classT, auto funcT,
typename dataT =
void>
76 using Handler2 [[deprecated(
77 "The name Handler2 has been deprecated and will be removed in SST 17. Please rename Handler2 to Handler.")]]
106 std::string
toString()
const override;
110 using StaticHandlerMap_t = std::vector<Clock::HandlerBase*>;
119 Cycle_t currentCycle;
121 StaticHandlerMap_t staticHandlerMap;
130class ClockHandlerMetaData :
public AttachPointMetaData
133 const ComponentId_t comp_id;
134 const std::string comp_name;
135 const std::string comp_type;
137 ClockHandlerMetaData(ComponentId_t
id,
const std::string& cname,
const std::string& ctype) :
143 ~ClockHandlerMetaData() {}
virtual void execute()=0
Function which will be called when the time for this Activity comes to pass.
A Clock class.
Definition clock.h:35
Cycle_t getNextCycle()
Return the time of the next clock tick.
Definition clock.cc:74
void schedule()
Activates this clock object, by inserting into the simulation's timeVortex for future execution.
Definition clock.cc:116
SSTHandlerBase< bool, Cycle_t > HandlerBase
Base handler for clock functions.
Definition clock.h:44
std::string toString() const override
Get a string represenation of the event.
Definition clock.cc:150
bool isHandlerRegistered(Clock::HandlerBase *handler)
Checks to see if a handler is registered with this clock.
Definition clock.cc:63
bool unregisterHandler(Clock::HandlerBase *handler, bool &empty)
Remove a handler from the list of handlers to be called on the clock tick.
Definition clock.cc:44
SSTHandler< bool, Cycle_t, classT, dataT, funcT > Handler
Used to create handlers for clock.
Definition clock.h:70
Clock(TimeConverter period, int priority=CLOCKPRIORITY)
Create a new clock with a specified period.
Definition clock.cc:24
bool registerHandler(Clock::HandlerBase *handler)
Add a handler to be called on this clock's tick.
Definition clock.cc:34
void updateCurrentCycle()
Update current cycle count - needed at simulation end if clock has run ahead of simulation end and to...
Definition clock.cc:142
This class is basically a wrapper for objects to declare the order in which their members should be s...
Definition serializer.h:43
Base template for handlers which take a class defined argument.
Definition ssthandler.h:79
Base template for the class.
Definition ssthandler.h:1102
A class to convert between a component's view of time and the core's view of time.
Definition timeConverter.h:31