1818#ifndef QC_CORE_TASKRUNNER_H
1919#define QC_CORE_TASKRUNNER_H
2020
21- #include < boost/property_tree/ptree.hpp>
22-
2321// O2
2422#include < Common/Timer.h>
2523#include < Framework/Task.h>
3028#include < Headers/DataHeader.h>
3129#include < Framework/InitContext.h>
3230// QC
33- #include " QualityControl/TaskConfig .h"
31+ #include " QualityControl/TaskRunnerConfig .h"
3432#include " QualityControl/TaskInterface.h"
3533
3634namespace o2 ::configuration
@@ -75,7 +73,7 @@ class TaskRunner : public framework::Task
7573 // / \param taskName - name of the task, which exists in tasks list in the configuration file
7674 // / \param configurationSource - absolute path to configuration file, preceded with backend (f.e. "json://")
7775 // / \param id - subSpecification for taskRunner's OutputSpec, useful to avoid outputs collisions one more complex topologies
78- TaskRunner (const std::string& taskName, const std::string& configurationSource, size_t id = 0 );
76+ TaskRunner (const TaskRunnerConfig& config );
7977 ~TaskRunner () override = default ;
8078
8179 // / \brief TaskRunner's init callback
@@ -86,13 +84,10 @@ class TaskRunner : public framework::Task
8684 // / \brief TaskRunner's completion policy callback
8785 static framework::CompletionPolicy::CompletionOp completionPolicyCallback (o2::framework::InputSpan const & inputs);
8886
89- std::string getDeviceName () { return mDeviceName ; };
90- const framework::Inputs& getInputsSpecs () { return mInputSpecs ; };
91- const framework::OutputSpec getOutputSpec () { return mMonitorObjectsSpec ; };
92- const framework::Options getOptions () { return mOptions ; };
93-
94- // / \brief Makes TaskRunner invoke TaskInterface::reset() each n cycles. n = 0 means never.
95- void setResetAfterCycles (size_t n = 0 );
87+ std::string getDeviceName () const { return mTaskConfig .deviceName ; };
88+ const framework::Inputs& getInputsSpecs () const { return mTaskConfig .inputSpecs ; };
89+ const framework::OutputSpec& getOutputSpec () const { return mTaskConfig .moSpec ; };
90+ const framework::Options& getOptions () const { return mTaskConfig .options ; };
9691
9792 // / \brief ID string for all TaskRunner devices
9893 static std::string createTaskRunnerIdString ();
@@ -114,7 +109,6 @@ class TaskRunner : public framework::Task
114109
115110 std::tuple<bool /* data ready*/ , bool /* timer ready*/ > validateInputs (const framework::InputRecord&);
116111 void loadTaskConfig ();
117- void loadTopologyConfig ();
118112 void startOfActivity ();
119113 void endOfActivity ();
120114 void startCycle ();
@@ -124,24 +118,13 @@ class TaskRunner : public framework::Task
124118 void saveToFile ();
125119
126120 private:
127- std::string mDeviceName ;
128- TaskConfig mTaskConfig ;
129- std::shared_ptr<configuration::ConfigurationInterface> mConfigFile ; // used in init only
121+ TaskRunnerConfig mTaskConfig ;
130122 std::shared_ptr<monitoring::Monitoring> mCollector ;
131123 std::shared_ptr<TaskInterface> mTask ;
132- size_t mResetAfterCycles = 0 ;
133124 std::shared_ptr<ObjectsManager> mObjectsManager ;
134125 int mRunNumber ;
135126
136- std::string validateDetectorName (std::string name) const ;
137- boost::property_tree::ptree getTaskConfigTree () const ;
138127 void updateMonitoringStats (framework::ProcessingContext& pCtx);
139- void computeRunNumber (const framework::ServiceRegistry& services);
140-
141- // consider moving these to TaskConfig
142- framework::Inputs mInputSpecs ;
143- framework::OutputSpec mMonitorObjectsSpec ;
144- framework::Options mOptions ;
145128
146129 bool mCycleOn = false ;
147130 bool mNoMoreCycles = false ;
0 commit comments