kim-api  2.1.4-git+v2.1.3-git-3-g4c859c7f.GNU
An Application Programming Interface (API) for the Knowledgebase of Interatomic Models (KIM).
KIM_Collection.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_COLLECTION_HPP_
35 #define KIM_COLLECTION_HPP_
36 
37 #include <string>
38 
39 namespace KIM
40 {
50 {
51  public:
62 
66  Collection();
67 
73  Collection(int const id);
74 
82  Collection(std::string const & str);
83 
91  bool Known() const;
92 
100  bool operator==(Collection const & rhs) const;
101 
110  bool operator!=(Collection const & rhs) const;
111 
122  std::string const & ToString() const;
123 }; // class Collection
124 
127 namespace COLLECTION
128 {
136 extern Collection const system;
137 
146 extern Collection const user;
147 
156 extern Collection const environmentVariable;
157 
167 
168 
178 void GetNumberOfCollections(int * const numberOfCollections);
179 
193 int GetCollection(int const index, Collection * const collection);
194 
199 {
204  bool operator()(Collection const & a, Collection const & b) const
205  {
206  return a.collectionID < b.collectionID;
207  }
208 }; // struct Comparator
209 } // namespace COLLECTION
210 } // namespace KIM
211 
212 #endif // KIM_COLLECTION_HPP_
bool operator()(Collection const &a, Collection const &b) const
Provides an (logically unmeaningful) ordering for Collection objects so that they can be stored in a ...
int collectionID
Integer identifying the specific Collection represented.
Collection const currentWorkingDirectory
The standard currentWorkingDirectory Collection.
void GetNumberOfCollections(int *const numberOfCollections)
Get the number of standard Collection&#39;s defined by the KIM API.
bool operator!=(Collection const &rhs) const
Compares Collection objects for inequality.
Collection const user
The standard user Collection.
std::string const & ToString() const
Converts the object to a string.
Collection const environmentVariable
The standard environmentVariable Collection.
int GetCollection(int const index, Collection *const collection)
Get the identity of each defined standard Collection.
bool operator==(Collection const &rhs) const
Compares Collection objects for equality.
An Extensible Enumeration for the Collection&#39;s supported by the KIM API.
Structure provided for use with std::map.
Collection()
Create an uninitialized Collection object.
bool Known() const
Determines if the object is a quantity known to the KIM API.
Collection const system
The standard system Collection.