AddNumber_tool.cc
Go to the documentation of this file.
4 #include "fhiclcpp/types/Atom.h"
5 
6 namespace {
7 
8  struct Config {
9  fhicl::Atom<int> incrementBy{fhicl::Name("incrementBy"), 1};
10  };
11 
12  class AddNumber : public arttest::OperationBase {
13  public:
14  using Parameters = art::ToolConfigTable<Config>;
15  explicit AddNumber(Parameters const& config)
16  : incrementBy_{config().incrementBy()}
17  {}
18 
19  private:
20  int incrementBy_;
21 
22  void
23  do_adjustNumber(int& i) const override
24  {
25  i += incrementBy_;
26  }
27  };
28 
29 } // namespace
30 
31 DEFINE_ART_CLASS_TOOL(AddNumber)
#define DEFINE_ART_CLASS_TOOL(tool)
Definition: ToolMacros.h:42
ChannelGroupService::Name Name
typename config_impl< T >::type Config
Definition: ModuleMacros.h:52
static Config * config
Definition: config.cpp:1054