kim-api  2.1.4-git+v2.1.3-git-1-g7847914a.GNU
An Application Programming Interface (API) for the Knowledgebase of Interatomic Models (KIM).
KIM_LengthUnit.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.git repository.
31 //
32 
33 
34 #ifndef KIM_LENGTH_UNIT_HPP_
35 #define KIM_LENGTH_UNIT_HPP_
36 
37 #include <string>
38 
39 namespace KIM
40 {
50 {
51  public:
62 
66  LengthUnit();
67 
73  LengthUnit(int const id);
74 
82  LengthUnit(std::string const & str);
83 
92  bool Known() const;
93 
101  bool operator==(LengthUnit const & rhs) const;
102 
110  bool operator!=(LengthUnit const & rhs) const;
111 
122  std::string const & ToString() const;
123 }; // class LengthUnit
124 
127 namespace LENGTH_UNIT
128 {
134 extern LengthUnit const unused;
135 
141 extern LengthUnit const A;
142 
148 extern LengthUnit const Bohr;
149 
155 extern LengthUnit const cm;
156 
162 extern LengthUnit const m;
163 
169 extern LengthUnit const nm;
170 
180 void GetNumberOfLengthUnits(int * const numberOfLengthUnits);
181 
196 int GetLengthUnit(int const index, LengthUnit * const lengthUnit);
197 
202 {
207  bool operator()(LengthUnit const & a, LengthUnit const & b) const
208  {
209  return a.lengthUnitID < b.lengthUnitID;
210  }
211 }; // struct Comparator
212 } // namespace LENGTH_UNIT
213 } // namespace KIM
214 
215 #endif // KIM_LENGTH_UNIT_HPP_
int GetLengthUnit(int const index, LengthUnit *const lengthUnit)
Get the identity of each defined standard LengthUnit.
void GetNumberOfLengthUnits(int *const numberOfLengthUnits)
Get the number of standard LengthUnit&#39;s defined by the KIM API.
LengthUnit()
Create an uninitialized LengthUnit object.
bool operator==(LengthUnit const &rhs) const
Compares LengthUnit objects for equality.
LengthUnit const nm
The standard nanometer unit of length.
LengthUnit const unused
Indicates that a LengthUnit is not used.
LengthUnit const Bohr
The standard Bohr unit of length.
An Extensible Enumeration for the LengthUnit&#39;s supported by the KIM API.
bool operator!=(LengthUnit const &rhs) const
Compares LengthUnit objects for inequality.
LengthUnit const m
The standard meter unit of length.
LengthUnit const A
The standard angstrom unit of length.
bool Known() const
Determines if the object is a quantity known to the KIM API.
bool operator()(LengthUnit const &a, LengthUnit const &b) const
Provides an (logically unmeaningful) ordering for LengthUnit objects so that they can be stored in a ...
LengthUnit const cm
The standard centimeter unit of length.
int lengthUnitID
Integer identifying the specific LengthUnit represented.
std::string const & ToString() const
Converts the object to a string.
Structure provided for use with std::map.