Revised OpenFlow Library  v0.6.0dev
 All Classes Files Functions Variables Friends Groups Pages
cofgroupdescstats.h
1 /*
2  * cofgroupdescstats.h
3  *
4  * Created on: 14.03.2013
5  * Author: andi
6  */
7 
8 #ifndef COFGROUPDESCSTATS_H_
9 #define COFGROUPDESCSTATS_H_ 1
10 
11 #include "../cmemory.h"
12 #include "openflow.h"
13 #include "openflow_rofl_exceptions.h"
14 #include "cofbuckets.h"
15 
16 namespace rofl {
17 namespace openflow {
18 
22 
24 {
25 private: // data structures
26 
27  uint8_t of_version;
28  uint8_t type;
29  uint32_t group_id;
30  cofbuckets buckets;
31 
32 public: // data structures
33 
34 
35 public:
40  uint8_t of_version = 0);
41 
46  uint8_t of_version,
47  uint8_t type,
48  uint32_t group_id,
49  cofbuckets const& buckets);
50 
54  virtual
56 
57 
62  cofgroup_desc_stats_reply const& stats);
63 
68  operator= (
69  cofgroup_desc_stats_reply const& stats);
70 
71 
75  bool
76  operator== (
77  cofgroup_desc_stats_reply const& stats);
78 
79 
83  void
84  pack(uint8_t *buf, size_t buflen);
85 
89  void
90  unpack(uint8_t *buf, size_t buflen);
91 
92 
96  size_t
97  length() const;
98 
99 
100 public:
101 
105  uint8_t
106  get_version() const { return of_version; };
107 
111  uint8_t
112  get_group_type() const { return type; };
113 
117  uint32_t
118  get_group_id() const { return group_id; };
119 
123  cofbuckets&
124  get_buckets() { return buckets; };
125 
129  void
130  set_version(uint8_t of_version) { this->of_version = of_version; };
131 
135  void
136  set_group_type(uint8_t type) { this->type = type; };
137 
141  void
142  set_group_id(uint32_t group_id) { this->group_id = group_id; };
143 
147  void
148  set_buckets(cofbuckets const& buckets) { this->buckets = buckets; };
149 
153  cofbuckets&
154  set_buckets() { return buckets; };
155 
159  cofbuckets const&
160  get_buckets() const { return buckets; };
161 
162 public:
163 
164  friend std::ostream&
165  operator<< (std::ostream& os, cofgroup_desc_stats_reply const& group_desc_stats_reply) {
166  os << indent(0) << "<cofgroup_desc_stats_reply >" << std::endl;
167  os << indent(2) << "<type: " << (int)group_desc_stats_reply.get_group_type() << " >" << std::endl;
168  os << indent(2) << "<group-id: " << group_desc_stats_reply.get_group_id() << " >" << std::endl;
169  indent i(2);
170  os << group_desc_stats_reply.buckets;
171  return os;
172  };
173 };
174 
175 }
176 }
177 
178 #endif /* COFGROUPDESCSTATS_H_ */
Definition: cofbuckets.h:28
Definition: cofgroupdescstats.h:20
Definition: cofgroupdescstats.h:23
Definition: logging.h:76
Definition: cofgroupdescstats.h:21
Definition: cofgroupdescstats.h:19
Definition: croflexception.h:27