]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MONITOR/AliRecoServerThread.h
Adding base classes for zmq networking and modificiations to event server
[u/mrichter/AliRoot.git] / MONITOR / AliRecoServerThread.h
index 66e6d88979489eec50195a7838f40535113f2f5a..814860fee99e6341053f0118d99cae08ba12954b 100644 (file)
 #include <TMutex.h>
 #include <TCondition.h>
 
+#include "AliThreadedSocket.h"
+
 class TCondition;
-class TMessage;
 class TThread;
 
 class AliReconstruction;
 class AliESDEvent;
 
-namespace zmq{
-       class context_t;
-       class socket_t;
-}
-
-class AliRecoServerThread : public TQObject
+class AliRecoServerThread : public AliThreadedSocket
 {
 public:
   AliRecoServerThread(zmq::context_t *context, AliReconstruction* reco);
   virtual ~AliRecoServerThread();
 
-       Bool_t Start(const char* host);
-       Int_t Stop();
-       Bool_t ForceStop(); // imediate kill it, use it with rarely and with caution
 
-       zmq::context_t*                 GetContext() { return fContext; }
+       Bool_t Start(const char* endpoint);
+
+       const char* GetHost() const { return fHost.Data(); }    
        AliReconstruction*      GetReconstruction() { return fReco; }
-       const char*                                     GetHost() { return fHost.Data(); }
-       TCondition*                                                     Condition() { return fCond; }
+       TCondition*                                     Condition() { return fCond; }
        
-       void Finished(Int_t status); // *SIGNAL*
-
 private:
-       static void* RunThreaded(void* arg);
-       static void SendStreamerInfos(TMessage* mess, zmq::socket_t *sock);
-       static void SendEvent(AliESDEvent* event, zmq::socket_t* socket);
+       static void* RunThrdWrite(void* arg);
        
-       // shared
-       zmq::context_t* fContext;
        AliReconstruction* fReco;
 
        // local        
-       TString                                                                         fHost;
-  TThread*                                                             fThread;
   TCondition*                                          fCond; // condition whether to stop reco/clean exit thread
+  TString fHost;
 
 private:
   AliRecoServerThread(const AliRecoServerThread&);            // Not implemented