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 
3 namespace ns3 {
4 
5 EventImpl * MakeEvent (void (*f)(void))
6 {
7  // zero arg version
8  class EventFunctionImpl0 : public EventImpl
9  {
10 public:
11  typedef void (*F)(void);
12 
13  EventFunctionImpl0 (F function)
14  : m_function (function)
15  {
16  }
17  virtual ~EventFunctionImpl0 ()
18  {
19  }
20 protected:
21  virtual void Notify (void)
22  {
23  (*m_function)();
24  }
25 private:
26  F m_function;
27  } *ev = new EventFunctionImpl0 (f);
28  return ev;
29 }
30 
31 } // namespace ns3