Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

GWE::GWEInterface Class Reference

Interface definition for G World Engine (GWE) implementations. More...

#include <GWEInterface.h>

Inheritance diagram for GWE::GWEInterface:

Inheritance graph
[legend]
Collaboration diagram for GWE::GWEInterface:

Collaboration graph
[legend]
List of all members.

Public Slots

virtual void radiateInfluence (GCS::GElementInfluence &influence)=0
virtual void routeInfluence (const GCS::GElementID &destination, GCS::GElementInfluence &influence)=0

Signals

void elementOpened (const GCS::GElement *element)
void elementClosed (const GCS::GElement *element)

Public Member Functions

virtual ~GWEInterface ()
virtual bool add (GCS::GElement *)=0
virtual const GCS::GElementread (const GCS::GElementID &) const=0
virtual GCS::GElementopen (const GCS::GElementID &)=0
virtual bool close (GCS::GElement *)=0
virtual bool postDelete (GCS::GElement *)=0

Detailed Description

Interface definition for G World Engine (GWE) implementations.

Author:
Raphael Langerhorst
GWEInterface defines the public interface of the GWE. The GWEs single purpose is persistent element management and thus has a very slim and effective interface definition. Whether this implementation is a dynamic network distributed hierarchical server structure with database backend or a simple local implementation does not matter.

Note:
Some documentation given here on this class (or interface) depends on the actual implementation that is used; the implementation is "supposed" to do what the documentation of the method say.

Todo:
use exceptions as they provide a better way for failure description.


Constructor & Destructor Documentation

virtual GWE::GWEInterface::~GWEInterface  )  [inline, virtual]
 

Virtual destructor to allow clean memory management with derived classes.


Member Function Documentation

virtual bool GWE::GWEInterface::add GCS::GElement  )  [pure virtual]
 

Adds given element to the GWE

If false is returned, either the element already exists or it could not be added for various reasons.

Returns:
true on success

Implemented in GWE::GWEInterfaceSimple.

virtual bool GWE::GWEInterface::close GCS::GElement  )  [pure virtual]
 

Closes given element.

Returns:
true when the specified element was found and closed;
See also:
open()

Implemented in GWE::GWEInterfaceSimple.

void GWE::GWEInterface::elementClosed const GCS::GElement element  )  [signal]
 

Emitted when an element is closed.

Note:
Of course emitting needs be done in the derived class.

void GWE::GWEInterface::elementOpened const GCS::GElement element  )  [signal]
 

Emitted when an element is opened.

Note:
Of course emitting needs be done in the derived class.

virtual GCS::GElement* GWE::GWEInterface::open const GCS::GElementID  )  [pure virtual]
 

Open an element for general purposes (e.g. executing the agents,...)

Note:
Every element should only be opened once.
Returns:
NULL if element does not exist or is already opened.
See also:
close()

Implemented in GWE::GWEInterfaceSimple.

virtual bool GWE::GWEInterface::postDelete GCS::GElement  )  [pure virtual]
 

In order to persistently remove an element this method needs to be used, it makes sure that the element stops executing and is properly removed (persistent) from memory.

Although it may take some time until the element is truly removed, the call itself is (or should be) non-blocking.

Returns:
true if the specified element was found and queued for deletion.

Implemented in GWE::GWEInterfaceSimple.

virtual void GWE::GWEInterface::radiateInfluence GCS::GElementInfluence influence  )  [pure virtual, slot]
 

Forwards given influence to all elements that are near to the sender() of this signal.

See also:
GElement::radiateInfluence()

Implemented in GWE::GWEInterfaceSimple.

virtual const GCS::GElement* GWE::GWEInterface::read const GCS::GElementID  )  const [pure virtual]
 

Open an element for reading only.

Returns:
NULL if element does not exist.

Implemented in GWE::GWEInterfaceSimple.

virtual void GWE::GWEInterface::routeInfluence const GCS::GElementID destination,
GCS::GElementInfluence influence
[pure virtual, slot]
 

Routes an influence from an element to given destination.

See also:
GElement::routeInfluence()

Implemented in GWE::GWEInterfaceSimple.


The documentation for this class was generated from the following file:
Generated on Thu Oct 21 21:18:26 2004 for G System by doxygen 1.3.6