Revised OpenFlow Library  v0.6.0dev
 All Classes Files Functions Variables Friends Groups Pages
cparam.h
1 /*
2  * cparam.h
3  *
4  * Created on: 01.04.2014
5  * Author: andreas
6  */
7 
8 #ifndef CPARAM_H_
9 #define CPARAM_H_
10 
11 #include <string>
12 #include <iostream>
13 #include <sstream>
14 #include <cstdlib>
15 
16 #include "rofl/common/logging.h"
17 #include "rofl/common/croflexception.h"
18 
19 namespace rofl {
20 
21 class eParamBase : public RoflException {};
22 class eParamInval : public eParamBase {};
23 class eParamNotFound : public eParamBase {};
24 
25 class cparam {
26 
27  std::string param;
28 
29 public:
30 
34  cparam();
35 
39  virtual
40  ~cparam();
41 
45  cparam(
46  std::string const& param);
47 
51  cparam(
52  cparam const& param);
53 
57  cparam&
58  operator= (
59  cparam const& param);
60 
64  bool
65  operator== (
66  cparam const& param) const;
67 
68 public:
69 
73  void
74  set_string(std::string const& param) { this->param = param; };
75 
79  std::string&
80  set_string() { return param; };
81 
85  std::string const&
86  get_string() const { return param; };
87 
91  void
92  set_int(int value);
93 
97  int
98  get_int() const;
99 
103  void
104  set_uint(unsigned int value);
105 
109  unsigned int
110  get_uint() const;
111 
115  void
116  set_bool(bool value);
117 
121  bool
122  get_bool() const;
123 
124 public:
125 
126  friend std::ostream&
127  operator<< (std::ostream& os, cparam const& param) {
128  os << rofl::indent(0) << "<cparam value: \"" << param.param << "\" >" << std::endl;
129  return os;
130  };
131 };
132 
133 }; // end of namespace rofl
134 
135 #endif /* CPARAM_H_ */
Definition: cparam.h:25
Definition: cparam.h:22
Definition: logging.h:76
Definition: cparam.h:23
Definition: cparam.h:21
Definition: croflexception.h:27