trick/include/trick/JITEvent.hh

60 lines
1.1 KiB
C++
Raw Normal View History

2015-02-26 15:02:31 +00:00
/**
PURPOSE:
(blah.)
LIBRARY DEPENDENCY:
((../src/JITEvent.cpp))
*/
#ifndef JITEVENT_HH
#define JITEVENT_HH
2015-02-26 15:02:31 +00:00
#include <functional>
#include <iostream>
#include <string>
#include "trick/mm_macros.hh"
#include "trick/Event.hh"
2015-02-26 15:02:31 +00:00
namespace Trick {
/**
* This is a cyclic event class. It holds a cycle time, and the function to call.
*
* @author Alexander S. Lin
*
* @date April 2014
*
*/
class JITEvent : public Trick::Event {
public:
JITEvent() ;
JITEvent(std::string func_name, std::string in_name = "JIT_no_name" , double in_cycle = 1.0) ;
2015-02-26 15:02:31 +00:00
/** calls the function_ptr job */
virtual int process( long long curr_time ) ;
/** called when the event is added to the event manager */
virtual void add() {} ;
/** called when the event is removed from the event manager */
virtual void remove() {} ;
virtual void restart() ;
2015-02-26 15:02:31 +00:00
std::string func_name ;
2015-02-26 15:02:31 +00:00
protected:
void get_func_ptr_from_name() ;
2015-02-26 15:02:31 +00:00
/** pointer to funtion to run when event fires */
int (*func_ptr)(void) ; // trick_io(**)
2015-02-26 15:02:31 +00:00
} ;
}
#endif