X-Plane Remote Access Plugin and Client Library
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
xplra::GetArrayDataRefTask< T, ConcreteClass > Class Template Reference

#include <GetDataRefTask.h>

Inheritance diagram for xplra::GetArrayDataRefTask< T, ConcreteClass >:
xplra::GetDataRefTask xplra::DataRefTask xplra::Task

Public Member Functions

virtual ~GetArrayDataRefTask ()
 
const T * getData () const
 
int getLength () const
 
- Public Member Functions inherited from xplra::GetDataRefTask
 GetDataRefTask (const std::string &name)
 
 GetDataRefTask (XPLMDataRef dataRef)
 
- Public Member Functions inherited from xplra::DataRefTask
bool isValid () const
 
const std::string & getName () const
 
XPLMDataRef getDataRef () const
 
- Public Member Functions inherited from xplra::Task
virtual ~Task ()
 

Protected Member Functions

 GetArrayDataRefTask (const std::string &name, int maxCount=-1, int offset=0)
 
 GetArrayDataRefTask (XPLMDataRef dataRef, int maxCount=-1, int offset=0)
 
virtual void process ()
 
virtual void writeValue (hu::varadiistvan::scpl::io::DataStream &stream)
 
- Protected Member Functions inherited from xplra::DataRefTask
 DataRefTask (const std::string &name)
 
 DataRefTask (XPLMDataRef dataRef)
 
virtual void perform ()
 

Private Attributes

int maxCount
 
int offset
 
T * data
 
int length
 

Additional Inherited Members

- Static Public Member Functions inherited from xplra::GetDataRefTask
static GetDataRefTaskcreate (uint8_t &result, hu::varadiistvan::scpl::io::DataStream &stream)
 

Detailed Description

template<typename T, class ConcreteClass>
class xplra::GetArrayDataRefTask< T, ConcreteClass >

Base class for dataref querying tasks that query some array.

ConcreteClass is the actual child class. It should have a function called queryData, which wraps the corresponding function in XPLM.

Definition at line 221 of file GetDataRefTask.h.

Constructor & Destructor Documentation

◆ GetArrayDataRefTask() [1/2]

template<typename T , class ConcreteClass >
xplra::GetArrayDataRefTask< T, ConcreteClass >::GetArrayDataRefTask ( const std::string &  name,
int  maxCount = -1,
int  offset = 0 
)
inlineprotected

Construct the task for the dataref with the given name.

Parameters
namethe name of the dataref
maxCountthe maximal number of items to retrieve. If <0, the function will perform an extra query to retrieve the size of of the dataref's data, which it will store in the task, so later on it can be reused.
offsetthe offset from which to query the array

Definition at line 473 of file GetDataRefTask.h.

◆ GetArrayDataRefTask() [2/2]

template<typename T , class ConcreteClass >
xplra::GetArrayDataRefTask< T, ConcreteClass >::GetArrayDataRefTask ( XPLMDataRef  dataRef,
int  maxCount = -1,
int  offset = 0 
)
inlineprotected

Construct the task for the given dataref

Parameters
dataRefthe dataref
maxCountthe maximal number of items to retrieve. If <0, the function will perform an extra query to retrieve the size of the dataref's data, which it will store in the task, so later on it can be reused.
offsetthe offset from which to query the array

Definition at line 486 of file GetDataRefTask.h.

◆ ~GetArrayDataRefTask()

template<typename T , class ConcreteClass >
xplra::GetArrayDataRefTask< T, ConcreteClass >::~GetArrayDataRefTask
inlinevirtual

Destroy the object.

Definition at line 499 of file GetDataRefTask.h.

Member Function Documentation

◆ getData()

template<typename T , class ConcreteClass >
const T * xplra::GetArrayDataRefTask< T, ConcreteClass >::getData
inline

Get the data.

Definition at line 507 of file GetDataRefTask.h.

◆ getLength()

template<typename T , class ConcreteClass >
int xplra::GetArrayDataRefTask< T, ConcreteClass >::getLength
inline

Get the length of the data.

Definition at line 515 of file GetDataRefTask.h.

◆ process()

template<typename T , class ConcreteClass >
void xplra::GetArrayDataRefTask< T, ConcreteClass >::process
protectedvirtual

Process the dataref by querying its value.

Implements xplra::DataRefTask.

Definition at line 523 of file GetDataRefTask.h.

◆ writeValue()

template<typename T , class ConcreteClass >
void xplra::GetArrayDataRefTask< T, ConcreteClass >::writeValue ( hu::varadiistvan::scpl::io::DataStream &  stream)
protectedvirtual

Write the value into the given stream.

Implements xplra::GetDataRefTask.

Definition at line 551 of file GetDataRefTask.h.

Member Data Documentation

◆ data

template<typename T , class ConcreteClass >
T* xplra::GetArrayDataRefTask< T, ConcreteClass >::data
private

The data.

Definition at line 237 of file GetDataRefTask.h.

◆ length

template<typename T , class ConcreteClass >
int xplra::GetArrayDataRefTask< T, ConcreteClass >::length
private

The actual length of the data retrieved.

Definition at line 242 of file GetDataRefTask.h.

◆ maxCount

template<typename T , class ConcreteClass >
int xplra::GetArrayDataRefTask< T, ConcreteClass >::maxCount
private

The maximal number of data items returned.

Definition at line 227 of file GetDataRefTask.h.

◆ offset

template<typename T , class ConcreteClass >
int xplra::GetArrayDataRefTask< T, ConcreteClass >::offset
private

The offset within the dataref's value to start the query from.

Definition at line 232 of file GetDataRefTask.h.


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