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_Collections.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_COLLECTIONS_HPP_
35 #define KIM_COLLECTIONS_HPP_
36 
37 #include <string>
38 
39 namespace KIM
40 {
41 // Forward declarations
42 class LogVerbosity;
43 class Collection;
44 class CollectionItemType;
45 class CollectionsImplementation;
46 
114 {
115  public:
128  static int Create(Collections ** const collections);
129 
143  static void Destroy(Collections ** const collections);
144 
165  int GetItemType(std::string const & itemName,
166  CollectionItemType * const itemType) const;
167 
191  std::string const & itemName,
192  std::string const ** const fileName,
193  Collection * const collection) const;
194 
212  std::string const & itemName,
213  int * const extent);
214 
256  int GetItemMetadataFile(int const index,
257  std::string const ** const fileName,
258  unsigned int * const fileLength,
259  unsigned char const ** const fileRawData,
260  int * const availableAsString,
261  std::string const ** const fileString) const;
262 
279  int * const extent);
280 
302  int GetItemNameByType(int const index,
303  std::string const ** const itemName) const;
304 
323  CollectionItemType const itemType,
324  int * const extent);
325 
348  int GetItemNameByCollectionAndType(int const index,
349  std::string const ** const itemName) const;
350 
372  Collection const collection,
373  CollectionItemType const itemType,
374  std::string const & itemName,
375  std::string const ** const fileName) const;
376 
396  Collection const collection,
397  CollectionItemType const itemType,
398  std::string const & itemName,
399  int * const extent);
400 
445  int const index,
446  std::string const ** const fileName,
447  unsigned int * const fileLength,
448  unsigned char const ** const fileRawData,
449  int * const availableAsString,
450  std::string const ** const fileString) const;
451 
452 
471  void GetProjectNameAndSemVer(std::string const ** const projectName,
472  std::string const ** const semVer) const;
473 
490  std::string const ** const name) const;
491 
513  std::string const ** const name, std::string const ** const value) const;
514 
532  void GetConfigurationFileName(std::string const ** const fileName) const;
533 
551  int CacheListOfDirectoryNames(Collection const collection,
552  CollectionItemType const itemType,
553  int * const extent);
554 
576  int GetDirectoryName(int const index,
577  std::string const ** const directoryName) const;
578 
587  void SetLogID(std::string const & logID);
588 
598  void PushLogVerbosity(LogVerbosity const logVerbosity);
599 
607  void PopLogVerbosity();
608 
609  private:
610  // do not allow copy constructor or operator=
611  Collections(Collections const &);
612  void operator=(Collections const &);
613 
614  Collections();
615  ~Collections();
616 
617  CollectionsImplementation * pimpl;
618 }; // class Collections
619 } // namespace KIM
620 
621 #endif // KIM_COLLECTIONS_HPP_
int CacheListOfItemMetadataFiles(CollectionItemType const itemType, std::string const &itemName, int *const extent)
Cache a list of an item&#39;s metadata files.
int GetItemLibraryFileNameAndCollection(CollectionItemType const itemType, std::string const &itemName, std::string const **const fileName, Collection *const collection) const
Get the item&#39;s library file name and its KIM::Collection.
int CacheListOfItemNamesByCollectionAndType(Collection const collection, CollectionItemType const itemType, int *const extent)
Cache a list of all item names of a specific type in a specific collection.
int GetItemNameByType(int const index, std::string const **const itemName) const
Get the name of an item from the cached list.
int GetEnvironmentVariableName(CollectionItemType const itemType, std::string const **const name) const
Get the names of environment variables that store configuration settings for the KIM::COLLECTION::env...
void SetLogID(std::string const &logID)
Set the identity of the Log object associated with the Collections object.
void PushLogVerbosity(LogVerbosity const logVerbosity)
Push a new LogVerbosity onto the Collections object&#39;s Log object verbosity stack. ...
static int Create(Collections **const collections)
Create a new KIM API Collections object.
Provides the interface to the KIM API Collections and is meant to be used by simulators.
An Extensible Enumeration for the CollectionItemType&#39;s supported by the KIM API.
static void Destroy(Collections **const collections)
Destroy a previously Collections::Create&#39;d object.
int GetItemLibraryFileNameByCollectionAndType(Collection const collection, CollectionItemType const itemType, std::string const &itemName, std::string const **const fileName) const
Get the item&#39;s library file name.
An Extensible Enumeration for the LogVerbosity&#39;s supported by the KIM API.
void GetConfigurationFileEnvironmentVariable(std::string const **const name, std::string const **const value) const
Get the name and value of the environment variable that stores the name of the KIM API user configura...
An Extensible Enumeration for the Collection&#39;s supported by the KIM API.
int GetDirectoryName(int const index, std::string const **const directoryName) const
Get the name of a directory from the cached list.
int CacheListOfItemNamesByType(CollectionItemType const itemType, int *const extent)
Cache a list of all item names of a specific type in the KIM API collections.
int GetItemMetadataFileByCollectionAndType(int const index, std::string const **const fileName, unsigned int *const fileLength, unsigned char const **const fileRawData, int *const availableAsString, std::string const **const fileString) const
Get the name and content of one of an item&#39;s metadata files.
void PopLogVerbosity()
Pop a LogVerbosity from the Collections object&#39;s Log object verbosity stack.
int GetItemType(std::string const &itemName, CollectionItemType *const itemType) const
Get the KIM::CollectionItemType of the item in the KIM API collections with a specific name...
int GetItemNameByCollectionAndType(int const index, std::string const **const itemName) const
Get the name of an item from the cached list.
void GetProjectNameAndSemVer(std::string const **const projectName, std::string const **const semVer) const
Get the KIM API project name and full Semantic Version string.
int CacheListOfItemMetadataFilesByCollectionAndType(Collection const collection, CollectionItemType const itemType, std::string const &itemName, int *const extent)
Cache a list of an item&#39;s metadata files.
void GetConfigurationFileName(std::string const **const fileName) const
Get the absolute file and path name of the KIM API user configuration file.
int GetItemMetadataFile(int const index, std::string const **const fileName, unsigned int *const fileLength, unsigned char const **const fileRawData, int *const availableAsString, std::string const **const fileString) const
Get the name and content of one of an item&#39;s metadata files.
int CacheListOfDirectoryNames(Collection const collection, CollectionItemType const itemType, int *const extent)
Cache a list of directory names where a specific KIM API collection stores library files for a specif...