Revised OpenFlow Library  v0.6.0dev
 All Classes Files Functions Variables Friends Groups Pages
ctimerid.h
1 /*
2  * ctimerid.h
3  *
4  * Created on: 16.05.2014
5  * Author: andreas
6  */
7 
8 #ifndef CTIMERID_H_
9 #define CTIMERID_H_
10 
11 #include <inttypes.h>
12 #include <iostream>
13 #include "rofl/common/logging.h"
14 
15 namespace rofl {
16 
21 class ctimerid {
22 
23  /*
24  * static members and methods
25  */
26  static uint32_t next_timer_id;
27 
28  static uint32_t get_next_timer_id();
29 
30 
31  /*
32  * non-static members and methods
33  */
34 
35  uint32_t tid;
36 
37 public:
38 
42  ctimerid();
43 
47  ~ctimerid();
48 
52  ctimerid(
53  ctimerid const& tid);
54 
58  ctimerid&
59  operator= (
60  ctimerid const& tid);
61 
65  bool
66  operator== (
67  ctimerid const& tid);
68 
69 public:
70 
74  uint32_t&
75  set_tid() {
76  return tid;
77  };
78 
82  uint32_t const&
83  get_tid() const { return tid; };
84 
88  void
89  set_tid(uint32_t tid) {
90  this->tid = tid;
91  };
92 
93 public:
94 
95  friend std::ostream&
96  operator<< (std::ostream& os, ctimerid const& timerid) {
97  os << rofl::indent(0) << "<ctimerid tid:0x" << std::hex << timerid.tid << std::dec
98  << " this:" << &timerid << " >" << std::endl;
99  //os << rofl::indent(2) << "<this: 0x" << std::hex << (&timerid) << std::dec << " >" << std::endl;
100  return os;
101  };
102 };
103 
104 };
105 
106 #endif /* CTIMERID_H_ */
Timer handle used by class rofl::cioloop.
Definition: ctimerid.h:21
Definition: logging.h:76