GWE::GDataController Class Reference

Interface for GWE data controllers, includes network and database. More...

#include <GDataController.h>

Inheritance diagram for GWE::GDataController:

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

Collaboration graph
[legend]
List of all members.

Public Slots

virtual bool add (GCS::GElement *)=0
virtual bool writeOpenElementToStorage (const GCS::GElementID &)=0
virtual bool close (const GCS::GElementID &)=0
virtual bool postDelete (const GCS::GElementID &)=0
virtual void shutdown ()=0

Signals

void elementAdded (const GCS::GElementID &)
void elementUpdated (const GCS::GElementID &)
void elementOpened (const GCS::GElementID &)
void elementClosed (const GCS::GElementID &)
void elementDeleted (const GCS::GElementID &)

Public Member Functions

 GDataController (QObject *parent=0)
virtual ~GDataController ()
virtual GCS::GElementopen (const GCS::GElementID &)=0
virtual GCS::GElementgetOpenElement (const GCS::GElementID &)=0
virtual QList< GCS::GElementIDgetListOfOpenElements ()=0
virtual QList< GCS::GElementIDgetListOfAllElements ()=0
virtual bool isPrimaryElement (const GCS::GElementID &) const

Detailed Description

Interface for GWE data controllers, includes network and database.

GDataController GDataController.h

Author:
Raphael Langerhorst
The Data Controller is responsible for all data management: transportation, storing, synchronizing, ...


Constructor & Destructor Documentation

GWE::GDataController::GDataController ( QObject *  parent = 0  )  [inline]

Constructor.

virtual GWE::GDataController::~GDataController (  )  [inline, virtual]

Virtual destructor.


Member Function Documentation

virtual bool GWE::GDataController::add ( GCS::GElement  )  [pure virtual, slot]

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::GXmlDataController.

virtual bool GWE::GDataController::close ( const GCS::GElementID  )  [pure virtual, slot]

Closes given element.

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

Implemented in GWE::GXmlDataController.

void GWE::GDataController::elementAdded ( const GCS::GElementID  )  [signal]

Emitted after an element was added.

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

void GWE::GDataController::elementClosed ( const GCS::GElementID  )  [signal]

Emitted when an element was closed. Closed elements are NOT in memory anymore.

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

void GWE::GDataController::elementDeleted ( const GCS::GElementID  )  [signal]

Emitted when an element was removed.

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

void GWE::GDataController::elementOpened ( const GCS::GElementID  )  [signal]

Emitted when an element is opened.

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

void GWE::GDataController::elementUpdated ( const GCS::GElementID  )  [signal]

Emitted after an element was updated. This can be an update when receiving data from other GWE Servers for example. Normally the GWE Controller should close opened elements without saving them and open it again if needed.

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

virtual QList<GCS::GElementID> GWE::GDataController::getListOfAllElements (  )  [pure virtual]

Returns:
a list with all IDs of all stored elements.

Implemented in GWE::GXmlDataController.

virtual QList<GCS::GElementID> GWE::GDataController::getListOfOpenElements (  )  [pure virtual]

Returns:
a list with IDs of all open elements.

Implemented in GWE::GXmlDataController.

virtual GCS::GElement* GWE::GDataController::getOpenElement ( const GCS::GElementID  )  [pure virtual]

Get an already opened element. The element must previously have been opened with open(), otherwise NULL is returned.

Returns:
a currently open element with given ID or NULL if element is not opened.

Implemented in GWE::GXmlDataController.

virtual bool GWE::GDataController::isPrimaryElement ( const GCS::GElementID  )  const [inline, virtual]

Returns:
true when the element with given ID is a primary element for this GWE Server.

Reimplemented in GWE::GXmlDataController.

virtual GCS::GElement* GWE::GDataController::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::GXmlDataController.

virtual bool GWE::GDataController::postDelete ( const GCS::GElementID  )  [pure virtual, slot]

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::GXmlDataController.

virtual void GWE::GDataController::shutdown (  )  [pure virtual, slot]

This should be called before closing the application, all required cleanup is done here.

Implemented in GWE::GXmlDataController.

virtual bool GWE::GDataController::writeOpenElementToStorage ( const GCS::GElementID  )  [pure virtual, slot]

Forces a full backup of specified element. This is useful when some changes were made to an open element and the complete element should be written back to the storage.

Implemented in GWE::GXmlDataController.


The documentation for this class was generated from the following file:
Generated on Thu Nov 16 07:49:37 2006 for G System by  doxygen 1.4.7