kim-api  2.1.2+v2.1.2.GNU
An Application Programming Interface (API) for the Knowledgebase of Interatomic Models (KIM).
KIM_LogVerbosity.hpp
Go to the documentation of this file.
1 //
2 // CDDL HEADER START
3 //
4 // The contents of this file are subject to the terms of the Common Development
5 // and Distribution License Version 1.0 (the "License").
6 //
7 // You can obtain a copy of the license at
8 // http://www.opensource.org/licenses/CDDL-1.0. See the License for the
9 // specific language governing permissions and limitations under the License.
10 //
11 // When distributing Covered Code, include this CDDL HEADER in each file and
12 // include the License file in a prominent location with the name LICENSE.CDDL.
13 // If applicable, add the following below this CDDL HEADER, with the fields
14 // enclosed by brackets "[]" replaced with your own identifying information:
15 //
16 // Portions Copyright (c) [yyyy] [name of copyright owner]. All rights reserved.
17 //
18 // CDDL HEADER END
19 //
20 
21 //
22 // Copyright (c) 2016--2019, Regents of the University of Minnesota.
23 // All rights reserved.
24 //
25 // Contributors:
26 // Ryan S. Elliott
27 //
28 
29 //
30 // Release: This file is part of the kim-api-2.1.2 package.
31 //
32 
33 
34 #ifndef KIM_LOG_VERBOSITY_HPP_
35 #define KIM_LOG_VERBOSITY_HPP_
36 
37 #include <string>
38 
39 #ifndef KIM_LOG_DEFINES_INC_
40 #include "KIM_LOG_DEFINES.inc"
41 #endif
42 
43 namespace KIM
44 {
55 {
56  public:
67 
71  LogVerbosity();
72 
78  LogVerbosity(int const id);
79 
88  LogVerbosity(std::string const & str);
89 
98  bool Known() const;
99 
105  bool operator<(LogVerbosity const & rhs) const;
106 
113  bool operator>(LogVerbosity const & rhs) const;
114 
121  bool operator<=(LogVerbosity const & rhs) const;
122 
129  bool operator>=(LogVerbosity const & rhs) const;
130 
138  bool operator==(LogVerbosity const & rhs) const;
139 
147  bool operator!=(LogVerbosity const & rhs) const;
148 
159  std::string const & ToString() const;
160 }; // class LogVerbosity
161 
164 namespace LOG_VERBOSITY
165 {
175 extern LogVerbosity const silent;
176 
188 extern LogVerbosity const fatal;
189 
201 extern LogVerbosity const error;
202 
217 extern LogVerbosity const warning;
218 
231 extern LogVerbosity const information;
232 
245 extern LogVerbosity const debug;
246 
247 
258 void GetNumberOfLogVerbosities(int * const numberOfLogVerbosities);
259 
274 int GetLogVerbosity(int const index, LogVerbosity * const logVerbosity);
275 
280 {
285  bool operator()(LogVerbosity const & a, LogVerbosity const & b) const
286  {
287  return a.logVerbosityID < b.logVerbosityID;
288  }
289 }; // struct Comparator
290 } // namespace LOG_VERBOSITY
291 } // namespace KIM
292 
293 #endif // KIM_LOG_VERBOSITY_HPP_
int GetLogVerbosity(int const index, LogVerbosity *const logVerbosity)
Get the identity of each defined standard LogVerbosity.
bool operator<(LogVerbosity const &rhs) const
Compares LogVerbosity objects for less-than.
std::string const & ToString() const
Converts the object to a string.
LogVerbosity const information
The standard information verbosity.
bool operator<=(LogVerbosity const &rhs) const
Compares LogVerbosity objects for less-than-equal.
LogVerbosity()
Create an uninitialized LogVerbosity object.
int logVerbosityID
Integer identifying the specific LogVerbosity represented.
LogVerbosity const debug
The standard debug verbosity.
LogVerbosity const silent
The standard silent verbosity.
void GetNumberOfLogVerbosities(int *const numberOfLogVerbosities)
Get the number of standard LogVerbosity&#39;s defined by the KIM API.
bool operator!=(LogVerbosity const &rhs) const
Compares LogVerbosity objects for inequality.
An Extensible Enumeration for the LogVerbosity&#39;s supported by the KIM API.
bool operator>=(LogVerbosity const &rhs) const
Compares LogVerbosity objects for greater-than-equal.
LogVerbosity const warning
The standard warning verbosity.
Structure provided for use with std::map.
bool operator>(LogVerbosity const &rhs) const
Compares LogVerbosity objects for greater-than.
bool operator==(LogVerbosity const &rhs) const
Compares LogVerbosity objects for equality.
bool Known() const
Determines if the object is a quantity known to the KIM API.
LogVerbosity const fatal
The standard fatal verbosity.
bool operator()(LogVerbosity const &a, LogVerbosity const &b) const
Provides an (logically unmeaningful) ordering for LogVerbosity objects so that they can be stored in ...
LogVerbosity const error
The standard error verbosity.