OpenMAMA C++ API
MamaStatus.h
Go to the documentation of this file.
1 /* $Id$
2  *
3  * OpenMAMA: The open middleware agnostic messaging API
4  * Copyright (C) 2011 NYSE Technologies, Inc.
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19  * 02110-1301 USA
20  */
21 
22 #ifndef MAMA_STATUS_CPP_H__
23 #define MAMA_STATUS_CPP_H__
24 
25 #include "mama/mamacpp.h"
26 
27 namespace Wombat
28 {
29 
30  class MAMACPPExpDLL MamaStatus
31  {
32  public:
33  virtual ~MamaStatus (void) {}
34 
35  MamaStatus (mama_status status)
36  : mStatus (status)
37  {}
38 
39  virtual const char* toString (void) const;
40 
41  mama_status getStatus () const
42  {
43  return mStatus;
44  }
45 
46  inline bool operator ==(mama_status const rhs_i)
47  {
48  return mStatus == rhs_i;
49  }
50 
51  inline bool operator ==(MamaStatus const rhs_i)
52  {
53  return mStatus == rhs_i.getStatus();
54  }
55 
56 
57  inline bool operator !=(mama_status const rhs_i)
58  {
59  return !(mStatus == rhs_i);
60  }
61 
62  inline bool operator !=(MamaStatus const rhs_i)
63  {
64  return !(mStatus == rhs_i.getStatus());
65  }
66 
67  inline bool operator <(mama_status const rhs_i)
68  {
69  return mStatus < rhs_i;
70  }
71 
72  inline bool operator <(MamaStatus const rhs_i)
73  {
74  return mStatus < rhs_i.getStatus();
75  }
76 
77  inline bool operator >(mama_status const rhs_i)
78  {
79  return mStatus > rhs_i;
80  }
81 
82  inline bool operator >(MamaStatus const rhs_i)
83  {
84  return mStatus > rhs_i.getStatus();
85  }
86 
87  inline bool operator <=(mama_status const rhs_i)
88  {
89  return !(mStatus > rhs_i);
90  }
91 
92  inline bool operator <=(MamaStatus const rhs_i)
93  {
94  return !(mStatus > rhs_i.getStatus());
95  }
96 
97  inline bool operator >=(mama_status const rhs_i)
98  {
99  return !(mStatus < rhs_i);
100  }
101 
102  inline bool operator >=(MamaStatus const rhs_i)
103  {
104  return !(mStatus < rhs_i.getStatus());
105  }
106 
107  private:
108  mama_status mStatus;
109  };
110 
111 } // namespace Wombat
112 #endif // MAMA_STATUS_CPP_H__
mama_status getStatus() const
Definition: MamaStatus.h:41
virtual ~MamaStatus(void)
Definition: MamaStatus.h:33
Definition: MamaConnection.h:29
Definition: MamaStatus.h:30
MamaStatus(mama_status status)
Definition: MamaStatus.h:35