Loading...
Searching...
No Matches
serverWidget.h
Go to the documentation of this file.
// -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//
#ifndef BALL_VIEW_KERNEL_SERVERWIDGET_H
#define BALL_VIEW_KERNEL_SERVERWIDGET_H
#ifndef BALL_COMMON_H
# include <BALL/common.h>
#endif
#ifndef BALL_DATATYPE_HASHMAP_H
# include <BALL/DATATYPE/hashMap.h>
#endif
#ifndef BALL_VIEW_KERNEL_MODULARWIDGET_H
# include <BALL/VIEW/KERNEL/modularWidget.h>
#endif
#ifndef BALL_CONCEPT_OBJECTCREATOR_H
# include <BALL/CONCEPT/objectCreator.h>
#endif
#ifndef BALL_SYSTEM_NETWORKING_H
# include <BALL/SYSTEM/networking.h>
#endif
#ifndef BALL_VIEW_KERNEL_THREADS_H
# include <BALL/VIEW/KERNEL/threads.h>
#endif
#include <QtCore/QTimer>
#include <QtWidgets/QLabel>
class QLabel;
namespace BALL
{
class Composite;
namespace VIEW
{
class ServerPreferences;
class Preferences;
class BALL_DEPRECATED BALL_VIEW_EXPORT ServerWidget
: public QObject,
public ModularWidget
{
Q_OBJECT
public:
BALL_EMBEDDABLE(ServerWidget,ModularWidget)
class BALL_DEPRECATED BALL_VIEW_EXPORT NotCompositeObject: public Exception::GeneralException
{
public:
NotCompositeObject(const char* file, int line);
};
class BALL_DEPRECATED BALLViewServer
: public virtual BALLThread,
public virtual TCPServerThread
{
public:
BALLViewServer(ServerWidget* parent, Size port, bool restart = true);
void sendObject();
virtual void run();
virtual void handleConnection();
void setLocked(bool is_locked);
protected:
ServerWidget* parent_widget_;
Composite* received_composite_;
typedef HashMap<unsigned long, Composite *> CompositeHashMap;
CompositeHashMap composite_hashmap_;
Size port_;
bool is_locked_;
};
ServerWidget(QWidget* parent = 0, const char* name = 0);
// only for Python interface
ServerWidget(const ServerWidget& server);
virtual ~ServerWidget();
virtual void clear();
virtual void activate() {};
virtual void deactivate() {};
void setPort(const int port);
int getPort() const;
void registerObjectCreator(const ObjectCreator& s);
void unregisterObjectCreator();
ObjectCreator& getObjectCreator();
const ObjectCreator& getObjectCreator() const;
virtual void initializeWidget(MainControl& main_control);
virtual void finalizeWidget(MainControl& main_control);
virtual void initializePreferencesTab(Preferences &preferences);
virtual void finalizePreferencesTab(Preferences &preferences);
virtual void applyPreferences();
virtual bool isValid() const;
virtual void dump(std::ostream& s = std::cout, Size depth = 0) const;
virtual void changeLock(bool lock);
public Q_SLOTS:
void handleLocking(bool lock);
Q_SIGNALS:
void lockRequested(bool lock);
private:
BALLViewServer server_;
ObjectCreator *object_creator_;
// the port to bind to
int port_;
ServerPreferences *server_preferences_;
QLabel *server_icon_;
static const char *mini_ray_xpm_[];
};
# ifndef BALL_NO_INLINE_FUNCTIONS
# include <BALL/VIEW/KERNEL/serverWidget.iC>
# endif
}// namespace VIEW
}// namespace BALL
#endif // BALL_VIEW_KERNEL_SERVER_H
BALL_DEPRECATED
#define BALL_DEPRECATED
Definition COMMON/global.h:64
BALL_VIEW_EXPORT
#define BALL_VIEW_EXPORT
Definition COMMON/global.h:52
BALL::Composite
Definition composite.h:74
BALL::Exception::GeneralException::GeneralException
GeneralException()
Default constructor.
BALL::HashMap
HashMap class based on the STL map (containing serveral convenience functions).
Definition hashMap.h:74
BALL::ObjectCreator
Definition objectCreator.h:36
BALL::TCPServerThread::TCPServerThread
TCPServerThread(Size port, bool asynchronous=true, bool restart=true)
BALL::VIEW::BALLThread::BALLThread
BALLThread()
BALL::VIEW::MainControl
Definition mainControl.h:118
BALL::VIEW::ModularWidget::ModularWidget
ModularWidget(const char *name="<ModularWidget>")
BALL::VIEW::Preferences
Definition preferences.h:43
BALL::VIEW::ServerPreferences
Definition serverPreferences.h:40
BALL::VIEW::ServerWidget::BALLViewServer
Definition serverWidget.h:93
BALL::VIEW::ServerWidget::BALLViewServer::composite_hashmap_
CompositeHashMap composite_hashmap_
Definition serverWidget.h:125
BALL::VIEW::ServerWidget::BALLViewServer::sendObject
void sendObject()
BALL::VIEW::ServerWidget::BALLViewServer::BALLViewServer
BALLViewServer(ServerWidget *parent, Size port, bool restart=true)
BALL::VIEW::ServerWidget::BALLViewServer::port_
Size port_
Definition serverWidget.h:127
BALL::VIEW::ServerWidget::BALLViewServer::setLocked
void setLocked(bool is_locked)
BALL::VIEW::ServerWidget::BALLViewServer::handleConnection
virtual void handleConnection()
BALL::VIEW::ServerWidget::BALLViewServer::parent_widget_
ServerWidget * parent_widget_
Definition serverWidget.h:121
BALL::VIEW::ServerWidget::BALLViewServer::received_composite_
Composite * received_composite_
Definition serverWidget.h:122
BALL::VIEW::ServerWidget::BALLViewServer::CompositeHashMap
HashMap< unsigned long, Composite * > CompositeHashMap
Definition serverWidget.h:124
BALL::VIEW::ServerWidget::BALLViewServer::is_locked_
bool is_locked_
Definition serverWidget.h:128
BALL::VIEW::ServerWidget::BALLViewServer::run
virtual void run()
BALL::VIEW::ServerWidget::NotCompositeObject::NotCompositeObject
NotCompositeObject(const char *file, int line)
BALL::VIEW::ServerWidget::handleLocking
void handleLocking(bool lock)
BALL::VIEW::ServerWidget::applyPreferences
virtual void applyPreferences()
BALL::VIEW::ServerWidget::dump
virtual void dump(std::ostream &s=std::cout, Size depth=0) const
BALL::VIEW::ServerWidget::initializePreferencesTab
virtual void initializePreferencesTab(Preferences &preferences)
BALL::VIEW::ServerWidget::finalizePreferencesTab
virtual void finalizePreferencesTab(Preferences &preferences)
BALL::VIEW::ServerWidget::~ServerWidget
virtual ~ServerWidget()
BALL::VIEW::ServerWidget::initializeWidget
virtual void initializeWidget(MainControl &main_control)
BALL::VIEW::ServerWidget::getObjectCreator
const ObjectCreator & getObjectCreator() const
BALL::VIEW::ServerWidget::unregisterObjectCreator
void unregisterObjectCreator()
BALL::VIEW::ServerWidget::setPort
void setPort(const int port)
BALL::VIEW::ServerWidget::lockRequested
void lockRequested(bool lock)
BALL::VIEW::ServerWidget::isValid
virtual bool isValid() const
BALL::VIEW::ServerWidget::getObjectCreator
ObjectCreator & getObjectCreator()
BALL::VIEW::ServerWidget::ServerWidget
ServerWidget(const ServerWidget &server)
BALL::VIEW::ServerWidget::deactivate
virtual void deactivate()
Definition serverWidget.h:173
BALL::VIEW::ServerWidget::clear
virtual void clear()
BALL::VIEW::ServerWidget::activate
virtual void activate()
Definition serverWidget.h:169
BALL::VIEW::ServerWidget::changeLock
virtual void changeLock(bool lock)
BALL::VIEW::ServerWidget::finalizeWidget
virtual void finalizeWidget(MainControl &main_control)
BALL::VIEW::ServerWidget::ServerWidget
ServerWidget(QWidget *parent=0, const char *name=0)
BALL::VIEW::ServerWidget::registerObjectCreator
void registerObjectCreator(const ObjectCreator &s)
BALL::VIEW::ServerWidget::getPort
int getPort() const
QObject
QWidget
common.h
BALL_EMBEDDABLE
#define BALL_EMBEDDABLE(TYPE, BASE)
Definition embeddable.h:31
hashMap.h
modularWidget.h
BALL::Exception
Definition COMMON/exception.h:33
BALL::VIEW
Definition constraints.h:35
BALL
Definition constants.h:13
BALL::Size
BALL_SIZE_TYPE Size
Definition COMMON/global.h:114
networking.h
objectCreator.h
threads.h