Template for convenience classes for inserting a numeric scalar into the AC space.
More...
|
| scalar_t (algo_comm_t &ac, const std::string &name, numeric_t val=0, bool insert_now=true) |
| Initialize memory and metadata of the AC variable. More...
|
|
| ~scalar_t () |
| Destroy the AC variable: deallocate its memory. More...
|
|
void | insert () |
| Insert or re-insert AC variable into AC space. More...
|
|
void | remove () |
| Remove the AC variable by reference from the AC variable space. More...
|
|
|
numeric_t | data |
| Numeric value of this AC variable. More...
|
|
template<typename numeric_t, unsigned int MHA_AC_TYPECODE>
class MHA_AC::scalar_t< numeric_t, MHA_AC_TYPECODE >
Template for convenience classes for inserting a numeric scalar into the AC space.
◆ scalar_t()
template<typename numeric_t , unsigned int MHA_AC_TYPECODE>
Initialize memory and metadata of the AC variable.
- Parameters
-
ac | AC handle |
name | Name of variable in AC space |
val | Initial value |
insert_now | If true, then the constructor inserts the new variable into the AC space, and the destructor will remove the variable from AC space when it executes. |
◆ ~scalar_t()
template<typename numeric_t , unsigned int MHA_AC_TYPECODE>
Destroy the AC variable: deallocate its memory.
If the constructor parameter insert_now was true, then the destruc- tor removes the AC variable from AC space when it executes.
◆ insert()
template<typename numeric_t , unsigned int MHA_AC_TYPECODE>
Insert or re-insert AC variable into AC space.
Plugins should call this method from their prepare() and process() functions.
◆ remove()
template<typename numeric_t , unsigned int MHA_AC_TYPECODE>
Remove the AC variable by reference from the AC variable space.
Plugins may call this method only from their prepare(), release() methods or their plugin destructor. It is not necessary to remove the AC variable from AC space at all if either another AC variable with the same name has replaced this variable before this variable is destroyed, or if no plugin will access this variable between its destruction and either its replacement or the MHA exit.
◆ data
template<typename numeric_t , unsigned int MHA_AC_TYPECODE>
Numeric value of this AC variable.
◆ ac
template<typename numeric_t , unsigned int MHA_AC_TYPECODE>
◆ name
template<typename numeric_t , unsigned int MHA_AC_TYPECODE>
Name of this AC variable in the AC variable space.
◆ remove_during_destructor
template<typename numeric_t , unsigned int MHA_AC_TYPECODE>
const bool MHA_AC::scalar_t< numeric_t, MHA_AC_TYPECODE >::remove_during_destructor |
|
private |
flag whether to remove from AC variable space in destructor.
The documentation for this class was generated from the following file: