VR-Forces 4.0.4 Class Documentation
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes
vrfLua::DtLuaScriptController Class Reference

Controller for using Lua scripts. More...

Inheritance diagram for vrfLua::DtLuaScriptController:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 DtLuaScriptController (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=NULL, DtReaderWriterRegistry *parentRegistry=0)
 constructor
virtual ~DtLuaScriptController ()
 destructor
 DtLuaScriptController (const DtLuaScriptController &orig)
 copy constructor
DtLuaScriptControlleroperator= (const DtLuaScriptController &orig)
 assignment operator
virtual bool init (DtLuaScriptManager *manager)
virtual bool createScriptPSR ()
virtual void setLuaState (lua_State *L)
virtual lua_State * getLuaState ()
virtual DtString type () const
 Returns the string type for this component.
virtual void registerTaskMsgCallbacks ()
 Register a callback for notification of DtUserTask messages.
virtual void unregisterTaskMsgCallbacks ()
 Unregister a callback for notification of DtUserTask messages.
const DtSensorContactInfoListgetSensorContacts ()
 Gives a pointer to target detection list.
virtual void processSetViewTarget (DtSimMessage *msg)
 Processes a Set View Target command, using BaseEntity::SetViewTarget()
virtual void processTextRadioMessage (DtTextReport *textReport)
 Processes a Text Radio Message.
virtual void processLocationRequest (DtSetLocationRequest *textReport)
 Processes a Location Request Message.
virtual DtBoolean checkTick ()
virtual void tick ()
virtual void firstTick ()
virtual bool tickWhileDestroyed () const
 If the component returns true here, it will be ticked regardless of the destroyed state of the host entity.
virtual void NotifyTaskCompleted (bool success=true)
 VR-Forces Task methods.
virtual void clearTask ()

Static Public Member Functions

static DtSimComponentcreator (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc, DtReaderWriterRegistry *parentRegistry)
 This is called by the factory.
static void setViewTargetCallback (DtSimMessage *msg, void *usr)
 Callback for processing "Set View Target" messages.

Protected Member Functions

virtual DtBoolean createPortGroups ()
 methods
virtual DtBoolean createPorts ()
virtual void processRequestScriptName (const DtVrfObjectMessage *msg)
virtual DtBoolean deactivateOutputControl ()
virtual void sendScriptName (const DtString &script, const DtString &origSender)
virtual void processAboutToSaveCheckpoint ()
 Called just before the chechpoint file is written, so the controller has a chance to put things to the PSR.
virtual void processPostLoadCheckpoint ()
 Called after the scenario has been read, so the controller has a chance to restore data from the PSR.

Static Protected Member Functions

static void requestScriptNameCallback (const DtVrfObjectMessage *msg, void *usr)
static void aboutToSaveCheckpointCallback (DtScenario &scn, void *usr)
static void postLoadCheckpointCallback (const DtScenario &scn, void *usr)
static void postRewindCallback (void *usr)

Protected Attributes

DtUserTask myUserTask
 attributes
DtScriptPSRmyScriptPSR
 process state repository : records state info for this controller (movement mode, vrf debug route..)
DtLuaScriptManagermyScriptManager
bool myFirstTick
DtString myLUAScript
 current lua script name
lua_State * myLState
 current lua state
bool m_luaScriptWarningShown
virtual void processSetScript (DtSimMessage *msg)
 Manage Lua scripts.
void setScript (const DtString &name)
 Manage Lua scripts.
virtual DtString getScriptName ()
 Manage Lua scripts.
virtual void setScriptNameAndLoad (const DtString &name)
 Manage Lua scripts.
virtual DtString getScriptSerialization ()
 Manage Lua scripts.
virtual void setScriptFromSerialization (const DtString &buffer)
 Manage Lua scripts.
static void setScriptCallback (DtSimMessage *msg, void *usr)
 Manage Lua scripts.

Detailed Description

Controller for using Lua scripts.

This controller provides the ability to use Lua scripts to create other behaviours.


Constructor & Destructor Documentation

vrfLua::DtLuaScriptController::DtLuaScriptController ( const DtString name,
DtVrfObject owner,
DtSimManager simManager,
DtComponentDescriptor desc = NULL,
DtReaderWriterRegistry parentRegistry = 0 
)

constructor

destructor

copy constructor


Member Function Documentation

DtLuaScriptController& vrfLua::DtLuaScriptController::operator= ( const DtLuaScriptController orig)

assignment operator

virtual void vrfLua::DtLuaScriptController::setLuaState ( lua_State *  L) [virtual]
virtual lua_State* vrfLua::DtLuaScriptController::getLuaState ( ) [virtual]
virtual DtString vrfLua::DtLuaScriptController::type ( ) const [virtual]

Returns the string type for this component.

Implements DtTaskControllerComponent.

static DtSimComponent* vrfLua::DtLuaScriptController::creator ( const DtString name,
DtVrfObject owner,
DtSimManager simManager,
DtComponentDescriptor desc,
DtReaderWriterRegistry parentRegistry 
) [static]

This is called by the factory.

Register a callback for notification of DtUserTask messages.

Overrides this so it can register its interest in DtUserTask* commands

Reimplemented from DtTaskControllerComponent.

Unregister a callback for notification of DtUserTask messages.

This is used if the entity cannot process DtUserTasks

Gives a pointer to target detection list.

static void vrfLua::DtLuaScriptController::setScriptCallback ( DtSimMessage msg,
void *  usr 
) [static]

Manage Lua scripts.

Callback for receiving the DtSetScript messages that contain the name of the script to be run. Calls processSetScript().

Manage Lua scripts.

Callback for receiving the DtSetScript messages that contain the name of the script to be run. Calls processSetScript().

Manage Lua scripts.

Callback for receiving the DtSetScript messages that contain the name of the script to be run. Calls processSetScript().

Manage Lua scripts.

Callback for receiving the DtSetScript messages that contain the name of the script to be run. Calls processSetScript().

virtual void vrfLua::DtLuaScriptController::setScriptNameAndLoad ( const DtString name) [virtual]

Manage Lua scripts.

Callback for receiving the DtSetScript messages that contain the name of the script to be run. Calls processSetScript().

Manage Lua scripts.

Callback for receiving the DtSetScript messages that contain the name of the script to be run. Calls processSetScript().

virtual void vrfLua::DtLuaScriptController::setScriptFromSerialization ( const DtString buffer) [virtual]

Manage Lua scripts.

Callback for receiving the DtSetScript messages that contain the name of the script to be run. Calls processSetScript().

static void vrfLua::DtLuaScriptController::setViewTargetCallback ( DtSimMessage msg,
void *  usr 
) [static]

Callback for processing "Set View Target" messages.

Calls processSetViewTarget()

Processes a Set View Target command, using BaseEntity::SetViewTarget()

virtual void vrfLua::DtLuaScriptController::processTextRadioMessage ( DtTextReport textReport) [virtual]

Processes a Text Radio Message.

Processes a Location Request Message.

virtual DtBoolean vrfLua::DtLuaScriptController::checkTick ( ) [virtual]

Returns true if tick() must be completed.

virtual void vrfLua::DtLuaScriptController::NotifyTaskCompleted ( bool  success = true) [virtual]

VR-Forces Task methods.

Switch to next task if current one has completed

virtual void vrfLua::DtLuaScriptController::clearTask ( ) [virtual]

Stops any currently executing task.

Reimplemented from DtSingleTaskControllerComponent.

virtual void vrfLua::DtLuaScriptController::tick ( ) [virtual]

Transmit steering and throttle information from the action computed by the kynapse entity's brain, and provide them thanks to automotive output port group.

Reimplemented from DtSimComponent.

virtual void vrfLua::DtLuaScriptController::firstTick ( ) [virtual]

If the component returns true here, it will be ticked regardless of the destroyed state of the host entity.

Otherwise, tick will only be called when the entity is alive.

Returns:
false.

Reimplemented from DtSimComponent.

virtual DtBoolean vrfLua::DtLuaScriptController::createPortGroups ( ) [protected, virtual]

methods

Reimplemented from DtSimComponent.

virtual DtBoolean vrfLua::DtLuaScriptController::createPorts ( ) [protected, virtual]

Create input/output ports

Reimplemented from DtSimComponent.

static void vrfLua::DtLuaScriptController::requestScriptNameCallback ( const DtVrfObjectMessage msg,
void *  usr 
) [static, protected]
virtual void vrfLua::DtLuaScriptController::processRequestScriptName ( const DtVrfObjectMessage msg) [protected, virtual]
virtual DtBoolean vrfLua::DtLuaScriptController::deactivateOutputControl ( ) [inline, protected, virtual]
virtual void vrfLua::DtLuaScriptController::sendScriptName ( const DtString script,
const DtString origSender 
) [protected, virtual]
static void vrfLua::DtLuaScriptController::aboutToSaveCheckpointCallback ( DtScenario scn,
void *  usr 
) [static, protected]
virtual void vrfLua::DtLuaScriptController::processAboutToSaveCheckpoint ( ) [protected, virtual]

Called just before the chechpoint file is written, so the controller has a chance to put things to the PSR.

static void vrfLua::DtLuaScriptController::postLoadCheckpointCallback ( const DtScenario scn,
void *  usr 
) [static, protected]
static void vrfLua::DtLuaScriptController::postRewindCallback ( void *  usr) [static, protected]
virtual void vrfLua::DtLuaScriptController::processPostLoadCheckpoint ( ) [protected, virtual]

Called after the scenario has been read, so the controller has a chance to restore data from the PSR.


Member Data Documentation

attributes

Current task

process state repository : records state info for this controller (movement mode, vrf debug route..)

current lua script name

current lua state


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

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)