FEDEM Solver  R8.0
Source code of the dynamics solver
FFrReadOp.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 
13 #ifndef FFR_READ_OP_H
14 #define FFR_READ_OP_H
15 
17 #ifdef FT_USE_MEMPOOL
18 #include "FFaLib/FFaPatterns/FFaMemPool.H"
19 #endif
20 
22 
23 
28 template <class RetType>
29 class FFrReadOp : public FFaOperation<RetType>
30 {
31 protected:
33  explicit FFrReadOp(FFrVariableReference* vr) : myRdbVar(vr) {}
34 
35 public:
37  static void create(FFrVariableReference* rdbVar, FFaOperationBase*& created)
38  {
39  created = new FFrReadOp<RetType>(rdbVar);
40  }
41 
43  bool hasData() const override;
45  bool evaluate(RetType& value) override;
46 
47 private:
49 
50 #ifdef FT_USE_MEMPOOL
51  FFA_MAKE_MEMPOOL;
52 #endif
53 };
54 
55 #ifdef FT_USE_MEMPOOL
57 template <class RetType>
58 FFaMemPool FFrReadOp<RetType>::ourMemPool = FFaMemPool(sizeof(FFrReadOp<RetType>),
59  FFaOperationBase::getMemPoolMgr());
61 #endif
62 
63 #endif
Classes that make up the core of a operation/transformation system.
Base class for all operations.
Definition: FFaOperation.H:38
The base class used as argument in other operations.
Definition: FFaOperation.H:76
Template class representing an operation for reading a result variable.
Definition: FFrReadOp.H:30
static void create(FFrVariableReference *rdbVar, FFaOperationBase *&created)
Static method for instantiating a read operation for rdbVar.
Definition: FFrReadOp.H:37
bool evaluate(RetType &value) override
Invokes the actual read operation.
Definition: FFrReadOpImpl.C:141
FFrVariableReference * myRdbVar
The variable to receive the data read.
Definition: FFrReadOp.H:48
bool hasData() const override
Checks if this operation will retun any data,.
Definition: FFrReadOpImpl.C:134
FFrReadOp(FFrVariableReference *vr)
The constructor initializes myRdbVar.
Definition: FFrReadOp.H:33
Class representing a variable reference in a result file hierarchy.
Definition: FFrVariableReference.H:30