libfluid
The ONF OpenFlow driver
EventLoop.hh
1 
2 #ifndef __EVENTLOOP_HH__
3 #define __EVENTLOOP_HH__
4 
5 namespace fluid_base {
6 
7 class BaseOFServer;
8 class BaseOFConnection;
9 
18 // An EventLoop is pretty much a simple wrapper around libevent's event_base
19 class EventLoop {
20 public:
26  EventLoop(int id);
27  ~EventLoop();
28 
35  void run();
36 
43  void stop();
44 
48  static void* thread_adapter(void* arg);
49 
50 
51 private:
52  int id;
53  bool stopped;
54 
55  friend class BaseOFServer;
56  friend class BaseOFConnection;
57  void* get_base();
58 
59  class LibEventEventLoop;
60  friend class LibEventEventLoop;
61  LibEventEventLoop* m_implementation;
62 };
63 
64 }
65 
66 #endif