activemq-cpp-3.6.0
Level.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_UTIL_LOGGING_LEVEL_H_
19 #define _DECAF_UTIL_LOGGING_LEVEL_H_
20 
21 #include <decaf/util/Config.h>
22 
23 #include <decaf/lang/Comparable.h>
25 
26 namespace decaf {
27 namespace util {
28 namespace logging {
29 
56  class DECAF_API Level : public decaf::lang::Comparable<Level> {
57  private:
58 
59  std::string name;
60  int value;
61 
62  public:
63 
68  static const Level INHERIT;
69 
74  static const Level OFF;
75 
83  static const Level SEVERE;
84 
91  static const Level WARNING;
92 
100  static const Level INFO;
101 
110  static const Level DEBUG;
111 
120  static const Level CONFIG;
121 
137  static const Level FINE;
138 
144  static const Level FINER;
145 
149  static const Level FINEST;
150 
155  static const Level ALL;
156 
157  protected:
158 
167  Level( const std::string& name, int value );
168 
169  public:
170 
171  virtual ~Level();
172 
176  int intValue() const {
177  return this->value;
178  }
179 
183  std::string getName() const {
184  return this->name;
185  }
186 
190  std::string toString() const {
191  return this->name;
192  }
193 
194  public: // Comparable
195 
196  virtual int compareTo( const Level& value ) const;
197 
198  virtual bool equals( const Level& value ) const;
199 
200  virtual bool operator==( const Level& value ) const;
201 
202  virtual bool operator<( const Level& value ) const;
203 
204  public:
205 
226  static Level parse( const std::string& name );
227 
228  };
229 
230 }}}
231 
232 #endif /* _DECAF_UTIL_LOGGING_LEVEL_H_ */