kim-api 2.4.1+AppleClang.AppleClang.GNU
An Application Programming Interface (API) for the Knowledgebase of Interatomic Models (KIM).
 
Loading...
Searching...
No Matches
KIM_Collections.hpp
Go to the documentation of this file.
1//
2// KIM-API: An API for interatomic models
3// Copyright (c) 2013--2022, Regents of the University of Minnesota.
4// All rights reserved.
5//
6// Contributors:
7// Ryan S. Elliott
8//
9// SPDX-License-Identifier: LGPL-2.1-or-later
10//
11// This library is free software; you can redistribute it and/or
12// modify it under the terms of the GNU Lesser General Public
13// License as published by the Free Software Foundation; either
14// version 2.1 of the License, or (at your option) any later version.
15//
16// This library is distributed in the hope that it will be useful,
17// but WITHOUT ANY WARRANTY; without even the implied warranty of
18// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19// Lesser General Public License for more details.
20//
21// You should have received a copy of the GNU Lesser General Public License
22// along with this library; if not, write to the Free Software Foundation,
23// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
24//
25
26//
27// Release: This file is part of the kim-api-2.4.1 package.
28//
29
30
31#ifndef KIM_COLLECTIONS_HPP_
32#define KIM_COLLECTIONS_HPP_
33
34#include <string>
35
36namespace KIM
37{
38// Forward declarations
39class LogVerbosity;
40class Collection;
42class CollectionsImplementation;
43
110class Collections
111{
112 public:
125 static int Create(Collections ** const collections);
126
140 static void Destroy(Collections ** const collections);
141
162 int GetItemType(std::string const & itemName,
163 CollectionItemType * const itemType) const;
164
188 std::string const & itemName,
189 std::string const ** const fileName,
190 Collection * const collection) const;
191
209 std::string const & itemName,
210 int * const extent);
211
253 int GetItemMetadataFile(int const index,
254 std::string const ** const fileName,
255 unsigned int * const fileLength,
256 unsigned char const ** const fileRawData,
257 int * const availableAsString,
258 std::string const ** const fileString) const;
259
276 int * const extent);
277
299 int GetItemNameByType(int const index,
300 std::string const ** const itemName) const;
301
320 CollectionItemType const itemType,
321 int * const extent);
322
346 std::string const ** const itemName) const;
347
369 Collection const collection,
370 CollectionItemType const itemType,
371 std::string const & itemName,
372 std::string const ** const fileName) const;
373
393 Collection const collection,
394 CollectionItemType const itemType,
395 std::string const & itemName,
396 int * const extent);
397
442 int const index,
443 std::string const ** const fileName,
444 unsigned int * const fileLength,
445 unsigned char const ** const fileRawData,
446 int * const availableAsString,
447 std::string const ** const fileString) const;
448
449
468 void GetProjectNameAndSemVer(std::string const ** const projectName,
469 std::string const ** const semVer) const;
470
487 std::string const ** const name) const;
488
510 std::string const ** const name, std::string const ** const value) const;
511
529 void GetConfigurationFileName(std::string const ** const fileName) const;
530
549 CollectionItemType const itemType,
550 int * const extent);
551
573 int GetDirectoryName(int const index,
574 std::string const ** const directoryName) const;
575
584 void SetLogID(std::string const & logID);
585
595 void PushLogVerbosity(LogVerbosity const logVerbosity);
596
605
606 private:
607 // do not allow copy constructor or operator=
608 Collections(Collections const &);
609 void operator=(Collections const &);
610
611 Collections();
612 ~Collections();
613
614 CollectionsImplementation * pimpl;
615}; // class Collections
616} // namespace KIM
617
618#endif // KIM_COLLECTIONS_HPP_
An Extensible Enumeration for the Collection's supported by the KIM API.
An Extensible Enumeration for the CollectionItemType's supported by the KIM API.
int GetItemLibraryFileNameByCollectionAndType(Collection const collection, CollectionItemType const itemType, std::string const &itemName, std::string const **const fileName) const
Get the item's library file name.
void PopLogVerbosity()
Pop a LogVerbosity from the Collections object's Log object verbosity stack.
int GetItemNameByType(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.
void PushLogVerbosity(LogVerbosity const logVerbosity)
Push a new LogVerbosity onto the Collections object's Log object verbosity stack.
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 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...
int GetItemLibraryFileNameAndCollection(CollectionItemType const itemType, std::string const &itemName, std::string const **const fileName, Collection *const collection) const
Get the item's library file name and its KIM::Collection.
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 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's metadata files.
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 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 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's metadata files.
int GetDirectoryName(int const index, std::string const **const directoryName) const
Get the name of a directory from the cached list.
static int Create(Collections **const collections)
Create a new KIM API Collections object.
void SetLogID(std::string const &logID)
Set the identity of the Log object associated with the Collections object.
int CacheListOfItemMetadataFilesByCollectionAndType(Collection const collection, CollectionItemType const itemType, std::string const &itemName, int *const extent)
Cache a list of an item'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 GetItemNameByCollectionAndType(int const index, std::string const **const itemName) const
Get the name of an item from the cached list.
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...
int CacheListOfItemMetadataFiles(CollectionItemType const itemType, std::string const &itemName, int *const extent)
Cache a list of an item's metadata files.
static void Destroy(Collections **const collections)
Destroy a previously Collections::Create'd object.
An Extensible Enumeration for the LogVerbosity's supported by the KIM API.