CoreService Struct Reference
[Core Engine Services]

Inherits Service.

Inherited by CoreImpl.

List of all members.

Public Methods

virtual bool startEngine (int argc, char *argv[])=0
virtual void stopEngine ()=0
virtual void run ()=0
virtual void quit ()=0
virtual void queueEvent (Event *e)=0
virtual void sendEvent (Event *e)=0
virtual void scheduleEvent (Double when, EventListener *who, Event *what)=0
virtual void print (const Char *msg,...)=0
virtual ServicecreateA (const Char *typeName)=0
virtual bool runFile (const Char *filename, Context *context=0)=0
virtual void runBuffer (void *buffer, unsigned size, const Char *name, Context *context=0)=0
virtual void error (const Char *msg)=0
virtual void die (const Char *msg)=0
virtual const ChargetStartDirectory ()=0
virtual const ChargetBinDirectory ()=0
virtual const ChargetExecutableName ()=0
virtual bool loadPackage (ServicesList *services, const char *name)=0
virtual void registerEventLoop (EventLoop *el)=0
virtual void addEventListener (EventListener *el)=0
virtual void removeEventListener (EventListener *el)=0
virtual ScriptServiceregisterFileServer (CoreFileServer *fs)=0
virtual ScriptServicegetScriptService ()=0
virtual ContextbeginDispatch (Context *c, Service *s, const Char *method)=0


Detailed Description

Script and service management.


Member Function Documentation

virtual void CoreService::addEventListener EventListener   el [pure virtual]
 

Add a new event listener.

virtual Context* CoreService::beginDispatch Context   c,
Service   s,
const Char   method
[pure virtual]
 

Prepare a scripting context for a function call. You should generally use the DISPATCH_METHOD() macro instead.

virtual Service* CoreService::createA const Char   typeName [pure virtual]
 

Create a new instance of a service.

Parameters:
typeName  The service's unique ID, which looks like "package.service".

virtual void CoreService::die const Char   msg [pure virtual]
 

Report an unrecoverable error condition. Displays the supplied message and then exits the application, performing as much cleanup as possible on the way out.

virtual void CoreService::error const Char   msg [pure virtual]
 

Report a potentially recoverable error condition. Intended for use by the scripting system, which calls this function to report syntax and similar errors. Triggers the onError() event on all registered listeners (see addListener(), below).

virtual const Char* CoreService::getBinDirectory   [pure virtual]
 

Get the directory containing the application executable.

virtual const Char* CoreService::getExecutableName   [pure virtual]
 

Get the name of the application executable.

virtual ScriptService* CoreService::getScriptService   [pure virtual]
 

Retrieve the scripting service interface.

virtual const Char* CoreService::getStartDirectory   [pure virtual]
 

Get the directory which was current when the application started.

virtual bool CoreService::loadPackage ServicesList   services,
const char *    name
[pure virtual]
 

Look for and load a package. This is called by the script service when a new package is requested.

Parameters:
services  If a DLL package is found, this returns a pointer to the list of services that it contains. Returns NULL if a DLL package was not found.
name  The name of the package to load.
Returns:
True if a package, either a DLL or a directory, was found.

virtual void CoreService::print const Char   msg,
...   
[pure virtual]
 

Write a message to the execution log file.

virtual void CoreService::queueEvent Event   e [pure virtual]
 

Add a message to the event queue and returns immediately.

virtual void CoreService::quit   [pure virtual]
 

Quit out of the event loop.

virtual void CoreService::registerEventLoop EventLoop   el [pure virtual]
 

Register the application event loop.

virtual ScriptService* CoreService::registerFileServer CoreFileServer   fs [pure virtual]
 

Register a file service, to be used by runFile() to locate the requested script.

virtual void CoreService::removeEventListener EventListener   el [pure virtual]
 

Remove an event listener.

virtual void CoreService::run   [pure virtual]
 

Start the event loop. An event loop implementation must have been registered via registerEventLoop() or this function will return immediately.

virtual void CoreService::runBuffer void *    buffer,
unsigned    size,
const Char   name,
Context   context = 0
[pure virtual]
 

Execute script code contained in a memory buffer.

Parameters:
buffer  The memory containing the script code.
size  The size of the script code, in bytes.
name  A name for the buffer which is shown if errors occur.
context  A script execution context (optional).
Returns:
True if the code ran successfully, false on errors.

virtual bool CoreService::runFile const Char   filename,
Context   context = 0
[pure virtual]
 

Run a script file.

Parameters:
filename  The name of the script file to run.
context  The context in which the script should be run. If this is NULL the global context will be used.
Returns:
True if the script was executed successfully, false if the file does not exist.

virtual void CoreService::scheduleEvent Double    when,
EventListener   who,
Event   what
[pure virtual]
 

Schedule an event to be dispatched in the future.

Parameters:
when  How long to wait before sending the message, in seconds.
who  A listener to receive the event. If NULL, the event will be sent to all listeners.
what  The event to send.

virtual void CoreService::sendEvent Event   e [pure virtual]
 

Dispatch an event and wait for processing to finish before returning.

virtual bool CoreService::startEngine int    argc,
char *    argv[]
[pure virtual]
 

Initialize the core service and bring the major subsystems online. Called by the shell to bootstrap the engine on startup.

virtual void CoreService::stopEngine   [pure virtual]
 

Shut down all engine subsystems.


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


Flat Four Engine
Copyright (C) 2001 by 379, Inc.
This page generated by Doxygen