kim-api  2.1.2+v2.1.2.GNU
An Application Programming Interface (API) for the Knowledgebase of Interatomic Models (KIM).
KIM_ChargeUnit.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_CHARGE_UNIT_HPP_
35 #define KIM_CHARGE_UNIT_HPP_
36 
37 #include <string>
38 
39 namespace KIM
40 {
50 {
51  public:
61 
65  ChargeUnit();
66 
72  ChargeUnit(int const id);
73 
81  ChargeUnit(std::string const & str);
82 
91  bool Known() const;
92 
100  bool operator==(ChargeUnit const & rhs) const;
101 
109  bool operator!=(ChargeUnit const & rhs) const;
110 
121  std::string const & ToString() const;
122 }; // class ChargeUnit
123 
126 namespace CHARGE_UNIT
127 {
133 extern ChargeUnit const unused;
134 
140 extern ChargeUnit const C;
141 
147 extern ChargeUnit const e;
148 
154 extern ChargeUnit const statC;
155 
156 
166 void GetNumberOfChargeUnits(int * const numberOfChargeUnits);
167 
182 int GetChargeUnit(int const index, ChargeUnit * const chargeUnit);
183 
188 {
193  bool operator()(ChargeUnit const & a, ChargeUnit const & b) const
194  {
195  return a.chargeUnitID < b.chargeUnitID;
196  }
197 }; // struct Comparator
198 } // namespace CHARGE_UNIT
199 } // namespace KIM
200 
201 #endif // KIM_CHARGE_UNIT_HPP_
bool operator==(ChargeUnit const &rhs) const
Compares ChargeUnit objects for equality.
bool Known() const
Determines if the object is a quantity known to the KIM API.
ChargeUnit const unused
Indicates that a ChargeUnit is not used.
ChargeUnit()
Create an uninitialized ChargeUnit object.
ChargeUnit const e
The standard electron unit of charge.
Structure provided for use with std::map.
ChargeUnit const statC
The standard statcoulomb unit of charge.
ChargeUnit const C
The standard Coulomb unit of charge.
bool operator!=(ChargeUnit const &rhs) const
Compares ChargeUnit objects for inequality.
std::string const & ToString() const
Converts the object to a string.
int chargeUnitID
Integer identifying the specific ChargeUnit represented.
bool operator()(ChargeUnit const &a, ChargeUnit const &b) const
Provides an (logically unmeaningful) ordering for ChargeUnit objects so that they can be stored in a ...
An Extensible Enumeration for the ChargeUnit&#39;s supported by the KIM API.
void GetNumberOfChargeUnits(int *const numberOfChargeUnits)
Get the number of standard ChargeUnit&#39;s defined by the KIM API.
int GetChargeUnit(int const index, ChargeUnit *const chargeUnit)
Get the identity of each defined standard ChargeUnit.