CbmRoot
CbmHistoServer.h
Go to the documentation of this file.
1 /********************************************************************************
2  * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
3  * *
4  * This software is distributed under the terms of the *
5  * GNU Lesser General Public Licence (LGPL) version 3, *
6  * copied verbatim in the file "LICENSE" *
7  ********************************************************************************/
8 #ifndef FAIRMQEXHISTOSERVER
9 #define FAIRMQEXHISTOSERVER
10 
11 #include "FairMQDevice.h"
12 
13 #include "THttpServer.h"
14 #include "TObjArray.h"
15 
16 #include <memory>
17 #include <string>
18 #include <thread>
19 
20 //class FairMQExHistoCanvasDrawer;
21 
22 class CbmHistoServer : public FairMQDevice {
23 public:
25 
26 
27  virtual ~CbmHistoServer();
28 
29  void UpdateHttpServer();
30 
31  /*
32  void SetCanvasDrawer(std::unique_ptr<FairMQExHistoCanvasDrawer> canvasDrawer)
33  {
34  fCanvasDrawer = std::move(canvasDrawer);
35  }
36 */
37 
38 protected:
39  virtual void InitTask();
40 
41  bool ReceiveData(FairMQMessagePtr& msg, int index);
42 
43  virtual void PreRun();
44 
45  virtual void PostRun();
46 
47 private:
48  std::string fInputChannelName;
49 
50  TObjArray fArrayHisto;
51 
52  int fNMessages;
53 
54  THttpServer fServer;
55 
56  // std::unique_ptr<FairMQExHistoCanvasDrawer> fCanvasDrawer;
57 
58  std::thread fThread;
59  bool fStopThread;
60 
61  int FindHistogram(const std::string& name);
62 };
63 
64 #endif
CbmHistoServer::FindHistogram
int FindHistogram(const std::string &name)
Definition: CbmHistoServer.cxx:107
CbmHistoServer::PostRun
virtual void PostRun()
Definition: CbmHistoServer.cxx:102
CbmHistoServer::fArrayHisto
TObjArray fArrayHisto
Definition: CbmHistoServer.h:56
CbmHistoServer::fInputChannelName
std::string fInputChannelName
Definition: CbmHistoServer.h:54
CbmHistoServer::UpdateHttpServer
void UpdateHttpServer()
Definition: CbmHistoServer.cxx:86
CbmHistoServer::ReceiveData
bool ReceiveData(FairMQMessagePtr &msg, int index)
Definition: CbmHistoServer.cxx:44
CbmHistoServer::PreRun
virtual void PreRun()
Definition: CbmHistoServer.cxx:81
CbmHistoServer::fThread
std::thread fThread
Definition: CbmHistoServer.h:64
CbmHistoServer::fServer
THttpServer fServer
Definition: CbmHistoServer.h:60
CbmHistoServer::~CbmHistoServer
virtual ~CbmHistoServer()
Definition: CbmHistoServer.cxx:31
CbmHistoServer::fNMessages
int fNMessages
Definition: CbmHistoServer.h:58
CbmHistoServer
Definition: CbmHistoServer.h:22
CbmHistoServer::CbmHistoServer
CbmHistoServer()
Definition: CbmHistoServer.cxx:22
CbmHistoServer::fStopThread
bool fStopThread
Definition: CbmHistoServer.h:65
CbmHistoServer::InitTask
virtual void InitTask()
Definition: CbmHistoServer.cxx:33