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_LanguageName.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_LANGUAGE_NAME_HPP_
35 #define KIM_LANGUAGE_NAME_HPP_
36 
37 #include <string>
38 
39 namespace KIM
40 {
50 {
51  public:
62 
66  LanguageName();
67 
73  LanguageName(int const id);
74 
83  LanguageName(std::string const & str);
84 
93  bool Known() const;
94 
102  bool operator==(LanguageName const & rhs) const;
103 
111  bool operator!=(LanguageName const & rhs) const;
112 
123  std::string const & ToString() const;
124 }; // class LanguageName
125 
128 namespace LANGUAGE_NAME
129 {
137 extern LanguageName const cpp;
138 
146 extern LanguageName const c;
147 
156 extern LanguageName const fortran;
157 
158 
169 void GetNumberOfLanguageNames(int * const numberOfLanguageNames);
170 
185 int GetLanguageName(int const index, LanguageName * const languageName);
186 
191 {
196  bool operator()(LanguageName const & a, LanguageName const & b) const
197  {
198  return a.languageNameID < b.languageNameID;
199  }
200 }; // struct Comparator
201 } // namespace LANGUAGE_NAME
202 } // namespace KIM
203 
204 #endif // KIM_LANGUAGE_NAME_HPP_
LanguageName const fortran
The standard fortran language.
bool operator!=(LanguageName const &rhs) const
Compares LanguageName objects for inequality.
Structure provided for use with std::map.
LanguageName const c
The standard c language.
bool Known() const
Determines if the object is a quantity known to the KIM API.
LanguageName()
Create an uninitialized LanguageName object.
An Extensible Enumeration for the LanguageName&#39;s supported by the KIM API.
LanguageName const cpp
The standard cpp language.
bool operator==(LanguageName const &rhs) const
Compares LanguageName objects for equality.
std::string const & ToString() const
Converts the object to a string.
int GetLanguageName(int const index, LanguageName *const languageName)
Get the identity of each defined standard LanguageName.
int languageNameID
Integer identifying the specific LanguageName represented.
void GetNumberOfLanguageNames(int *const numberOfLanguageNames)
Get the number of standard LanguageName&#39;s defined by the KIM API.
bool operator()(LanguageName const &a, LanguageName const &b) const
Provides an (logically unmeaningful) ordering for LanguageName objects so that they can be stored in ...