00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef _RGEDDEI_PROCESSORFORWARDER_H
00011 #define _RGEDDEI_PROCESSORFORWARDER_H
00012
00013 #include <qptrlist.h>
00014 #include <qmutex.h>
00015 #include <qstring.h>
00016 #include <qserversocket.h>
00017
00018 #ifdef __GEDDEI_BUILD
00019 #include "processor.h"
00020 #else
00021 #include <geddei/processor.h>
00022 #endif
00023 using namespace Geddei;
00024
00025 #define GEDDEI_PORT 16661
00026
00027 namespace Geddei
00028 {
00029
00030 class DRCoupling;
00031
00039 class ProcessorForwarder: public QServerSocket
00040 {
00041
00042
00043 static QMutex *theReaper;
00044 static QPtrList<RLConnection> theGraveyard;
00045 static QMutex *reaper();
00046 void clearGraveyard();
00047
00048 friend class ProcessorForwarderLink;
00049
00050
00051 virtual void newConnection(int socket);
00052
00057 virtual Processor *lookup(uint key, const QString &name) = 0;
00058
00066 static QSocketDevice *login(const QString &host, const uint key);
00067
00068 public:
00075 static LRConnection *createConnection(Source *source, const uint sourceIndex, const uint bufferSize, const QString &sinkHost, const uint sinkKey, const QString &sinkProcessorName, const uint sinkIndex);
00076
00082 static const bool deleteConnection(const QString &sinkHost, const uint sinkKey, const QString &sinkProcessorName, const uint sinkIndex);
00083
00088 static void deleteMeLater(RLConnection *me);
00089
00095 static DRCoupling *createCoupling(DomProcessor *dom, const QString &host, const uint key, const QString &type);
00096
00104 static const bool deleteCoupling(const QString &host, const uint key, const uint subProcessorKey);
00105
00109 ProcessorForwarder(const uint port = 0);
00110 };
00111
00112 };
00113
00114 #endif