kim-api  2.3.0+v2.3.0.GNU.GNU.
An Application Programming Interface (API) for the Knowledgebase of Interatomic Models (KIM).
KIM_ComputeArguments.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.3.0 package.
28 //
29 
30 
31 #ifndef KIM_COMPUTE_ARGUMENTS_HPP_
32 #define KIM_COMPUTE_ARGUMENTS_HPP_
33 
34 #include <string>
35 
36 #ifndef KIM_FUNCTION_TYPES_HPP_
37 #include "KIM_FunctionTypes.hpp" // IWYU pragma: export
38 #endif
39 
40 namespace KIM
41 {
42 // Forward declarations
43 class LogVerbosity;
44 class LanguageName;
45 class ComputeArgumentName;
46 class ComputeCallbackName;
47 class SupportStatus;
48 class ComputeArgumentsImplementation;
49 
50 
59 {
60  public:
73  int GetArgumentSupportStatus(ComputeArgumentName const computeArgumentName,
74  SupportStatus * const supportStatus) const;
75 
88  int GetCallbackSupportStatus(ComputeCallbackName const computeCallbackName,
89  SupportStatus * const supportStatus) const;
90 
109  int SetArgumentPointer(ComputeArgumentName const computeArgumentName,
110  int const * const ptr);
111 
113  int SetArgumentPointer(ComputeArgumentName const computeArgumentName,
114  int * const ptr);
115 
117  int SetArgumentPointer(ComputeArgumentName const computeArgumentName,
118  double const * const ptr);
119 
121  int SetArgumentPointer(ComputeArgumentName const computeArgumentName,
122  double * const ptr);
123 
143  int SetCallbackPointer(ComputeCallbackName const computeCallbackName,
144  LanguageName const languageName,
145  Function * const fptr,
146  void * const dataObject);
147 
159  void AreAllRequiredArgumentsAndCallbacksPresent(int * const result) const;
160 
173  void SetSimulatorBufferPointer(void * const ptr);
174 
175 
188  void GetSimulatorBufferPointer(void ** const ptr) const;
189 
201  std::string const & ToString() const;
202 
213  void SetLogID(std::string const & logID);
214 
224  void PushLogVerbosity(LogVerbosity const logVerbosity);
225 
233  void PopLogVerbosity();
234 
241  friend class ModelImplementation;
242 
243  private:
244  // do not allow copy constructor or operator=
246  void operator=(ComputeArguments const &);
247 
249  ~ComputeArguments();
250 
251  ComputeArgumentsImplementation * pimpl;
252 }; // class ComputeArguments
253 } // namespace KIM
254 
255 #endif // KIM_COMPUTE_ARGUMENTS_HPP_
int SetArgumentPointer(ComputeArgumentName const computeArgumentName, int const *const ptr)
Set the data pointer for a ComputeArgumentName.
void SetSimulatorBufferPointer(void *const ptr)
Set the Simulator&#39;s buffer pointer within the ComputeArguments object.
void AreAllRequiredArgumentsAndCallbacksPresent(int *const result) const
Determine if non-NULL pointers have been set for all ComputeArgumentName&#39;s and ComputeCallbackName&#39;s ...
std::string const & ToString() const
Get a string representing the internal state of the ComputeArguments object.
An Extensible Enumeration for the ComputeCallbackName&#39;s supported by the KIM API. ...
void PushLogVerbosity(LogVerbosity const logVerbosity)
Push a new LogVerbosity onto the ComputeArguments object&#39;s Log object verbosity stack.
void() Function(void)
Generic function type.
An Extensible Enumeration for the SupportStatus&#39;s supported by the KIM API.
int GetCallbackSupportStatus(ComputeCallbackName const computeCallbackName, SupportStatus *const supportStatus) const
Get the SupportStatus of a ComputeCallbackName.
An Extensible Enumeration for the LogVerbosity&#39;s supported by the KIM API.
An Extensible Enumeration for the LanguageName&#39;s supported by the KIM API.
friend class ModelImplementation
Allows Model objects to directly access private member data of a ComputeArguments object...
int GetArgumentSupportStatus(ComputeArgumentName const computeArgumentName, SupportStatus *const supportStatus) const
Get the SupportStatus of a ComputeArgumentName.
void PopLogVerbosity()
Pop a LogVerbosity from the ComputeArguments object&#39;s Log object verbosity stack. ...
An Extensible Enumeration for the ComputeArgumentName&#39;s supported by the KIM API. ...
Provides the primary interface to a KIM API ComputeArguments object and is meant to be used by simula...
void GetSimulatorBufferPointer(void **const ptr) const
Get the Simulator&#39;s buffer pointer from the ComputeArguments object.
int SetCallbackPointer(ComputeCallbackName const computeCallbackName, LanguageName const languageName, Function *const fptr, void *const dataObject)
Set the function pointer for a ComputeCallbackName.
void SetLogID(std::string const &logID)
Set the identity of the Log object associated with the ComputeArguments object.