#include <server.h>
Inheritance diagram for VIEW::Server:
Public Member Functions | |
Constructors | |
Server (QWidget *parent=0, const char *name=0) throw () | |
Default Constructor. | |
Server (const Server &server) | |
Destructors | |
virtual | ~Server () throw () |
Destructor. | |
virtual void | clear () throw () |
Explicit default initialization. | |
Accessors: inspectors and mutators | |
void | activate () throw () |
Activates the server. | |
void | deactivate () throw () |
Deactivates the server. | |
void | setPort (const int port) throw () |
Set the server port. | |
int | getPort () const throw () |
Return the server port. | |
void | registerObjectCreator (const ObjectCreator &s) throw () |
Register a ObjectCreator that is used for converting PersistentObject objects into Composite objects. | |
void | unregisterObjectCreator () throw () |
Reset the ObjectCreator. | |
virtual void | initializeWidget (MainControl &main_control) throw () |
Initialize the server widget. | |
virtual void | finalizeWidget (MainControl &main_control) throw () |
Remove the server widget. | |
virtual void | initializePreferencesTab (Preferences &preferences) throw () |
Initialize a preferences tab for the server. | |
virtual void | finalizePreferencesTab (Preferences &preferences) throw () |
Remove the preferences tab. | |
virtual void | applyPreferences () throw () |
Apply the preferences of the specific tab. | |
debuggers and diagnostics | |
virtual bool | isValid () const throw () |
Internal state and consistency self-validation. | |
virtual void | dump (std::ostream &s=std::cout, Size depth=0) const throw () |
Dump the current state of this server to the output ostream with a dumping depth. | |
Protected Member Functions | |
Timer method. | |
virtual void | timer () |
Timer method. |
The class Server handles all incoming PersistentObject objects, converts them into Composite objects (if possible) and sents them through the ConnectionObject tree with the message NewCompositeMessage. Also it stores all received Composite objects and replaces them if the same Composite object is received again. If a Composite object is replaced the message RemovedCompositeMessage will be sent through the ConnectionObject tree and after that the the message NewCompositeMessage with the new received composite will be sent.
|
Default Constructor. The state of this server is:
|
|
Destructor.
|
|
Activates the server. Creates a new socket stream with the given port and enables the timer that will check every second whether an object will be available at the stream. After this method the timer method will be called every second. Must be called before other methods! Calls QTTimer::startTimer
|
|
Apply the preferences of the specific tab. This method applies the preferences of the own tab ServerPreferences to this server. This method is called automatically by the method applyPreferencesTab of the class MainControl. See ModularWidget for more information concerning preferences tabs.
Reimplemented from VIEW::ModularWidget. |
|
Explicit default initialization. Calls QTTimer::clear. Calls ConnectionObject::clear.
Reimplemented from VIEW::ModularWidget. |
|
Deactivates the server. If this server is already running this method stops the server and closes the socket stream. Calls QTTimer::stopTimer
|
|
Dump the current state of this server to the output ostream with a dumping depth.
Reimplemented from VIEW::ModularWidget. |
|
Remove the preferences tab. This method removes the ServerPreferences tab of this server from the Preferences dialog of the MainControl. This method is called automatically by the method aboutToExit method of the class MainControl at the end of the application. See ModularWidget for more information concerning preferences tabs.
Reimplemented from VIEW::ModularWidget. |
|
Remove the server widget. This method deletes the icon of this server and removes it from MainControl. This method will be called by aboutToExit of the class MainControl.
Reimplemented from VIEW::ModularWidget. |
|
Return the server port. Return the port of this server.
|
|
Initialize a preferences tab for the server. This method creates the preferences tab ServerPreferences for this server and inserts it into the Preferences dialog of the MainControl. This method is called automatically by the method show of the class MainControl at the start of the application. See ModularWidget for more information concerning preferences tabs.
Reimplemented from VIEW::ModularWidget. |
|
Initialize the server widget. This method initializes the icon of this server and adds it to MainControl. This method will be called by show of the class MainControl.
Reimplemented from VIEW::ModularWidget. |
|
Internal state and consistency self-validation. Calls {ConnectionObject::isValid}.
Reimplemented from VIEW::ConnectionObject. |
|
Register a ObjectCreator that is used for converting PersistentObject objects into Composite objects. Every ObjectCreator, that is still registered, when a Server instance is destructed, will be deleted.
|
|
Set the server port. Set port of this server. Must be called before activate to have any effect.
|
|
Timer method. Virtually overridden method. This method handles the socket stream. Every second it checks whether a new object is available at the stream. If this is the case the stream will be accepted and the incoming object will be reveiced. At the moment only Composite objects will be accepted. If another object is received the exception NotCompositeObject will be thrown.
|
|
Reset the ObjectCreator. After calling this method PersistentObject objects will be converted using the default ObjectCreator.
|