13 #ifndef SST_CORE_CLOCK_H
14 #define SST_CORE_CLOCK_H
21 #include <sst/core/action.h>
24 #define _CLE_DBG( fmt, args...)__DBG( DBG_CLOCK, Clock, fmt, ## args )
56 template <
typename classT,
typename argT =
void>
59 typedef bool (classT::*PtrMember)(Cycle_t, argT);
61 const PtrMember member;
70 Handler( classT*
const object, PtrMember member, argT data ) :
77 return (object->*member)(cycle,data);
84 template <
typename classT>
87 typedef bool (classT::*PtrMember)(Cycle_t);
89 const PtrMember member;
96 Handler( classT*
const object, PtrMember member ) :
102 return (object->*member)(cycle);
120 void print(
const std::string& header,
Output &out)
const override;
124 typedef std::vector<Clock::HandlerBase*> StaticHandlerMap_t;
129 void execute(
void )
override;
131 Cycle_t currentCycle;
132 TimeConverter* period;
133 StaticHandlerMap_t staticHandlerMap;
142 #endif // SST_CORE_CLOCK_H
Output object provides consistant method for outputing data to stdout, stderr and/or sst debug file...
Definition: output.h:54
An Action is a schedulable Activity which is not an Event.
Definition: action.h:30
A class to convert between a component's view of time and the core's view of time.
Definition: timeConverter.h:25
Handler(classT *const object, PtrMember member)
Constructor.
Definition: clock.h:96
Cycle_t getNextCycle()
Return the time of the next clock tick.
Definition: clock.cc:69
bool registerHandler(Clock::HandlerBase *handler)
Add a handler to be called on this clock's tick.
Definition: clock.cc:41
Handler(classT *const object, PtrMember member, argT data)
Constructor.
Definition: clock.h:70
A Clock class.
Definition: clock.h:35
bool operator()(Cycle_t cycle) override
Function called when Handler is invoked.
Definition: clock.h:101
bool operator()(Cycle_t cycle) override
Function called when Handler is invoked.
Definition: clock.h:76
Functor classes for Clock handling.
Definition: clock.h:44
virtual bool operator()(Cycle_t)=0
Function called when Handler is invoked.
Event Handler class with user-data argument.
Definition: clock.h:57
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:51
void schedule()
Activates this clock object, by inserting into the simulation's timeVortex for future execution...
Definition: clock.cc:105
void print(const std::string &header, Output &out) const override
Generic print-print function for this Activity.
Definition: clock.cc:128