AdcChannelStringTool.h
Go to the documentation of this file.
1 // AdcChannelStringTool.h
2 
3 // David Adams
4 // April 2018
5 //
6 // Interface for a tool that builds a string from AdcChannelData,
7 // a DataMap and a string pattern.
8 
9 #ifndef AdcChannelStringTool_H
10 #define AdcChannelStringTool_H
11 
14 
16 
17 public:
18 
19  using Index = unsigned int;
20 
21  // Helper function that calls tool from a pointer and returns the
22  // input string if that pointer is null.
23  static std::string
25  const AdcChannelData& acd, const DataMap& dm, std::string spat) {
26  return ptool == nullptr ? spat : ptool->build(acd, dm, spat);
27  }
28 
29  // Same without data map.
30  static std::string
32  const AdcChannelData& acd, std::string spat) {
33  return ptool == nullptr ? spat : ptool->build(acd, DataMap(), spat);
34  }
35 
36  virtual ~AdcChannelStringTool() =default;
37 
38  virtual std::string
39  build(const AdcChannelData& acd, const DataMap& dm, std::string spat) const =0;
40 
41 };
42 
43 #endif
std::string string
Definition: nybbler.cc:12
virtual ~AdcChannelStringTool()=default
static std::string build(const AdcChannelStringTool *ptool, const AdcChannelData &acd, const DataMap &dm, std::string spat)
static std::string build(const AdcChannelStringTool *ptool, const AdcChannelData &acd, std::string spat)