AQUAgpusph 4.1.2
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions
Aqua::InputOutput::ScalarVecVariable< T > Class Template Reference

A generic Scalar variable, of 2 or more components. More...

#include <Variable.h>

Inheritance diagram for Aqua::InputOutput::ScalarVecVariable< T >:
Inheritance graph
[legend]
Collaboration diagram for Aqua::InputOutput::ScalarVecVariable< T >:
Collaboration graph
[legend]

Public Member Functions

 ScalarVecVariable (const std::string varname, const std::string vartype, const unsigned int dims)
 Constructor.
 
 ~ScalarVecVariable ()
 Destructor.
 
virtual const std::string asString ()
 Get the variable text representation.
 
- Public Member Functions inherited from Aqua::InputOutput::ScalarVariable< T >
 ScalarVariable (const std::string varname, const std::string vartype)
 Constructor.
 
 ~ScalarVariable ()
 Destructor.
 
bool isArray ()
 Report that the varaible is not an array.
 
size_t typesize () const
 Get the variable type size.
 
void * get ()
 Get variable pointer basis pointer.
 
void * get_async ()
 Get variable pointer basis pointer.
 
void set (void *ptr)
 Set variable from memory.
 
void set_async (void *ptr)
 Set variable from memory.
 
virtual const std::string asString ()=0
 Get the variable text representation.
 
- Public Member Functions inherited from Aqua::InputOutput::Variable
 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.
 

Protected Member Functions

bool checkPyhonObjectDims (PyObject *obj)
 Check that a Python object is compatible with the variable type.
 
- Protected Member Functions inherited from Aqua::InputOutput::Variable
void sync ()
 Wait for variable underlying event to be complete.
 

Additional Inherited Members

- Protected Attributes inherited from Aqua::InputOutput::ScalarVariable< T >
_value
 Variable value.
 

Detailed Description

template<class T>
class Aqua::InputOutput::ScalarVecVariable< T >

A generic Scalar variable, of 2 or more components.

Constructor & Destructor Documentation

◆ ScalarVecVariable()

template<class T >
Aqua::InputOutput::ScalarVecVariable< T >::ScalarVecVariable ( const std::string  varname,
const std::string  vartype,
const unsigned int  dims 
)

Constructor.

Parameters
varnameName of the variable.
vartypeType of the variable.

◆ ~ScalarVecVariable()

template<class T >
Aqua::InputOutput::ScalarVecVariable< T >::~ScalarVecVariable ( )
inline

Destructor.

Member Function Documentation

◆ asString()

template<class T >
const std::string Aqua::InputOutput::ScalarVecVariable< T >::asString
virtual

Get the variable text representation.

Returns
The variable represented as a string, NULL in case of errors.

Implements Aqua::InputOutput::ScalarVariable< T >.

Here is the call graph for this function:

◆ checkPyhonObjectDims()

template<class T >
bool Aqua::InputOutput::ScalarVecVariable< T >::checkPyhonObjectDims ( PyObject *  obj)
protected

Check that a Python object is compatible with the variable type.

This method is checking that the Python object is an array with the same number of components of the variable type. The internal data type is not checked.

Parameters
objPython object object.
Returns
false if the Python object matchs with the variable type, true otherwise.

The documentation for this class was generated from the following files: