Line data Source code
1 : #ifndef artdaq_Application_MPI2_DataLoggerApp_hh
2 : #define artdaq_Application_MPI2_DataLoggerApp_hh
3 :
4 : #include "artdaq/Application/Commandable.hh"
5 : #include "artdaq/Application/DataLoggerCore.hh"
6 :
7 : #include <memory>
8 :
9 : namespace artdaq {
10 : class DataLoggerApp;
11 : }
12 :
13 : /**
14 : * \brief DataLoggerApp is an artdaq::Commandable derived class which controls the DataLoggerCore
15 : */
16 : class artdaq::DataLoggerApp : public artdaq::Commandable
17 : {
18 : public:
19 : /**
20 : * \brief DataLoggerApp Constructor
21 : */
22 : DataLoggerApp();
23 :
24 : /**
25 : * \brief Copy Constructor is Deleted
26 : */
27 : DataLoggerApp(DataLoggerApp const&) = delete;
28 :
29 : /**
30 : * \brief Default virtual destructor
31 : */
32 0 : virtual ~DataLoggerApp() = default;
33 :
34 : /**
35 : * \brief Copy Assignment operator is Deleted
36 : * \return DataLoggerApp copy
37 : */
38 : DataLoggerApp& operator=(DataLoggerApp const&) = delete;
39 : DataLoggerApp(DataLoggerApp&&) = delete; ///< Move Constructor is deleted
40 : DataLoggerApp& operator=(DataLoggerApp&&) = delete; ///< Move Assignment Operator is deleted
41 :
42 : // these methods provide the operations that are used by the state machine
43 : /**
44 : * \brief Initialize the DataLoggerCore
45 : * \param pset ParameterSet used to initialize the DataLoggerCore
46 : * \return Whether the initialize transition succeeded
47 : */
48 : bool do_initialize(fhicl::ParameterSet const& pset, uint64_t, uint64_t) override;
49 :
50 : /**
51 : * \brief Start the DataLoggerCore
52 : * \param id Run number of the new run
53 : * \return Whether the start transition succeeded
54 : */
55 : bool do_start(art::RunID id, uint64_t, uint64_t) override;
56 :
57 : /**
58 : * \brief Stop the DataLoggerCore
59 : * \return Whether the stop transition succeeded
60 : */
61 : bool do_stop(uint64_t, uint64_t) override;
62 :
63 : /**
64 : * \brief Pause the DataLoggerCore
65 : * \return Whether the pause transition succeeded
66 : */
67 : bool do_pause(uint64_t, uint64_t) override;
68 :
69 : /**
70 : * \brief Resume the DataLoggerCore
71 : * \return Whether the resume transition succeeded
72 : */
73 : bool do_resume(uint64_t, uint64_t) override;
74 :
75 : /**
76 : * \brief Shutdown the DataLoggerCore
77 : * \return Whether the shutdown transition succeeded
78 : */
79 : bool do_shutdown(uint64_t) override;
80 :
81 : /**
82 : * \brief Soft-initialize the DataLoggerCore. No-Op
83 : * \return This function always returns true
84 : */
85 : bool do_soft_initialize(fhicl::ParameterSet const&, uint64_t, uint64_t) override;
86 :
87 : /**
88 : * \brief Reinitialize the DataLoggerCore. No-Op
89 : * \return This function always returns true
90 : */
91 : bool do_reinitialize(fhicl::ParameterSet const&, uint64_t, uint64_t) override;
92 :
93 : /**
94 : * \brief If which is "transition_status", report the status of the last transition. Otherwise pass through to DataLoggerCore
95 : * \param which What to report on
96 : * \return Report string. Empty for unknown "which" parameter
97 : */
98 : std::string report(std::string const& which) const override;
99 :
100 : /**
101 : * \brief Add the specified configuration archive entry to the DataLoggerCore
102 : * \return Whether the command succeeded
103 : */
104 : bool do_add_config_archive_entry(std::string const&, std::string const&) override;
105 :
106 : /**
107 : * \brief Clear the configuration archive list in the DataLoggerCore
108 : * \return Whether the command succeeded
109 : */
110 : bool do_clear_config_archive() override;
111 :
112 : private:
113 : std::unique_ptr<DataLoggerCore> DataLogger_ptr_;
114 : };
115 :
116 : #endif
|