DABC (Data Acquisition Backbone Core)  2.9.9
DabcProcMgr.h
Go to the documentation of this file.
1 // $Id: DabcProcMgr.h 4772 2021-05-04 08:27:16Z linev $
2 
3 /************************************************************
4  * The Data Acquisition Backbone Core (DABC) *
5  ************************************************************
6  * Copyright (C) 2009 - *
7  * GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
8  * Planckstr. 1, 64291 Darmstadt, Germany *
9  * Contact: http://dabc.gsi.de *
10  ************************************************************
11  * This software can be used under the GPL license *
12  * agreements as stated in LICENSE.txt file *
13  * which is part of the distribution. *
14  ************************************************************/
15 
16 #ifndef STREAM_DabcProcMgr
17 #define STREAM_DabcProcMgr
18 
19 #include "base/ProcMgr.h"
20 
21 #include "dabc/Hierarchy.h"
22 #include "dabc/Command.h"
23 #include "dabc/Worker.h"
24 
25 namespace stream {
26 
27  class DabcProcMgr : public base::ProcMgr {
28  protected:
29 
32 
34  std::string fStoreInfo;
35  bool fSortOrder;
37 
38  bool ClearHistogram(dabc::Hierarchy& item);
39 
40  dabc::Hierarchy FindHistogram(void *handle);
41 
43  bool SaveAllHistograms(dabc::Hierarchy &folder);
44 
45  public:
46  DabcProcMgr();
47  virtual ~DabcProcMgr();
48 
49  void SetTop(dabc::Hierarchy& top, bool withcmds = false);
50 
51  void SetDefaultFill(int fillcol = 3) { fDefaultFill = fillcol; }
52 
53  bool IsWorking() const { return fWorkingFlag; }
54 
55  // redefine only make procedure, fill and clear should work
56  base::H1handle MakeH1(const char* name, const char* title, int nbins, double left, double right, const char* xtitle = nullptr) override;
57 
58  base::H2handle MakeH2(const char* name, const char* title, int nbins1, double left1, double right1, int nbins2, double left2, double right2, const char* options = nullptr) override;
59 
60  void SetH1Title(base::H1handle h1, const char* title) override;
61  void TagH1Time(base::H1handle h1) override;
62 
63  void SetH2Title(base::H2handle h2, const char* title) override;
64  void TagH2Time(base::H2handle h2) override;
65 
66  void ClearAllHistograms() override;
67 
68  void SetSortedOrder(bool on = true) override { fSortOrder = on; }
69  bool IsSortedOrder() override { return fSortOrder; }
70 
71  void AddRunLog(const char *msg) override;
72  void AddErrLog(const char *msg) override;
73  bool DoLog() override { return true; }
74  void PrintLog(const char *msg) override;
75 
76  bool CallFunc(const char* funcname, void* arg) override;
77 
78  bool CreateStore(const char* storename) override;
79  bool CloseStore() override;
80 
81  bool CreateBranch(const char* name, const char* class_name, void** obj) override;
82  bool CreateBranch(const char* name, void* member, const char* kind) override;
83 
84  bool StoreEvent() override;
85 
87 
89 
90  std::string GetStoreInfo() const { return fStoreInfo; }
91  };
92 
93 }
94 
95 #endif
Represents command with its arguments.
Definition: Command.h:99
Represents objects hierarchy of remote (or local) DABC process.
Definition: Hierarchy.h:285
void AddErrLog(const char *msg) override
Definition: DabcProcMgr.cxx:95
void SetH2Title(base::H2handle h2, const char *title) override
void SetTop(dabc::Hierarchy &top, bool withcmds=false)
Definition: DabcProcMgr.cxx:43
void AddRunLog(const char *msg) override
Definition: DabcProcMgr.cxx:88
std::string fStoreInfo
! last info about storage
Definition: DabcProcMgr.h:34
bool ExecuteHCommand(dabc::Command cmd)
bool DoLog() override
Definition: DabcProcMgr.h:73
virtual ~DabcProcMgr()
Definition: DabcProcMgr.cxx:39
base::H2handle MakeH2(const char *name, const char *title, int nbins1, double left1, double right1, int nbins2, double left2, double right2, const char *options=nullptr) override
void SetH1Title(base::H1handle h1, const char *title) override
base::H1handle MakeH1(const char *name, const char *title, int nbins, double left, double right, const char *xtitle=nullptr) override
void ClearAllHistograms() override
std::string GetStoreInfo() const
Definition: DabcProcMgr.h:90
void SetDefaultFill(int fillcol=3)
Definition: DabcProcMgr.h:51
bool CloseStore() override
bool CallFunc(const char *funcname, void *arg) override
void PrintLog(const char *msg) override
bool fSortOrder
! sorting order
Definition: DabcProcMgr.h:35
bool IsWorking() const
Definition: DabcProcMgr.h:53
bool IsSortedOrder() override
Definition: DabcProcMgr.h:69
int fDefaultFill
! default fill color
Definition: DabcProcMgr.h:36
bool SaveAllHistograms()
Definition: DabcProcMgr.h:88
bool CreateBranch(const char *name, const char *class_name, void **obj) override
bool StoreEvent() override
bool CreateStore(const char *storename) override
dabc::Hierarchy fTop
Definition: DabcProcMgr.h:30
bool ClearAllDabcHistograms(dabc::Hierarchy &folder)
dabc::LocalWorkerRef fStore
Definition: DabcProcMgr.h:33
dabc::Hierarchy FindHistogram(void *handle)
void TagH2Time(base::H2handle h2) override
bool ClearHistogram(dabc::Hierarchy &item)
void TagH1Time(base::H1handle h1) override
void SetSortedOrder(bool on=true) override
Definition: DabcProcMgr.h:68
Support for stream framework in DABC
Definition: DabcProcMgr.h:25