The Nebula Device 3: Scripting::LuaServer Class Reference

The Nebula Device 3

Scripting::LuaServer Class Reference

#include <luaserver.h>

Inheritance diagram for Scripting::LuaServer:

Scripting::ScriptServer Core::RefCounted


Detailed Description

LUA backend for the Nebula3 scripting subsystem.

(C) 2006 Radon Labs GmbH

Public Member Functions

 LuaServer ()
 constructor
virtual ~LuaServer ()
 destructor
virtual bool Open ()
 open the script server
virtual void Close ()
 close the script server
virtual void RegisterCommand (const Util::String &name, const Ptr< Command > &cmd)
 register a command with the script server
virtual void UnregisterCommand (const Util::String &name)
 unregister a command from the script server
virtual bool Eval (const Util::String &str)
 evaluate a script statement in a string
bool IsOpen () const
 return true if open
virtual bool EvalScript (const IO::URI &uri)
 evaluate a script file
bool HasCommand (const Util::String &cmdName) const
 return true if a command has been registered by name
SizeT GetNumCommands () const
 return number of registered commands
const Ptr< Command > & GetCommandByIndex (IndexT i) const
 return pointer to command at index
const Ptr< Command > & GetCommandByName (const Util::String &cmdName) const
 get pointer to command by command name
const Util::StringGetError () const
 get error string if evaluation failes
void PrintCommandList () const
 print all registered commands to stdout
void PrintCommandHelp (const Util::String &cmdName) const
 print help on a command on stdout
int GetRefCount () const
 get the current refcount
void AddRef ()
 increment refcount by one
void Release ()
 decrement refcount and destroy object if refcount is zero
bool IsInstanceOf (const Rtti &rtti) const
 return true if this object is instance of given class
bool IsInstanceOf (const Util::String &className) const
 return true if this object is instance of given class by string
bool IsInstanceOf (const Util::FourCC &classFourCC) const
 return true if this object is instance of given class by fourcc
bool IsA (const Rtti &rtti) const
 return true if this object is instance of given class, or a derived class
bool IsA (const Util::String &rttiName) const
 return true if this object is instance of given class, or a derived class, by string
bool IsA (const Util::FourCC &rttiFourCC) const
 return true if this object is instance of given class, or a derived class, by fourcc
const Util::StringGetClassName () const
 get the class name
Util::FourCC GetClassFourCC () const
 get the class FourCC code

Static Public Member Functions

static void DumpRefCountingLeaks ()
 dump refcounting leaks, call at end of application (NEBULA3_DEBUG builds only!)

Protected Member Functions

void ClearError ()
 clear current error
void SetError (const Util::String &err)
 set error string

Member Function Documentation

void Scripting::LuaServer::RegisterCommand ( const Util::String name,
const Ptr< Command > &  cmd 
) [virtual]

register a command with the script server

Registers a new script command with the LUA server.

Reimplemented from Scripting::ScriptServer.

void Scripting::LuaServer::UnregisterCommand ( const Util::String name  )  [virtual]

unregister a command from the script server

Unregister a script command.

Reimplemented from Scripting::ScriptServer.

bool Scripting::LuaServer::Eval ( const Util::String str  )  [virtual]

evaluate a script statement in a string

Evaluates a piece of LUA code in a string.

Reimplemented from Scripting::ScriptServer.

int Core::RefCounted::GetRefCount (  )  const [inline, inherited]

get the current refcount

Return the current refcount of the object.

void Core::RefCounted::AddRef (  )  [inline, inherited]

increment refcount by one

Increment the refcount of the object.

void Core::RefCounted::Release (  )  [inline, inherited]

decrement refcount and destroy object if refcount is zero

Decrement the refcount and destroy object if refcount is zero.

const Util::String & Core::RefCounted::GetClassName (  )  const [inline, inherited]

get the class name

Get the class name of the object.

Util::FourCC Core::RefCounted::GetClassFourCC (  )  const [inline, inherited]

get the class FourCC code

Get the class FourCC of the object.

void Core::RefCounted::DumpRefCountingLeaks (  )  [static, inherited]

dump refcounting leaks, call at end of application (NEBULA3_DEBUG builds only!)

This method should be called as the very last before an application exits.