![]() |
OGS
|
|
Cached pointers to the t, x, y, z symbol-table variables per thread. Eliminates string-based lookups during evaluation.
Definition at line 39 of file ExprtkUtils.h.
#include <ExprtkUtils.h>
Public Member Functions | |
| SymbolTableCache ()=default | |
| SymbolTableCache (exprtk::symbol_table< double > &symbol_table, bool spatial_position_is_required) | |
| void | reinitialize (exprtk::symbol_table< double > &symbol_table) |
| Re-caches pointers from a (possibly moved) symbol_table. | |
| void | setTimeAndPosition (double t, SpatialPosition const &pos) const |
Private Attributes | |
| bool | spatial_position_is_required_ = false |
| double * | t_ptr = nullptr |
| double * | x_ptr = nullptr |
| double * | y_ptr = nullptr |
| double * | z_ptr = nullptr |
|
default |
| ParameterLib::SymbolTableCache::SymbolTableCache | ( | exprtk::symbol_table< double > & | symbol_table, |
| bool | spatial_position_is_required ) |
Caches pointers to t and, if spatial_position_is_required, to x, y, z from symbol_table. The invariant x_ptr/y_ptr/z_ptr are non-null iff spatial_position_is_required is true is established here.
Definition at line 99 of file ExprtkUtils.cpp.
References reinitialize(), and spatial_position_is_required_.
| void ParameterLib::SymbolTableCache::reinitialize | ( | exprtk::symbol_table< double > & | symbol_table | ) |
Re-caches pointers from a (possibly moved) symbol_table.
Definition at line 106 of file ExprtkUtils.cpp.
References spatial_position_is_required_, t_ptr, x_ptr, y_ptr, and z_ptr.
Referenced by SymbolTableCache().
| void ParameterLib::SymbolTableCache::setTimeAndPosition | ( | double | t, |
| SpatialPosition const & | pos ) const |
Sets t and, when spatial variables were registered (x/y/z_ptr != nullptr), also sets x, y, z from pos.
Definition at line 13 of file ExprtkUtils.cpp.
References ParameterLib::SpatialPosition::getCoordinates(), OGS_FATAL, t_ptr, x_ptr, y_ptr, and z_ptr.
|
private |
Definition at line 57 of file ExprtkUtils.h.
Referenced by SymbolTableCache(), and reinitialize().
|
private |
Definition at line 58 of file ExprtkUtils.h.
Referenced by reinitialize(), and setTimeAndPosition().
|
private |
Definition at line 59 of file ExprtkUtils.h.
Referenced by reinitialize(), and setTimeAndPosition().
|
private |
Definition at line 60 of file ExprtkUtils.h.
Referenced by reinitialize(), and setTimeAndPosition().
|
private |
Definition at line 61 of file ExprtkUtils.h.
Referenced by reinitialize(), and setTimeAndPosition().