Revised OpenFlow Library  v0.6.0dev
 All Classes Files Functions Variables Friends Groups Pages
cevents.h
1 /*
2  * cevents.h
3  *
4  * Created on: 26.01.2014
5  * Author: andreas
6  */
7 
8 #ifndef CEVENTS_H_
9 #define CEVENTS_H_
10 
11 #include <list>
12 #include <iostream>
13 
14 #include "rofl/common/cevent.h"
15 #include "rofl/common/logging.h"
16 #include "rofl/common/thread_helper.h"
17 #include "rofl/common/croflexception.h"
18 
19 namespace rofl {
20 
21 class eEventsBase : public RoflException {};
22 class eEventsNotFound : public eEventsBase {};
23 
24 class cevents {
25 
26  std::list<cevent> events;
27  PthreadRwLock rwlock;
28 
29 public:
30 
34  cevents();
35 
39  cevents(cevents const& events);
40 
44  cevents&
45  operator= (cevents const& events);
46 
50  virtual
51  ~cevents();
52 
53 public:
54 
58  void
59  add_event(cevent const& event);
60 
64  cevent
65  get_event();
66 
70  bool
71  empty();
72 
76  void
77  clear();
78 
79 public:
80 
81  friend std::ostream&
82  operator<< (std::ostream& os, cevents const& events) {
83  os << indent(0) << "<cevents: >" << std::endl;
84  indent i(2);
85  for (std::list<cevent>::const_iterator
86  it = events.events.begin(); it != events.events.end(); ++it) {
87  os << (*it) << " ";
88  }
89  return os;
90  };
91 };
92 
93 };
94 
95 #endif /* CEVENTS_H_ */
Definition: cevents.h:21
Definition: cevents.h:22
Definition: thread_helper.h:25
Single event used internally by class crofl::cioloop.
Definition: cevent.h:20
Definition: logging.h:76
Definition: cevents.h:24
Definition: croflexception.h:27