kim-api  2.1.2+v2.1.2.GNU
An Application Programming Interface (API) for the Knowledgebase of Interatomic Models (KIM).
KIM_Numbering.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_NUMBERING_HPP_
35 #define KIM_NUMBERING_HPP_
36 
37 #include <string>
38 
39 namespace KIM
40 {
49 class Numbering
50 {
51  public:
62 
66  Numbering();
67 
73  Numbering(int const id);
74 
82  Numbering(std::string const & str);
83 
91  bool Known() const;
92 
100  bool operator==(Numbering const & rhs) const;
101 
109  bool operator!=(Numbering const & rhs) const;
110 
121  std::string const & ToString() const;
122 }; // class Numbering
123 
126 namespace NUMBERING
127 {
135 extern Numbering const zeroBased;
136 
144 extern Numbering const oneBased;
145 
146 
157 void GetNumberOfNumberings(int * const numberOfNumberings);
158 
172 int GetNumbering(int const index, Numbering * const numbering);
173 
178 {
183  bool operator()(Numbering const & a, Numbering const & b) const
184  {
185  return a.numberingID < b.numberingID;
186  }
187 }; // struct Comparator
188 } // namespace NUMBERING
189 } // namespace KIM
190 
191 #endif // KIM_NUMBERING_HPP_
Numbering const oneBased
The standard oneBased numbering.
bool operator()(Numbering const &a, Numbering const &b) const
Provides an (logically unmeaningful) ordering for Numbering objects so that they can be stored in a s...
bool Known() const
Determines if the object is a quantity known to the KIM API.
An Extensible Enumeration for the Numbering&#39;s supported by the KIM API.
int numberingID
Integer identifying the specific Numbering represented.
void GetNumberOfNumberings(int *const numberOfNumberings)
Get the number of standard Numbering&#39;s defined by the KIM API.
int GetNumbering(int const index, Numbering *const numbering)
Get the identity of each defined standard Numbering.
Structure provided for use with std::map.
bool operator==(Numbering const &rhs) const
Compares Numbering objects for equality.
std::string const & ToString() const
Converts the object to a string.
Numbering const zeroBased
The standard zeroBased numbering.
Numbering()
Create an uninitialized Numbering object.
bool operator!=(Numbering const &rhs) const
Compares Numbering objects for inequality.