X-Plane Remote Access Plugin and Client Library
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
xplra::DataRefTask Class Referenceabstract

#include <DataRefTask.h>

Inheritance diagram for xplra::DataRefTask:
xplra::Task xplra::GetDataRefTask xplra::SetDataRefTask xplra::GetArrayDataRefTask< float, GetFloatArrayDataRefTask > xplra::GetArrayDataRefTask< int, GetIntArrayDataRefTask > xplra::GetArrayDataRefTask< unsigned char, GetByteArrayDataRefTask > xplra::GetScalarDataRefTask< double, GetDoubleDataRefTask > xplra::GetScalarDataRefTask< int, GetIntDataRefTask > xplra::GetScalarDataRefTask< float, GetFloatDataRefTask > xplra::GetArrayDataRefTask< T, ConcreteClass > xplra::GetScalarDataRefTask< T, ConcreteClass > xplra::SetArrayDataRefTask< float, SetFloatArrayDataRefTask > xplra::SetArrayDataRefTask< int, SetIntArrayDataRefTask > xplra::SetArrayDataRefTask< unsigned char, SetByteArrayDataRefTask > xplra::SetScalarDataRefTask< double, SetDoubleDataRefTask > xplra::SetScalarDataRefTask< int, SetIntDataRefTask > xplra::SetScalarDataRefTask< float, SetFloatDataRefTask > xplra::SetArrayDataRefTask< T, ConcreteClass > xplra::SetScalarDataRefTask< T, ConcreteClass >

Public Member Functions

bool isValid () const
 
const std::string & getName () const
 
XPLMDataRef getDataRef () const
 
- Public Member Functions inherited from xplra::Task
virtual ~Task ()
 

Protected Member Functions

 DataRefTask (const std::string &name)
 
 DataRefTask (XPLMDataRef dataRef)
 
virtual void perform ()
 
virtual void process ()=0
 

Private Attributes

std::string name
 
XPLMDataRef dataRef
 

Detailed Description

A task that works with some dataref. This base class performs the mapping from dataref name to dataref value. The actual operation is performed by the subclasses.

Definition at line 50 of file DataRefTask.h.

Constructor & Destructor Documentation

◆ DataRefTask() [1/2]

xplra::DataRefTask::DataRefTask ( const std::string &  name)
inlineprotected

Construct the dataref task for the dataref with the given name.

Definition at line 110 of file DataRefTask.h.

◆ DataRefTask() [2/2]

xplra::DataRefTask::DataRefTask ( XPLMDataRef  dataRef)
inlineprotected

Construct the dataref task for the given dataref.

Definition at line 118 of file DataRefTask.h.

Member Function Documentation

◆ getDataRef()

XPLMDataRef xplra::DataRefTask::getDataRef ( ) const
inline

Get the dataref.

Definition at line 139 of file DataRefTask.h.

◆ getName()

const std::string & xplra::DataRefTask::getName ( ) const
inline

Get the name of the dataref.

Definition at line 132 of file DataRefTask.h.

◆ isValid()

bool xplra::DataRefTask::isValid ( ) const
inline

Determine if the task is valid, which is so, if the dataref is not 0.

Definition at line 125 of file DataRefTask.h.

◆ perform()

void DataRefTask::perform ( )
protectedvirtual

Perform the task. If the dataref is not valid yet, it will be queried. If the query is successful, the process() function is called.

Implements xplra::Task.

Definition at line 43 of file DataRefTask.cc.

◆ process()

virtual void xplra::DataRefTask::process ( )
protectedpure virtual

Member Data Documentation

◆ dataRef

XPLMDataRef xplra::DataRefTask::dataRef
private

The dataref.

Definition at line 61 of file DataRefTask.h.

◆ name

std::string xplra::DataRefTask::name
private

The name of the dataref.

Definition at line 56 of file DataRefTask.h.


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