BALL
1.4.2
|
#include <BALL/CONCEPT/client.h>
Classes | |
class | InvalidClient |
class | NoPersistentObject |
Public Types | |
enum | Command { COMMAND__UNKOWN = 0, COMMAND__SEND_OBJECT = 1, NUMBER_OF_COMMANDS } |
Public Member Functions | |
Constructors | |
Client () | |
Client (const String &host, int port=20000) | |
Destructors | |
virtual | ~Client () |
virtual void | clear () |
Accessors: inspectors and mutators | |
void | connect (const String &host, int port=20000) |
void | insert (Composite &composite) |
debuggers and diagnostics | |
virtual bool | isValid () const |
virtual void | dump (std::ostream &s=std::cout, Size depth=0) const |
Private Attributes | |
String | host_ |
int | port_ |
TextPersistenceManager | pm_ |
Client class. The class Client introduces a rudimentary interface for sending Composite objects to the visualization. In this version only the one way direction from this client to the visualization is possible. In the future there is also a bidirectional data exchange intended. If a Composite is sent two times than the graphical representation of the first one will be replaced through the new graphical representation of the second one. For example if the structure of the Composite is continually changed by a program so the visualization of this Composite changes as well. The Client class connects to the Server class that is part of the VIEW library. See Server for further information.
Command enums for the Client and Server. These enums specify the commands the server is able to understand (at the moment).
Enumerator | |
---|---|
COMMAND__UNKOWN |
unknown command. |
COMMAND__SEND_OBJECT |
sent command. This command will be used for indicating a new object that is about to be received |
NUMBER_OF_COMMANDS |
next free command. |
BALL::Client::Client | ( | ) |
BALL::Client::Client | ( | const String & | host, |
int | port = 20000 |
||
) |
|
virtual |
Destructor.
|
virtual |
Explicit default initialization. Empty for further purpose.
void BALL::Client::connect | ( | const String & | host, |
int | port = 20000 |
||
) |
Connects to a specified host and port. This method connects this client to a specified host and port. Must be called before any other methodes!
host | the host (a string) to connect to |
port | the port number of the host |
|
virtual |
Internal value dump. Dumps the current host and port of this client to the output ostream s with dumping depth depth.
s | output stream where to output the host and port of this client |
depth | the dumping depth |
void BALL::Client::insert | ( | Composite & | composite | ) |
Adds a new composite. Inserts a new Composite to this client. With this method Composite's can be added to the visualization. If the same Composite was already added before it will be replaced by the new representation of composite. The Composite will be put into the TextPersistenceManager that has a connection to a socket stream connected to the given host and port. The TextPersistenceManager will then use that socket stream to write the Composite into.
composite | the Composite to be added to the client (visualization) |
InvalidClient | if the client has no connection to a server |
NoPersistentObject | if the composite is not a PersistentObject |
|
virtual |
Internal state and consistency self-validation. Initiates self-validation of the internal state of this client. If the this client has a connection to a server than true
is returned, false
otherwise.
true
if this client has a connection to a server, false
otherwise
|
private |