13 #ifndef SST_CORE_CLOCK_H
14 #define SST_CORE_CLOCK_H
19 #include "sst/core/action.h"
21 #define _CLE_DBG( fmt, args...)__DBG( DBG_CLOCK, Clock, fmt, ## args )
53 template <
typename classT,
typename argT =
void>
56 typedef bool (classT::*PtrMember)(Cycle_t, argT);
58 const PtrMember member;
67 Handler( classT*
const object, PtrMember member, argT data ) :
74 return (object->*member)(cycle,data);
81 template <
typename classT>
84 typedef bool (classT::*PtrMember)(Cycle_t);
86 const PtrMember member;
93 Handler( classT*
const object, PtrMember member ) :
99 return (object->*member)(cycle);
117 void print(
const std::string& header,
Output &out)
const override;
121 typedef std::vector<Clock::HandlerBase*> StaticHandlerMap_t;
126 void execute(
void )
override;
128 Cycle_t currentCycle;
129 TimeConverter* period;
130 StaticHandlerMap_t staticHandlerMap;
139 #endif // SST_CORE_CLOCK_H
Output object provides consistent method for outputting 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:93
void print(const std::string &header, Output &out) const override
Generic print-print function for this Activity.
Definition: clock.cc:126
Cycle_t getNextCycle()
Return the time of the next clock tick.
Definition: clock.cc:68
bool registerHandler(Clock::HandlerBase *handler)
Add a handler to be called on this clock's tick.
Definition: clock.cc:40
Handler(classT *const object, PtrMember member, argT data)
Constructor.
Definition: clock.h:67
A Clock class.
Definition: clock.h:32
bool operator()(Cycle_t cycle) override
Function called when Handler is invoked.
Definition: clock.h:98
bool operator()(Cycle_t cycle) override
Function called when Handler is invoked.
Definition: clock.h:73
Functor classes for Clock handling.
Definition: clock.h:41
virtual bool operator()(Cycle_t)=0
Function called when Handler is invoked.
Event Handler class with user-data argument.
Definition: clock.h:54
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:50
void schedule()
Activates this clock object, by inserting into the simulation's timeVortex for future execution...
Definition: clock.cc:103