otsdaq  v2_04_01
SlowControlsVInterface.h
1 #ifndef _ots_SlowControlsVInterface_h_
2 #define _ots_SlowControlsVInterface_h_
3 #include "otsdaq-core/Configurable/Configurable.h"
4 
5 #include <array>
6 #include <string>
7 namespace ots
8 {
10 {
11  public:
12  SlowControlsVInterface(const std::string& interfaceUID,
13  const ConfigurationTree& theXDAQContextConfigTree,
14  const std::string& configurationPath)
15  : Configurable(theXDAQContextConfigTree, configurationPath)
16  , interfaceUID_(interfaceUID)
17  , interfaceType_(Configurable::getSelfNode()
18  .getNode("ControlsInterfacePluginType")
19  .getValue<std::string>())
20  , mfSubject_("controls-" + interfaceType_ + "-" + interfaceUID_)
21  {
22  // inheriting children classes should use __GEN_COUT_*
23  // for decorations using mfSubject.
24  __GEN_COUT__ << __E__;
25  __GEN_COUTV__(interfaceUID_);
26  __GEN_COUTV__(mfSubject_);
27  }
28 
29  virtual ~SlowControlsVInterface(void) {}
30 
31  virtual void initialize() = 0;
32 
33  virtual void subscribe(std::string Name) = 0;
34  virtual void subscribeJSON(std::string List) = 0;
35  virtual void unsubscribe(std::string Name) = 0;
36  virtual std::string getList(std::string format) = 0;
37  virtual std::array<std::string, 4> getCurrentValue(std::string Name) = 0;
38  virtual std::array<std::string, 9> getSettings(std::string Name) = 0;
39 
40  protected:
41  const std::string interfaceUID_;
42  const std::string interfaceType_;
43  const std::string mfSubject_;
44 };
45 
46 } // namespace ots
47 #endif