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

A generic Scalar variable. More...

#include <Variable.h>

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

Public Member Functions

 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 Attributes

_value
 Variable value.
 

Additional Inherited Members

- Protected Member Functions inherited from Aqua::InputOutput::Variable
void sync ()
 Wait for variable underlying event to be complete.
 

Detailed Description

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

A generic Scalar variable.

Constructor & Destructor Documentation

◆ ScalarVariable()

template<class T >
Aqua::InputOutput::ScalarVariable< T >::ScalarVariable ( const std::string  varname,
const std::string  vartype 
)

Constructor.

Parameters
varnameName of the variable.
vartypeType of the variable.

◆ ~ScalarVariable()

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

Destructor.

Member Function Documentation

◆ asString()

template<class T >
virtual const std::string Aqua::InputOutput::ScalarVariable< T >::asString ( )
pure virtual

◆ get()

template<class T >
void * Aqua::InputOutput::ScalarVariable< T >::get ( )
inlinevirtual

Get variable pointer basis pointer.

This is a blocking operation, that will retain the program until the underlying variable event is complete. For asynchronous variable retrieval see get_async()

Returns
Implementation pointer

Reimplemented from Aqua::InputOutput::Variable.

Here is the call graph for this function:

◆ get_async()

template<class T >
void * Aqua::InputOutput::ScalarVariable< T >::get_async ( )
inline

Get variable pointer basis pointer.

Sometimes a tool would make events micromanagement, becoming useful to can retrieve the value in an asynchronous way. That is for instance the case of events manipulated in callbacks

Returns
Implementation pointer

◆ isArray()

template<class T >
bool Aqua::InputOutput::ScalarVariable< T >::isArray
inlinevirtual

Report that the varaible is not an array.

Returns
false

Implements Aqua::InputOutput::Variable.

◆ set()

template<class T >
void Aqua::InputOutput::ScalarVariable< T >::set ( void *  ptr)
inlinevirtual

Set variable from memory.

This is a blocking operation, that will retain the program until the underlying variable event is complete.

Parameters
ptrMemory to copy

Implements Aqua::InputOutput::Variable.

Here is the call graph for this function:

◆ set_async()

template<class T >
void Aqua::InputOutput::ScalarVariable< T >::set_async ( void *  ptr)
inline

Set variable from memory.

Sometimes a tool would make events micromanagement, becoming useful to can retrieve the value in an asynchronous way. That is for instance the case of events manipulated in callbacks

Parameters
ptrMemory to copy

◆ typesize()

template<class T >
size_t Aqua::InputOutput::ScalarVariable< T >::typesize ( ) const
inlinevirtual

Get the variable type size.

Returns
Variable type size (in bytes)

Reimplemented from Aqua::InputOutput::Variable.

Field Documentation

◆ _value

template<class T >
T Aqua::InputOutput::ScalarVariable< T >::_value
protected

Variable value.


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