kim-api  2.1.3+v2.1.3.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.3 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:
62 
66  ChargeUnit();
67 
73  ChargeUnit(int const id);
74 
82  ChargeUnit(std::string const & str);
83 
92  bool Known() const;
93 
101  bool operator==(ChargeUnit const & rhs) const;
102 
110  bool operator!=(ChargeUnit const & rhs) const;
111 
122  std::string const & ToString() const;
123 }; // class ChargeUnit
124 
127 namespace CHARGE_UNIT
128 {
134 extern ChargeUnit const unused;
135 
141 extern ChargeUnit const C;
142 
148 extern ChargeUnit const e;
149 
155 extern ChargeUnit const statC;
156 
157 
167 void GetNumberOfChargeUnits(int * const numberOfChargeUnits);
168 
183 int GetChargeUnit(int const index, ChargeUnit * const chargeUnit);
184 
189 {
194  bool operator()(ChargeUnit const & a, ChargeUnit const & b) const
195  {
196  return a.chargeUnitID < b.chargeUnitID;
197  }
198 }; // struct Comparator
199 } // namespace CHARGE_UNIT
200 } // namespace KIM
201 
202 #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.