#include <Variable.h>
|
| ArrayVariable (const std::string varname, const std::string vartype) |
|
| ~ArrayVariable () |
|
bool | isArray () |
| Report that the varaible is an array.
|
|
size_t | typesize () const |
|
size_t | size () const |
|
void * | get () |
|
void | set (void *ptr) |
|
PyObject * | getPythonObject (int i0=0, int n=0) |
|
bool | setFromPythonObject (PyObject *obj, int i0=0, int n=0) |
|
const std::string | asString () |
|
const std::string | asString (size_t i) |
|
| Variable (const std::string varname, const std::string vartype) |
| Constructor.
|
|
virtual | ~Variable () |
| Destructor.
|
|
virtual bool | isArray ()=0 |
| Let efficiently know whether the variable is an array or not.
|
|
virtual bool | isScalar () |
| Let efficiently know whether the variable is a scalar or not.
|
|
std::string | name () const |
| Name of the variable.
|
|
virtual std::string | type () const |
| Type of the variable.
|
|
virtual size_t | typesize () const |
| Get the variable type size.
|
|
virtual size_t | size () const |
| Get the variable type size.
|
|
virtual void * | get () |
| Get variable pointer basis pointer.
|
|
virtual void | set (void *ptr)=0 |
| Set variable from memory.
|
|
virtual PyObject * | getPythonObject (int i0=0, int n=0) |
| Get a Python interpretation of the variable.
|
|
virtual bool | setFromPythonObject (PyObject *obj, int i0=0, int n=0) |
| Set the variable from a Python object.
|
|
virtual const std::string | asString () |
| Get the variable text representation.
|
|
void | setEvent (cl_event event) |
| Set the variable current event.
|
|
cl_event | getEvent () |
| Returns the last event associated to this variable.
|
|
|
void | sync () |
| Wait for variable underlying event to be complete.
|
|
◆ ArrayVariable()
Aqua::InputOutput::ArrayVariable::ArrayVariable |
( |
const std::string |
varname, |
|
|
const std::string |
vartype |
|
) |
| |
Constructor.
- Parameters
-
varname | Name of the variable. |
vartype | Type of the variable. |
◆ ~ArrayVariable()
Aqua::InputOutput::ArrayVariable::~ArrayVariable |
( |
| ) |
|
◆ asString() [1/2]
const std::string Aqua::InputOutput::ArrayVariable::asString |
( |
| ) |
|
|
virtual |
Get the variable text representation
- Returns
- The variable represented as a string, NULL in case of errors.
Reimplemented from Aqua::InputOutput::Variable.
◆ asString() [2/2]
const std::string Aqua::InputOutput::ArrayVariable::asString |
( |
size_t |
i | ) |
|
Get a component text representation
- Parameters
-
i | Index of the component to be extracted. |
- Returns
- The component represented as a string, NULL in case of errors.
◆ get()
void * Aqua::InputOutput::ArrayVariable::get |
( |
| ) |
|
|
inlinevirtual |
◆ getPythonObject()
PyObject * Aqua::InputOutput::ArrayVariable::getPythonObject |
( |
int |
i0 = 0 , |
|
|
int |
n = 0 |
|
) |
| |
|
virtual |
Get a PyArrayObject interpretation of the variable
- Parameters
-
i0 | First component to be read. |
n | Number of component to be read, 0 to read all available memory, i.e. All the array after i0. |
- Returns
- PyArrayObject Python object. NULL if the memory cannot be read.
Reimplemented from Aqua::InputOutput::Variable.
◆ isArray()
bool Aqua::InputOutput::ArrayVariable::isArray |
( |
| ) |
|
|
inlinevirtual |
◆ set()
void Aqua::InputOutput::ArrayVariable::set |
( |
void * |
ptr | ) |
|
|
inlinevirtual |
◆ setFromPythonObject()
bool Aqua::InputOutput::ArrayVariable::setFromPythonObject |
( |
PyObject * |
obj, |
|
|
int |
i0 = 0 , |
|
|
int |
n = 0 |
|
) |
| |
|
virtual |
Set the variable from a Python object
- Parameters
-
obj | PyArrayObject object. |
i0 | ignored parameter. |
n | ignored parameter |
- Returns
- false if all gone right, true otherwise.
Reimplemented from Aqua::InputOutput::Variable.
◆ size()
size_t Aqua::InputOutput::ArrayVariable::size |
( |
| ) |
const |
|
virtual |
Get the array size.
- Returns
- Array allocated memory (in bytes)
- Note
- In order to get the length of the array the command size() / Variables::typeToBytes(type()) can be used
Reimplemented from Aqua::InputOutput::Variable.
◆ typesize()
size_t Aqua::InputOutput::ArrayVariable::typesize |
( |
| ) |
const |
|
inlinevirtual |
The documentation for this class was generated from the following files: