CVR-Lib last update 20 Sep 2009

cvr::guiServer Class Reference
[Visualization Tools]

Class guiServer. More...

#include <cvrGuiServer.h>

Collaboration diagram for cvr::guiServer:

Collaboration graph
[legend]

List of all members.

Public Types

enum  eServerState { NotStarted, Running, Stopped }

Static Public Member Functions

static bool start ()
static eServerState state ()
static bool stop ()
static bool representsGuiThread ()


Detailed Description

Class guiServer.

The guiServer holds the one an only thread which executes the main loop of the used GUI Toolkit, like GTK+, GTKMM, WxWidgets, QT or MFC. If you are just using the viewers and other GUI related classes, this server should never come in your way.

No one can create an instance of the guiServer, which is a monostate object. Some public static functions are provided to check and alter the state of the main loop:

The server can be started only once in the whole program, and this will occur automatically when you use any viewer or GUI element in the library. If you are writting a new GUI element, then you have to ensure that the server is running just before you have to interact with any interface related event. It is a bad idea to start the server too early, since it will waste some time.

The stop() method is provided for completeness and debugging purposes only. This method should never ever be called, as the main loop cannot be started again, due to limitation of some toolkits.

The general implementation of the current classes is divided in the files cvrGuiServer.cpp and lti???Server.cpp, where the latter provides the toolkit specific issues (the methods toolkitInit(), toolkitMainLoop() and toolkitStop()).


Member Enumeration Documentation

GUI Server State.

Enumerator:
NotStarted  The server has not been started yet.

Running  The server is already running and attending GUI requests.
Stopped  The server has been stopped.


Member Function Documentation

static bool cvr::guiServer::representsGuiThread (  )  [static]

Returns true if called within the thread attending the main loop.

static bool cvr::guiServer::start (  )  [static]

Start the server.

This method returns until the server is running and ready to attend requests.

Returns:
true if successful, false otherwise (e.g. the server was manually stopped or is already running.)

static eServerState cvr::guiServer::state (  )  [static]

Check for the server state.

static bool cvr::guiServer::stop (  )  [static]

Stop the server.

If the server has not been started at all, this method does nothing, but to return false, as it cannot be stopped!

Warning:
If you stop the server, you cannot re-start it within your application. This method is public for debuggin purposes and for completenes, but you should never call it, unless you really know what you are doing.
Returns:
true if the thread could be stopped or false if it was already stopped or if the server wasn't started at all.


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

Generated on Sun Sep 20 22:09:09 2009 for CVR-Lib by Doxygen 1.5.8