DABC (Data Acquisition Backbone Core)  2.9.9
Configuration.h
Go to the documentation of this file.
1 // $Id: Configuration.h 4468 2020-04-15 12:47:38Z 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 DABC_Configuration
17 #define DABC_Configuration
18 
19 #ifndef DABC_ConfigBase
20 #include "dabc/ConfigBase.h"
21 #endif
22 
23 namespace dabc {
24 
25  class Object;
26  class ConfigIO;
27 
34  class Configuration : public ConfigBase {
35  friend class ConfigIO;
36 
37  protected:
38  XMLNodePointer_t fSelected; // selected context node
39 
40  std::string fMgrHost;
41  int fMgrPort;
42  std::string fMgrName;
45 
46  static std::string fLocalHost;
47 
48  public:
49  Configuration(const char* fname = 0);
50  virtual ~Configuration();
51 
52  bool SelectContext(unsigned nodeid, unsigned numnodes);
53 
54  std::string MgrHost() const { return fMgrHost; }
55  int MgrPort() const { return fMgrPort; }
56  const char* MgrName() const { return fMgrName.c_str(); }
57  int MgrNodeId() const { return fMgrNodeId; }
58  int MgrNumNodes() const { return fMgrNumNodes; }
59 
60  std::string InitFuncName();
61  std::string RunFuncName();
62  int ShowCpuInfo();
63  bool UseSlowTime();
64 
69  int UseControl();
70 
74  std::string MasterName();
75 
77  double GetRunTime();
78 
80  double GetHaltTime();
81 
83  double GetThrdStopTime();
84 
85  bool NormalMainThread();
86  std::string ThreadsLayout();
87 
89  std::string Affinity();
90 
95  int WithPublisher();
96 
99  bool NextCreationNode(XMLNodePointer_t& prev, const char* nodename, bool check_name_for_multicast);
100 
101  std::string GetUserPar(const char* name, const char* dflt = 0);
102  int GetUserParInt(const char* name, int dflt = 0);
103 
104  std::string ConetextAppClass();
105 
106  bool LoadLibs();
107 
108  static std::string GetLocalHost() { return fLocalHost; }
109 
110  };
111 
112 }
113 
114 #endif
Base class to read configuration from xml file.
Definition: ConfigBase.h:104
Interface class between xml configuration and dabc objects.
Definition: ConfigIO.h:38
Full-functional class to reading configuration from xml files.
Definition: Configuration.h:34
double GetHaltTime()
Returns time, required to halt DABC process.
int MgrNodeId() const
Definition: Configuration.h:57
XMLNodePointer_t fSelected
Definition: Configuration.h:38
double GetThrdStopTime()
Returns time, required for normal thread stopping.
static std::string fLocalHost
Definition: Configuration.h:46
std::string ThreadsLayout()
int GetUserParInt(const char *name, int dflt=0)
std::string MgrHost() const
Definition: Configuration.h:54
bool NextCreationNode(XMLNodePointer_t &prev, const char *nodename, bool check_name_for_multicast)
Method is used to find xml nodes like Module, MemoryPool, Connection in the xml file which should be ...
bool SelectContext(unsigned nodeid, unsigned numnodes)
std::string InitFuncName()
const char * MgrName() const
Definition: Configuration.h:56
int UseControl()
Defines if control used in dabc node.
std::string fMgrName
Definition: Configuration.h:42
std::string RunFuncName()
std::string MasterName()
Defines master DABC process, to which application will be connected Master means all control and moni...
std::string Affinity()
Return default affinity of any newly created thread.
std::string GetUserPar(const char *name, const char *dflt=0)
static std::string GetLocalHost()
int MgrNumNodes() const
Definition: Configuration.h:58
int WithPublisher()
Returns true when publisher should be created.
Configuration(const char *fname=0)
double GetRunTime()
Returns configured time to run DABC process.
std::string ConetextAppClass()
std::string fMgrHost
Definition: Configuration.h:40
int MgrPort() const
Definition: Configuration.h:55
Event manipulation API.
Definition: api.h:23
void * XMLNodePointer_t
Definition: XmlEngine.h:25