00001 #ifndef _REC_ROBOTINO_SERVER_SERVERIMPL_H_ 00002 #define _REC_ROBOTINO_SERVER_SERVERIMPL_H_ 00003 00004 #include "rec/robotino/server/defines.h" 00005 #include "rec/iocontrol/remotestate/SensorState.h" 00006 #include "rec/iocontrol/remotestate/SetState.h" 00007 00008 #include <QObject> 00009 #include <QTcpSocket> 00010 #include <QByteArray> 00011 00012 namespace rec 00013 { 00014 namespace robotino 00015 { 00016 namespace server 00017 { 00018 class ServerImpl : public QObject 00019 { 00020 public: 00021 ServerImpl( bool isMaster ) 00022 : _isMaster( isMaster ) 00023 , _run ( true ) 00024 { 00025 } 00026 00027 virtual ~ServerImpl() 00028 { 00029 } 00030 00034 void stop() { _run = false; } 00035 00039 virtual void setSensorState( const rec::iocontrol::remotestate::SensorState& sensorState ) = 0; 00040 00041 virtual void run( QTcpSocket& socket, const QByteArray& alreadyReceived ) = 0; 00042 00043 protected: 00044 const bool _isMaster; 00045 volatile bool _run; 00046 }; 00047 } 00048 } 00049 } 00050 00051 #endif //_REC_ROBOTINO_SERVER_SERVERIMPL_H_