FEDEM Solver  R8.0
Source code of the dynamics solver
FFaMathVar.H
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2023 SAP SE
2 //
3 // SPDX-License-Identifier: Apache-2.0
4 //
5 // This file is part of FEDEM - https://openfedem.org
7 
8 #ifndef FFA_MATH_VAR_H
9 #define FFA_MATH_VAR_H
10 
11 #include <cstddef>
12 
13 
15 {
16  double pval;
17 
18 public:
19  char* name;
20 
21  FFaMathVar() : pval(0.0), name(NULL) {}
22  FFaMathVar(const FFaMathVar&) = delete;
23  FFaMathVar(const char*);
24  ~FFaMathVar();
25 
26  void rename(const char*);
27  bool operator==(const FFaMathVar&) const;
28  FFaMathVar& operator=(double x) { pval = x; return *this; }
29  FFaMathVar& operator=(const FFaMathVar&) = delete;
30  operator double() const { return pval; }
31  const double* ptr() const { return &pval; }
32 };
33 
34 #endif
Definition: FFaMathVar.H:15
const double * ptr() const
Definition: FFaMathVar.H:31
FFaMathVar & operator=(double x)
Definition: FFaMathVar.H:28
FFaMathVar(const FFaMathVar &)=delete
double pval
Definition: FFaMathVar.H:16
bool operator==(const FFaMathVar &) const
Overload operator '=='.
Definition: FFaMathVar.C:52
FFaMathVar & operator=(const FFaMathVar &)=delete
~FFaMathVar()
Destructor for FFaMathVar.
Definition: FFaMathVar.C:26
FFaMathVar()
Definition: FFaMathVar.H:21
char * name
Definition: FFaMathVar.H:19
void rename(const char *)
Assign a new name to the variable.
Definition: FFaMathVar.C:37
integer(ptr), save, private x
Definition: extCtrlSysRoutinesModule.f90:16