#include <client.h>
Classes |
|
class | InvalidClient |
InvalidClient
exception class. More... |
|
class | NoPersistentObject |
NoPersistentObject
exception class. More... |
|
Public Types |
|
enum | Command { COMMAND__UNKOWN = 0, COMMAND__SEND_OBJECT = 1, NUMBER_OF_COMMANDS } |
Command enums for the Client and Server.
More... |
|
Public Member Functions |
|
Constructors
|
|
Client () | |
Default Constructor. |
|
Client (const String &host, int port=20000) | |
Detailed state initializing
constructor. |
|
Destructors
|
|
virtual | ~Client () |
Destructor. |
|
virtual void | clear () |
Explicit default initialization.
|
|
Accessors: inspectors and mutators
|
|
void | connect (const String &host, int port=20000) |
Connects to a specified host and
port. |
|
void | insert (Composite &composite) throw (InvalidClient, NoPersistentObject) |
Adds a new composite. |
|
debuggers and diagnostics
|
|
virtual bool | isValid () const |
Internal state and consistency
self-validation. |
|
virtual void | dump (std::ostream &s=std::cout, Size depth=0) const |
Internal value dump. |
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).
BALL::Client::Client | ( | ) |
BALL::Client::Client | ( | const String & | host, | |
int | port =
20000 |
|||
) |
virtual void BALL::Client::clear | ( | ) | [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 void BALL::Client::dump | ( | std::ostream & | s =
std::cout , |
|
Size | depth =
0 |
|||
) | const [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 | ) | throw (InvalidClient, NoPersistentObject) |
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 bool BALL::Client::isValid | ( | ) | const [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