OptionsHandler.h
Go to the documentation of this file.
1 #ifndef art_Framework_Art_OptionsHandler_h
2 #define art_Framework_Art_OptionsHandler_h
3 // Simple interface to allow easy addition of experiment-specific
4 // command-line options and their processing.
5 
6 #include "boost/program_options.hpp"
7 #include "fhiclcpp/fwd.h"
8 
9 namespace bpo = boost::program_options;
10 
11 namespace art {
12 
14  public:
15  virtual ~OptionsHandler() = default;
16 
17  int checkOptions(bpo::variables_map const& vm);
18  int processOptions(bpo::variables_map const& vm,
19  fhicl::intermediate_table& raw_config);
20 
21  private:
22  // Check selected options for consistency (should throw on failure).
23  virtual int doCheckOptions(bpo::variables_map const& vm) = 0;
24  // Act on selected options (should throw on failure).
25  virtual int doProcessOptions(bpo::variables_map const& vm,
26  fhicl::intermediate_table& raw_config) = 0;
27  };
28 
29 } // namespace art
30 
31 #endif /* art_Framework_Art_OptionsHandler_h */
32 
33 // Local Variables:
34 // mode: c++
35 // End:
virtual ~OptionsHandler()=default
int processOptions(bpo::variables_map const &vm, fhicl::intermediate_table &raw_config)
virtual int doCheckOptions(bpo::variables_map const &vm)=0
int checkOptions(bpo::variables_map const &vm)
virtual int doProcessOptions(bpo::variables_map const &vm, fhicl::intermediate_table &raw_config)=0