Loading...
Searching...
No Matches
client.h
Go to the documentation of this file.
// -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//
#ifndef BALL_CONCEPT_CLIENT_H
#define BALL_CONCEPT_CLIENT_H
#ifndef BALL_COMMON_H
# include <BALL/common.h>
#endif
#ifndef BALL_CONCEPT_COMPOSITE_H
# include <BALL/CONCEPT/composite.h>
#endif
#ifndef BALL_SYSTEM_NETWORKING_H
# include <BALL/SYSTEM/networking.h>
#endif
#ifndef BALL_CONCEPT_PERSISTENTOBJECT_H
# include <BALL/CONCEPT/persistentObject.h>
#endif
#ifndef BALL_CONCET_TEXTPERSISTENCEMANAGER_H
# include <BALL/CONCEPT/textPersistenceManager.h>
#endif
#define DEFAULT_PORT 20000
namespace BALL
{
class BALL_EXPORT Client
{
public:
enum Command
{
COMMAND__UNKOWN = 0,
COMMAND__SEND_OBJECT = 1,
NUMBER_OF_COMMANDS
};
class BALL_EXPORT InvalidClient
: public Exception::GeneralException
{
public:
InvalidClient(const char* file, int line);
};
class BALL_EXPORT NoPersistentObject
: public Exception::GeneralException
{
public:
NoPersistentObject(const char* file, int line);
};
Client();
Client(const String& host, int port = 20000);
virtual ~Client();
virtual void clear();
void connect(const String& host, int port = 20000);
void insert(Composite &composite);
virtual bool isValid() const;
virtual void dump(std::ostream& s = std::cout, Size depth = 0) const;
private:
String host_;
int port_;
TextPersistenceManager pm_;
};
} // namespace BALL
#endif // BALL_CONCEPT_CLIENT_H
BALL_EXPORT
#define BALL_EXPORT
Definition COMMON/global.h:50
BALL::Client::InvalidClient::InvalidClient
InvalidClient(const char *file, int line)
BALL::Client::NoPersistentObject::NoPersistentObject
NoPersistentObject(const char *file, int line)
BALL::Client::connect
void connect(const String &host, int port=20000)
BALL::Client::Command
Command
Definition client.h:58
BALL::Client::NUMBER_OF_COMMANDS
@ NUMBER_OF_COMMANDS
next free command.
Definition client.h:66
BALL::Client::COMMAND__SEND_OBJECT
@ COMMAND__SEND_OBJECT
sent command. This command will be used for indicating a new object that is about to be received
Definition client.h:63
BALL::Client::COMMAND__UNKOWN
@ COMMAND__UNKOWN
unknown command.
Definition client.h:60
BALL::Client::clear
virtual void clear()
BALL::Client::dump
virtual void dump(std::ostream &s=std::cout, Size depth=0) const
BALL::Client::insert
void insert(Composite &composite)
BALL::Client::isValid
virtual bool isValid() const
BALL::Client::~Client
virtual ~Client()
BALL::Client::Client
Client()
BALL::Client::Client
Client(const String &host, int port=20000)
BALL::Composite
Definition composite.h:74
BALL::Exception::GeneralException
Definition COMMON/exception.h:61
BALL::String
Definition string.h:57
BALL::TextPersistenceManager
Definition textPersistenceManager.h:29
common.h
composite.h
BALL
Definition constants.h:13
BALL::Size
BALL_SIZE_TYPE Size
Definition COMMON/global.h:114
networking.h
persistentObject.h
textPersistenceManager.h