activemq-cpp-3.8.2
Boolean.h
Go to the documentation of this file.
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #ifndef _DECAF_LANG_BOOLEAN_H_
19 #define _DECAF_LANG_BOOLEAN_H_
20 
21 #include <string>
22 #include <decaf/lang/Comparable.h>
23 #include <decaf/util/Config.h>
24 
25 namespace decaf{
26 namespace lang{
27 
28  class DECAF_API Boolean : public Comparable<Boolean>,
29  public Comparable<bool> {
30  private:
31 
32  // This objects boolean value
33  bool value;
34 
35  public:
36 
40  static const Boolean _FALSE;
41 
45  static const Boolean _TRUE;
46 
47  public:
48 
52  Boolean(bool value);
53 
57  Boolean(const std::string& value);
58 
59  virtual ~Boolean() {}
60 
64  bool booleanValue() const {
65  return value;
66  }
67 
71  std::string toString() const;
72 
81  virtual int compareTo(const Boolean& b) const;
82 
88  virtual bool operator==(const Boolean& value) const;
89 
96  virtual bool operator<(const Boolean& value) const;
97 
101  bool equals(const Boolean& b) const {
102  return this->value == b.value;
103  }
104 
113  virtual int compareTo(const bool& b) const;
114 
120  virtual bool operator==(const bool& value) const;
121 
128  virtual bool operator<(const bool& value) const;
129 
133  bool equals(const bool& b) const {
134  return this->value == b;
135  }
136 
137  public:
138  // Statics
139 
146  static Boolean valueOf(bool value);
147 
154  static Boolean valueOf(const std::string& value);
155 
163  static bool parseBoolean(const std::string& value);
164 
172  static std::string toString(bool value);
173 
174  };
175 
176 }}
177 
178 #endif /*_DECAF_LANG_BOOLEAN_H_*/
static const Boolean _FALSE
The Class object representing the primitive false boolean.
Definition: Boolean.h:40
static const Boolean _TRUE
The Class object representing the primitive type boolean.
Definition: Boolean.h:45
Definition: Boolean.h:28
bool equals(const Boolean &b) const
Definition: Boolean.h:101
virtual ~Boolean()
Definition: Boolean.h:59
#define DECAF_API
Definition: Config.h:29
bool equals(const bool &b) const
Definition: Boolean.h:133
bool booleanValue() const
Definition: Boolean.h:64
bool operator==(const ArrayPointer< T > &left, const U *right)
Definition: ArrayPointer.h:379
This interface imposes a total ordering on the objects of each class that implements it...
Definition: Comparable.h:33
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements...
Definition: AprPool.h:25