![]() |
LibraryLink Utilities
3.0.1
Modern C++ wrapper over LibraryLink and WSTP
|
Small class that wraps a reference to MArgument and provides proper API to work with this MArgument.
| T | - any value of type MArgumentType |
#include <MArgument.h>
Public Types | |
| using | value_type = Argument::CType< T > |
This is the actual type of data stored in arg. More... | |
Public Member Functions | |
| PrimitiveWrapper (MArgument &a) | |
| Construct PrimitiveWrapper from a reference to MArgument. More... | |
| value_type & | get () |
| Get the value stored in MArgument. More... | |
| const value_type & | get () const |
| Get the read-only value stored in MArgument. More... | |
| value_type * | getAddress () const |
| Get address of the value stored in MArgument. More... | |
| void | set (value_type newValue) |
| Set new value of type T in MArgument. More... | |
| void | addToDataStore (DataStore ds, const std::string &name, MArgumentType actualType=T) const |
Add arg to the DataStore ds inside a node named name The optional parameter should only be used by explicit specialization of this function for T equal to MArgumentType::MArgument. More... | |
Static Public Member Functions | |
| static void | addDataStoreNode (DataStore ds, std::string_view name, value_type val) |
Add val to the DataStore ds inside a node named name This is a static method because there is no MArgument involved. More... | |
| static void | addDataStoreNode (DataStore ds, value_type val) |
Add val to the DataStore ds inside an unnamed node This is a static method because there is no MArgument involved. More... | |
| using LLU::PrimitiveWrapper< T >::value_type = Argument::CType<T> |
This is the actual type of data stored in arg.
|
inlineexplicit |
Construct PrimitiveWrapper from a reference to MArgument.
| a | - reference to MArgument |
|
static |
Add val to the DataStore ds inside a node named name This is a static method because there is no MArgument involved.
| ds | - DataStore with values of type T |
| name | - name for the new node in the DataStore |
| val | - value of the new node in the DataStore |
|
static |
Add val to the DataStore ds inside an unnamed node This is a static method because there is no MArgument involved.
| ds | - DataStore with values of type T |
| val | - value of the new node in the DataStore |
| void LLU::PrimitiveWrapper< T >::addToDataStore | ( | DataStore | ds, |
| const std::string & | name, | ||
| MArgumentType | actualType = T |
||
| ) | const |
Add arg to the DataStore ds inside a node named name The optional parameter should only be used by explicit specialization of this function for T equal to MArgumentType::MArgument.
| ds | - DataStore with values of type T |
| name | - name for the new node in the DataStore |
| actualType | - actual type of the value stored, it is always T except in generic case where T is MArgumentType::MArgument |
| value_type& LLU::PrimitiveWrapper< T >::get | ( | ) |
Get the value stored in MArgument.
| const value_type& LLU::PrimitiveWrapper< T >::get | ( | ) | const |
Get the read-only value stored in MArgument.
| value_type* LLU::PrimitiveWrapper< T >::getAddress | ( | ) | const |
Get address of the value stored in MArgument.
Every MArgument actually stores a pointer.
| void LLU::PrimitiveWrapper< T >::set | ( | value_type | newValue | ) |
Set new value of type T in MArgument.
Memory management is entirely user's responsibility.
| newValue | - new value to be written to MArgument arg |