Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Fusion::Engine Class Reference

#include <FusionEngine.h>

Inheritance diagram for Fusion::Engine:

Fusion::IEngine List of all members.

Public Member Functions

 Engine (lua_State *)
virtual IObjectcreateObject (const UTF8String &name) const
 Create an object with the named prototype, sending no arguments to its constructor.
virtual IObjectcreateObject (const UTF8String &name, const Value &val) const
 Create an object with the named prototype, sending the passed val as the argument to its constructor.
virtual IObjectcreateObject (const UTF8String &name, Args &args, int32_t nargs) const
 Create an object with the named prototype, sending the passed args to its constructor.
virtual ResultType setProperty (const Id &id, const Value &val)
 Set the passed property of the global object to the passed value.
virtual ResultType getProperty (const Id &id, Value &val) const
 Get the passed property of the global object and place it in the passed value.
virtual ResultType callProperty (const Id &id, Value &retval) const
 Call the passed property of the global object, which is assumed to be a function or callable object.
virtual ResultType callProperty (const Id &id, Value &retval, const Value &val) const
 Call the passed property of the global object, which is assumed to be a function or callable object.
virtual ResultType callProperty (const Id &id, Value &retval, Args &args, int32_t nargs) const
 Call the passed property of the global object, which is assumed to be a function or callable object.
virtual ResultType callValue (const Value &func, Value &retval) const
 Call the passed value, which is assumed to be a function or callable object.
virtual ResultType callValue (const Value &func, Value &retval, const Value &val) const
 Call the passed value, which is assumed to be a function or callable object.
virtual ResultType callValue (const Value &func, Value &retval, Args &args, int32_t nargs) const
 Call the passed value, which is assumed to be a function or callable object.
virtual ResultType eval (const char *str, Value &val, const Value &env, const char *name, bool showError)
 Evaluate the passed string as a lua program or expression.
virtual bool load (DataStream *ds, Value &val, const Value &env, const char *name)
 Load the lua file contained in the passed datastream and evaluate the resulting function.
virtual bool load (const UTF8String &filename, Value &val, const Value &env, const char *name)
 Load the lua file contained in the passed filename and evaluate the resulting function.
virtual void addACLEntry (const UTF8String &path, uint32_t perm)
 Add an entry to the file access control list for this engine.
virtual void removeACLEntry (const UTF8String &path, uint32_t perm)
 Remove an entry from the file access control list for this engine.
virtual void clearACL ()
 Clear all entries in the file access control list for this engine.
virtual bool isACLAllowed (const UTF8String filename, uint32_t perm, UTF8String &approvedPath)
 return true if the passed filename has permission to perform the access requested in perm.
void registerGlobalObject (const char *name, Object *obj)
 Register the passed object as a prototype.
virtual ILoggersetLogger (ILogger *logger)
 Set the ILogger interface to be used for logging. Returns the previous logger, if any.
virtual ILoggergetLogger () const
 Get the current ILogger interface.
virtual void log (LogLevelType, const char *module, const char *,...)
 Log errors, warnings and info.
virtual void setThreadOwner (bool take)
 Make this engine the engine for the current thread.
void ref ()
void unref ()

Static Public Member Functions

static ResultType doCall (const Id &id, Args &args, int32_t nargs, Value &retval)
static IEnginegetIEngine ()
 Return the IEngine pointer for the caller's thread.
static void setIEngine (IEngine *e)
 Set the IEngine pointer for the caller's thread.
static int print (lua_State *L)
 Global print function.
static int log (lua_State *L)
 Global log function.
static int debugBreak (lua_State *L)
 Global debugBreak function.
static int parseInt (lua_State *L)
 Global parseInt function.
static int parseFloat (lua_State *L)
 Global parseFloat function.
static int isNaN (lua_State *L)
 Global isNaN function.
static int isFinite (lua_State *L)
 Global isFinite function.
static int pairs (lua_State *L)
static int ipairs (lua_State *L)

Protected Member Functions

lua_State * getState ()

Friends

class Args

Classes

struct  ACLEntry

Constructor & Destructor Documentation

Fusion::Engine::Engine lua_State *   ) 
 


Member Function Documentation

virtual void Fusion::Engine::addACLEntry const UTF8String path,
uint32_t  perm
[virtual]
 

Add an entry to the file access control list for this engine.

Implements Fusion::IEngine.

virtual ResultType Fusion::Engine::callProperty const Id id,
Value retval,
Args args,
int32_t  nargs
const [virtual]
 

Call the passed property of the global object, which is assumed to be a function or callable object.

Any returned value is placed in retval. The nargs parameter has the number of arguments passed. Actual arguments are on the Lua stack, which is referenced in args.

Implements Fusion::IEngine.

virtual ResultType Fusion::Engine::callProperty const Id id,
Value retval,
const Value val
const [virtual]
 

Call the passed property of the global object, which is assumed to be a function or callable object.

Any returned value is placed in retval. One argument is passed in val.

Implements Fusion::IEngine.

virtual ResultType Fusion::Engine::callProperty const Id id,
Value retval
const [virtual]
 

Call the passed property of the global object, which is assumed to be a function or callable object.

Any returned value is placed in retval. No arguments are passed.

Implements Fusion::IEngine.

virtual ResultType Fusion::Engine::callValue const Value func,
Value retval,
Args args,
int32_t  nargs
const [virtual]
 

Call the passed value, which is assumed to be a function or callable object.

Any returned value is placed in retval. The nargs parameter has the number of arguments passed. Actual arguments are on the Lua stack, which is referenced in args.

Implements Fusion::IEngine.

virtual ResultType Fusion::Engine::callValue const Value func,
Value retval,
const Value val
const [virtual]
 

Call the passed value, which is assumed to be a function or callable object.

Any returned value is placed in retval. One argument is passed in val.

Implements Fusion::IEngine.

virtual ResultType Fusion::Engine::callValue const Value func,
Value retval
const [virtual]
 

Call the passed value, which is assumed to be a function or callable object.

Any returned value is placed in retval. No arguments are passed.

Implements Fusion::IEngine.

virtual void Fusion::Engine::clearACL  )  [virtual]
 

Clear all entries in the file access control list for this engine.

Implements Fusion::IEngine.

virtual IObject* Fusion::Engine::createObject const UTF8String name,
Args args,
int32_t  nargs
const [virtual]
 

Create an object with the named prototype, sending the passed args to its constructor.

The named prototype must be in the global table.

Implements Fusion::IEngine.

virtual IObject* Fusion::Engine::createObject const UTF8String name,
const Value val
const [virtual]
 

Create an object with the named prototype, sending the passed val as the argument to its constructor.

The named prototype must be in the global table.

Implements Fusion::IEngine.

virtual IObject* Fusion::Engine::createObject const UTF8String name  )  const [virtual]
 

Create an object with the named prototype, sending no arguments to its constructor.

The named prototype must be in the global table.

Implements Fusion::IEngine.

static int Fusion::Engine::debugBreak lua_State *  L  )  [static]
 

Global debugBreak function.

static ResultType Fusion::Engine::doCall const Id id,
Args args,
int32_t  nargs,
Value retval
[static]
 

virtual ResultType Fusion::Engine::eval const char *  str,
Value val,
const Value env,
const char *  name,
bool  showError
[virtual]
 

Evaluate the passed string as a lua program or expression.

Place the return value into val and use the passed self value (which is expected to be a Lua object) as the self value for the program. If showError is true, show any compile or execution errors in the console. If so, use the passed name in the error message(s). If name starts with '=' it is output unmodified in messages. If it starts with '@' it is considered a filename and is formatted as such (with a possible ellipsis to shorten the name). Otherwise it is output in the form '[string <name>]'.

Implements Fusion::IEngine.

static IEngine* Fusion::Engine::getIEngine  )  [inline, static]
 

Return the IEngine pointer for the caller's thread.

This method does automatic thread-lookup to find the correct Engine object

Reimplemented from Fusion::IEngine.

virtual ILogger* Fusion::Engine::getLogger  )  const [inline, virtual]
 

Get the current ILogger interface.

Implements Fusion::IEngine.

virtual ResultType Fusion::Engine::getProperty const Id id,
Value val
const [virtual]
 

Get the passed property of the global object and place it in the passed value.

Implements Fusion::IEngine.

lua_State* Fusion::Engine::getState  )  [inline, protected]
 

static int Fusion::Engine::ipairs lua_State *  L  )  [static]
 

virtual bool Fusion::Engine::isACLAllowed const UTF8String  filename,
uint32_t  perm,
UTF8String approvedPath
[virtual]
 

return true if the passed filename has permission to perform the access requested in perm.

All perm bits must be matched. If return is true, approvedPath also has the full path that was approved.

Implements Fusion::IEngine.

static int Fusion::Engine::isFinite lua_State *  L  )  [static]
 

Global isFinite function.

static int Fusion::Engine::isNaN lua_State *  L  )  [static]
 

Global isNaN function.

virtual bool Fusion::Engine::load const UTF8String filename,
Value val,
const Value env,
const char *  name
[virtual]
 

Load the lua file contained in the passed filename and evaluate the resulting function.

Use the passed environment as the function environment and place any return value in val. If any errors occur, use the name string in the message(s). See eval for formatting of name.

Implements Fusion::IEngine.

virtual bool Fusion::Engine::load DataStream ds,
Value val,
const Value env,
const char *  name
[virtual]
 

Load the lua file contained in the passed datastream and evaluate the resulting function.

Use the passed environment as the function environment and place any return value in val. If any errors occur, use the name string in the message(s). See eval for formatting of name.

Implements Fusion::IEngine.

static int Fusion::Engine::log lua_State *  L  )  [static]
 

Global log function.

virtual void Fusion::Engine::log LogLevelType  ,
const char *  module,
const char *  ,
  ...
[virtual]
 

Log errors, warnings and info.

Implements Fusion::IEngine.

static int Fusion::Engine::pairs lua_State *  L  )  [static]
 

static int Fusion::Engine::parseFloat lua_State *  L  )  [static]
 

Global parseFloat function.

static int Fusion::Engine::parseInt lua_State *  L  )  [static]
 

Global parseInt function.

static int Fusion::Engine::print lua_State *  L  )  [static]
 

Global print function.

void Fusion::Engine::ref  )  [inline]
 

void Fusion::Engine::registerGlobalObject const char *  name,
Object obj
[virtual]
 

Register the passed object as a prototype.

Implements Fusion::IEngine.

virtual void Fusion::Engine::removeACLEntry const UTF8String path,
uint32_t  perm
[virtual]
 

Remove an entry from the file access control list for this engine.

Implements Fusion::IEngine.

static void Fusion::Engine::setIEngine IEngine e  )  [inline, static]
 

Set the IEngine pointer for the caller's thread.

This method is useful if an application starts a new thread and wants to set the engine pointer for this thread

Reimplemented from Fusion::IEngine.

virtual ILogger* Fusion::Engine::setLogger ILogger logger  )  [inline, virtual]
 

Set the ILogger interface to be used for logging. Returns the previous logger, if any.

Implements Fusion::IEngine.

virtual ResultType Fusion::Engine::setProperty const Id id,
const Value val
[virtual]
 

Set the passed property of the global object to the passed value.

Implements Fusion::IEngine.

virtual void Fusion::Engine::setThreadOwner bool  take  )  [inline, virtual]
 

Make this engine the engine for the current thread.

Implements Fusion::IEngine.

void Fusion::Engine::unref  )  [inline]
 


Friends And Related Function Documentation

friend class Args [friend]
 


The documentation for this class was generated from the following file:
Generated on Sat Apr 1 06:08:33 2006 for Emma SDK Guide by  doxygen 1.4.3