ANNA Suite  2020b
Multipurpose development suite for Telco applications
Status.hpp
Go to the documentation of this file.
1 // ANNA - Anna is Not Nothingness Anymore //
2 // //
3 // (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo //
4 // //
5 // See project site at http://redmine.teslayout.com/projects/anna-suite //
6 // See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE //
7 
8 
9 #ifndef anna_comm_Status_hpp
10 #define anna_comm_Status_hpp
11 
12 #include <string>
13 
14 namespace anna {
15 namespace comm {
16 
21 class Status {
22 public:
23  enum _v {
24  Available = 0,
26  Overload = 2
27  };
28 
29  Status() : a_value(Unavailable) {;}
30  Status(const Status& other) : a_value(other.a_value) {;}
31  Status(const _v v) : a_value(v) {;}
32  Status& operator = (const _v v) { a_value = v; return *this; }
33  Status& operator = (const Status& other) { a_value = other.a_value; return *this; }
34 
35  bool operator != (const Status& other) const { return a_value != other.a_value; }
36  bool operator != (const Status::_v v) const { return a_value != v ; }
37  bool operator == (const Status& other) const { return a_value == other.a_value; }
38  bool operator == (const Status::_v v) const { return a_value == v ; }
39 
40  _v value() const { return a_value; }
41 
42  std::string asString() const ;
43 
44 private:
45  _v a_value;
46 };
47 
48 }
49 }
50 
51 
52 #endif
53 
Definition: Status.hpp:21
_v value() const
Definition: Status.hpp:40
_v
Definition: Status.hpp:23
Status & operator=(const _v v)
Definition: Status.hpp:32
Status()
Definition: Status.hpp:29
Status(const _v v)
Definition: Status.hpp:31
Status(const Status &other)
Definition: Status.hpp:30
Definition: Status.hpp:25
Definition: app.hpp:12
Definition: Status.hpp:24
std::string asString() const
bool operator!=(const Status &other) const
Definition: Status.hpp:35
Definition: Status.hpp:26
bool operator==(const Status &other) const
Definition: Status.hpp:37