VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
DtLuaAsyncJob Class Referenceabstract

Interface for getting asynchronously computed data into Lua.

The class is designed to be a general interface to some process which is computing values. The getObject function returns the "current" value and some control information. The subclass is responsible for all aspects of the asynchronous operation: Starting/stopping, data synchronization, and serialization/deserialization. The Lua framework will hold on to this object as a shared pointer.

Serialization/Deserialization Requirements

Subclasses must properly implement serialize() and deserialize() to ensure jobs can be saved and restored across scenario save/load operations:

Note
Failing to call start() during deserialization (when results aren't available) will leave the job in a non-functional state where it never completes.
Failing to serialize subclass-specific parameters will cause the job to fail or produce incorrect results after deserialization.
Inheritance diagram for DtLuaAsyncJob:
Inheritance graph
[legend]

Public Member Functions

virtual luabind::object getObject (lua_State *L, int &index, std::string &message)=0
 
virtual luabind::object getDebugObject (lua_State *L)=0
 
virtual void cancel (lua_State *L)=0
 
virtual void init (void *userData) override
 
virtual void setOwningObject (DtLocalObject *owningObject)
 
- Public Member Functions inherited from DtAsciiSerializable
 DtAsciiSerializable ()
 
 DtAsciiSerializable (const DtAsciiSerializable &orig)
 
virtual ~DtAsciiSerializable ()
 
virtual DtString objectType () const =0
 
virtual std::string objectTypeC () const
 
virtual DtString serialize ()=0
 
virtual bool deserialize (const DtString &)=0
 

Protected Member Functions

 DtLuaAsyncJob ()
 
 DtLuaAsyncJob (DtSimulationServices *)
 

Protected Attributes

DtSimulationServices * mySimulationServices
 

Constructor & Destructor Documentation

DtLuaAsyncJob::DtLuaAsyncJob ( )
protected
DtLuaAsyncJob::DtLuaAsyncJob ( DtSimulationServices *  )
explicitprotected

Member Function Documentation

virtual luabind::object DtLuaAsyncJob::getObject ( lua_State *  L,
int &  index,
std::string &  message 
)
pure virtual

Retrieve current value.

Parameters
LLua state.
indexIndex of returned value, returned in Lua as the second return value. Allows implementation to distinguish between different values computed over time.
messageError message, returned in Lua as the third return value.
Returns
Computed value.

Implemented in DtLuaNavFindExitPointJob, DtLuaFindPositionGroupsInAreaUsingRidgeQueryJob, DtLuaNavPlaceFormationJob, DtLuaNavFindPathJob, DtLuaFindPositionGroupsInAreaUsingHilltopsQueryJob, DtLuaNavCoverPointJob, DtLuaFindSinglePositionQueryJob, DtLuaNavPointOfInterestJob, DtLuaVehicleFightingPositionQueryJob, DtLuaNavRandomPointJob, DtLuaPathJob, DtLuaWeaponListQueryJob, DtLuaPlaceFormationJob, DtLuaEmbarkationEgressPointsQueryJob, DtLuaEmbarkationSlotQueryJob, DtLuaHilltopQueryJob, DtLuaEmbarkationSlotReservationJob, DtLuaNavJob, and DtLuaMultiAsyncJob.

virtual luabind::object DtLuaAsyncJob::getDebugObject ( lua_State *  L)
pure virtual
virtual void DtLuaAsyncJob::cancel ( lua_State *  L)
pure virtual
virtual void DtLuaAsyncJob::init ( void *  userData)
overridevirtual

Called by framework with userData set to the DtSimulationServices.

Reimplemented from DtAsciiSerializable.

virtual void DtLuaAsyncJob::setOwningObject ( DtLocalObject *  owningObject)
virtual

Called by framework when deserializing to inform of the owning object.

Note
The functions of owningObject should only be accessed within this function. It is not safe to store the pointer to this object and access it while the job is running.

Reimplemented in DtLuaPathJob.

Member Data Documentation

DtSimulationServices* DtLuaAsyncJob::mySimulationServices
protected

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

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)