00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef _GEDDEI_LRCONNECTION_H
00012 #define _GEDDEI_LRCONNECTION_H
00013
00014 #include <qmutex.h>
00015
00016 #ifdef __GEDDEI_BUILD
00017 #include "qsocketsession.h"
00018 #include "lxconnectionreal.h"
00019 #else
00020 #include <qtextra/qsocketsession.h>
00021 #include <geddei/lxconnectionreal.h>
00022 #endif
00023 using namespace Geddei;
00024
00025 class QSocketDevice;
00026
00027 namespace Geddei
00028 {
00029
00030 class ProcessorForwarder;
00031
00040 class LRConnection: public LxConnectionReal
00041 {
00042
00043 virtual const SignalTypeRef type();
00044
00045
00046 virtual const bool waitUntilReady();
00047 virtual void setType(const SignalType *type);
00048 virtual void resetType();
00049 virtual void sourceStopping();
00050 virtual void sourceStopped();
00051 virtual void reset() {}
00052 virtual void pushPlunger();
00053 virtual void startPlungers();
00054 virtual void plungerSent();
00055 virtual void noMorePlungers();
00056 virtual const uint maximumScratchElements(const uint) { return Undefined; }
00057 virtual const uint maximumScratchElementsEver() { return Undefined; }
00058 virtual void enforceMinimum(const uint elements);
00059
00060
00061 virtual void transport(const BufferData &data);
00062 virtual void bufferWaitForFree();
00063 virtual const uint bufferElementsFree();
00064
00065 QString theRemoteHost, theRemoteProcessorName;
00066 uint theRemoteKey, theRemoteIndex;
00067
00068 QSocketSession theSink;
00069 QMutex theTrapdoor;
00070 void openTrapdoor() { theTrapdoor.lock(); }
00071 void closeTrapdoor() { theTrapdoor.unlock(); }
00072 const bool trapdoor() { bool ret = theTrapdoor.tryLock(); if(ret) theTrapdoor.unlock(); return !ret; }
00073
00078 friend class ProcessorForwarder;
00079 LRConnection(Source *newSource, const uint newSourceIndex, QSocketDevice *newSink);
00080
00084 ~LRConnection();
00085
00086 public:
00087 void setCredentials(const QString &remoteHost, const uint remoteKey, const QString &remoteProcessorName, const uint remoteIndex);
00088 };
00089
00090 };
00091
00092 #endif