Removing additional 0MQ dependency
[u/mrichter/AliRoot.git] / MONITOR / AliRecoServerThread.h
CommitLineData
7e0cf530 1// Author: Mihai Niculescu 2013
2
3/**************************************************************************
4 * Copyright(c) 1998-2013, ALICE Experiment at CERN, all rights reserved. *
5 * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for *
6 * full copyright notice. *
7 **************************************************************************/
8
9#ifndef __AliRecoServerThread_H__
10#define __AliRecoServerThread_H__
11
12#include <TQObject.h>
13#include <RQ_OBJECT.h>
14#include <TMutex.h>
15#include <TCondition.h>
16
17class TCondition;
18class TMessage;
19class TThread;
20
21class AliReconstruction;
22class AliESDEvent;
23
24namespace zmq{
25 class context_t;
26 class socket_t;
27}
28
29class AliRecoServerThread : public TQObject
30{
31public:
32 AliRecoServerThread(zmq::context_t *context, AliReconstruction* reco);
33 virtual ~AliRecoServerThread();
34
35 Bool_t Start(const char* host);
36 Int_t Stop();
37 Bool_t ForceStop(); // imediate kill it, use it with rarely and with caution
38
39 zmq::context_t* GetContext() { return fContext; }
40 AliReconstruction* GetReconstruction() { return fReco; }
41 const char* GetHost() { return fHost.Data(); }
42 TCondition* Condition() { return fCond; }
43
44 void Finished(Int_t status); // *SIGNAL*
45
46private:
47 static void* RunThreaded(void* arg);
48 static void SendStreamerInfos(TMessage* mess, zmq::socket_t *sock);
49 static void SendEvent(AliESDEvent* event, zmq::socket_t* socket);
50
51 // shared
52 zmq::context_t* fContext;
53 AliReconstruction* fReco;
54
55 // local
56 TString fHost;
57 TThread* fThread;
58 TCondition* fCond; // condition whether to stop reco/clean exit thread
59
60private:
61 AliRecoServerThread(const AliRecoServerThread&); // Not implemented
62 AliRecoServerThread& operator=(const AliRecoServerThread&); // Not implemented
63
64public:
65
66 ClassDef(AliRecoServerThread, 0);
67};
68#endif /* __AliReconstructionThread_H__ */
69