X-Plane Remote Access Plugin and Client Library
Public Member Functions | Static Public Member Functions | List of all members
xplra::SetDataRefTask Class Referenceabstract

#include <SetDataRefTask.h>

Inheritance diagram for xplra::SetDataRefTask:
xplra::DataRefTask xplra::Task 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

 SetDataRefTask (const std::string &name)
 
 SetDataRefTask (XPLMDataRef dataRef)
 
virtual void readValue (hu::varadiistvan::scpl::io::DataStream &stream)=0
 
- 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 ()
 

Static Public Member Functions

static SetDataRefTaskcreate (uint8_t &result, hu::varadiistvan::scpl::io::DataStream &stream)
 

Additional Inherited Members

- Protected Member Functions inherited from xplra::DataRefTask
 DataRefTask (const std::string &name)
 
 DataRefTask (XPLMDataRef dataRef)
 
virtual void perform ()
 
virtual void process ()=0
 

Detailed Description

Base class for dataref tasks that set the value of some data referenced by a dataref.

Since XPLM provides no feedback on whether the setting is successful, we detect only if the dataref is valid or not. So the isValid() function provides the only feedback if the task executed successfully or not. (We could use XPLMCanWriteDataRef, but for efficiency reasons we refrain from it. A separate task may be created for this purpose.)

Definition at line 54 of file SetDataRefTask.h.

Constructor & Destructor Documentation

◆ SetDataRefTask() [1/2]

xplra::SetDataRefTask::SetDataRefTask ( const std::string &  name)
inline

Construct the task for the dataref with the given name.

Definition at line 444 of file SetDataRefTask.h.

◆ SetDataRefTask() [2/2]

xplra::SetDataRefTask::SetDataRefTask ( XPLMDataRef  dataRef)
inline

Construct the task for the given dataref.

Definition at line 451 of file SetDataRefTask.h.

Member Function Documentation

◆ create()

SetDataRefTask * SetDataRefTask::create ( uint8_t &  result,
hu::varadiistvan::scpl::io::DataStream &  stream 
)
static

Read a dataref setting specification and create the appropriate SetDataRefTask instance.

Parameters
resultwill contain the result of the operation. It signifies an error only, if some wrong data is read. If the stream fails, it will indicate RESULT_OK.
streamthe stream to read from
Returns
the new instance or 0 on error.

Definition at line 48 of file SetDataRefTask.cc.

◆ readValue()

virtual void xplra::SetDataRefTask::readValue ( hu::varadiistvan::scpl::io::DataStream &  stream)
pure virtual

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