Bayeux  3.4.1
Core Foundation library for SuperNEMO
ocd_driver.h
Go to the documentation of this file.
1 
3 #ifndef DATATOOLS_OCD_DRIVER_H
4 #define DATATOOLS_OCD_DRIVER_H
5 
6 // Standard Library:
7 #include <string>
8 #include <vector>
9 #include <iostream>
10 
11 // Third Party:
12 #include <boost/scoped_ptr.hpp>
13 
14 // This project:
15 #include <datatools/logger.h>
16 
17 namespace datatools {
18 
19  class properties;
20  class library_loader;
21 
24  {
25  public:
28 
30  void reset();
31 
33  void print(std::ostream & = std::cout) const;
34 
35  public:
36 
38  bool interactive;
39  std::vector<std::string> dlls;
40  std::string dll_loader_config;
41  std::string action;
42  std::string class_id;
43  std::vector<std::string> action_options;
44  std::string input_path;
45  std::string output_path;
46 
47  };
48 
49 
51  class ocd_driver
52  {
53  public:
54 
56  ocd_driver();
57 
59  virtual ~ocd_driver();
60 
62  bool is_initialized() const;
63 
65  /* future: consider to use a 'datatools::properties' object */
66  void initialize(const ocd_driver_params & params_);
67 
69  int run();
70 
72  void reset();
73 
74  protected:
75 
77  void _run_interactive();
78 
80  int _run_action();
81 
83  int _run_list(std::ostream & out_ = std::cout, std::ostream & log_ = std::clog);
84 
86  int _run_show(const std::string & class_id_, std::ostream & out_ = std::cout);
87 
89  int _run_generate_skeleton(const std::string & class_id_,
90  const std::string & path_ = "");
91 
93  int _run_validate(const std::string & class_id_,
94  const std::string & path_);
95  private:
96 
97  bool _initialized_;
98  ocd_driver_params _params_;
99  boost::scoped_ptr<library_loader> _dll_loader_;
100 
101  };
102 
103 } // end of namespace datatools
104 
105 #endif // DATATOOLS_OCD_DRIVER_H
106 
107 // Local Variables: --
108 // mode: c++ --
109 // c-file-style: "gnu" --
110 // tab-width: 2 --
111 // End: --
priority
Priority levels for logging from most to least critical.
Definition: logger.h:82
int _run_action()
Run the requested action.
std::string class_id
The class registration ID.
Definition: ocd_driver.h:42
bool interactive
Interactive flag.
Definition: ocd_driver.h:38
std::string output_path
Output path.
Definition: ocd_driver.h:45
virtual ~ocd_driver()
Destructor.
datatools::logger::priority logging
Logging priority.
Definition: ocd_driver.h:37
std::vector< std::string > dlls
List of DLLs to be loaded.
Definition: ocd_driver.h:39
int _run_validate(const std::string &class_id_, const std::string &path_)
Run the 'validate' action.
void print(std::ostream &=std::cout) const
Smart print.
The OCD manual application.
Definition: ocd_driver.h:51
void initialize(const ocd_driver_params &params_)
Initialization.
int _run_list(std::ostream &out_=std::cout, std::ostream &log_=std::clog)
Run the 'list' action.
Parameters of the OCD manual object.
Definition: ocd_driver.h:23
std::string dll_loader_config
Configuration file of the DLL loader.
Definition: ocd_driver.h:40
ocd_driver()
Constructor.
The Bayeux/datatools library top-level namespace.
Definition: algo.h:13
Utilities for logging information.
void _run_interactive()
Interactive session.
std::vector< std::string > action_options
The options associated to the action.
Definition: ocd_driver.h:43
bool is_initialized() const
Check initialization status.
int _run_show(const std::string &class_id_, std::ostream &out_=std::cout)
Run the 'show' action.
int _run_generate_skeleton(const std::string &class_id_, const std::string &path_="")
Run the 'generate skeleton' action.
std::string action
The name of the action to invoke.
Definition: ocd_driver.h:41
std::string input_path
Input path.
Definition: ocd_driver.h:44