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 ) :
81 return (object->*member)(cycle,data);
88 template <
typename classT>
91 typedef bool (classT::*PtrMember)(Cycle_t);
93 const PtrMember member;
100 Handler( classT*
const object, PtrMember member ) :
113 return (object->*member)(cycle);
131 void print(
const std::string& header,
Output &out)
const override;
135 typedef std::vector<Clock::HandlerBase*> StaticHandlerMap_t;
140 void execute(
void )
override;
142 Cycle_t currentCycle;
143 TimeConverter* period;
144 StaticHandlerMap_t staticHandlerMap;
153 #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:100
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
Calls underlying handler function, passing in the current cycle count.
Definition: clock.h:112
bool operator()(Cycle_t cycle) override
Calls underlying handler function, passing in the current cycle count and additional metadata supplie...
Definition: clock.h:80
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