A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
make-event.cc
Go to the documentation of this file.
1 #include "make-event.h"
2 #include "log.h"
3 
4 NS_LOG_COMPONENT_DEFINE ("MakeEvent");
5 
6 namespace ns3 {
7 
8 EventImpl * MakeEvent (void (*f)(void))
9 {
10  NS_LOG_FUNCTION (f);
11  // zero arg version
12  class EventFunctionImpl0 : public EventImpl
13  {
14 public:
15  typedef void (*F)(void);
16 
17  EventFunctionImpl0 (F function)
18  : m_function (function)
19  {
20  }
21  virtual ~EventFunctionImpl0 ()
22  {
23  }
24 protected:
25  virtual void Notify (void)
26  {
27  (*m_function)();
28  }
29 private:
30  F m_function;
31  } *ev = new EventFunctionImpl0 (f);
32  return ev;
33 }
34 
35 } // namespace ns3
#define NS_LOG_FUNCTION(parameters)
Definition: log.h:345
NS_LOG_COMPONENT_DEFINE("MakeEvent")
a simulation event
Definition: event-impl.h:39
EventImpl * MakeEvent(void(*f)(void))
Definition: make-event.cc:8