Skip to content

Commit

Permalink
Changing class and function names to follow the convention
Browse files Browse the repository at this point in the history
  • Loading branch information
knopers8 authored and Barthelemy committed Oct 30, 2018
1 parent 039d0f4 commit 2794f18
Show file tree
Hide file tree
Showing 13 changed files with 48 additions and 49 deletions.
8 changes: 4 additions & 4 deletions Framework/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ set(
src/Quality.cxx
src/ObjectsManager.cxx
src/Checker.cxx
src/CheckerDataProcessorFactory.cxx
src/CheckerFactory.cxx
src/CheckInterface.cxx
src/DatabaseFactory.cxx
src/CcdbDatabase.cxx
src/InformationService.cxx
src/InformationServiceDump.cxx
src/TaskRunner.cxx
src/TaskDataProcessorFactory.cxx
src/TaskRunnerFactory.cxx
src/TaskInterface.cxx
src/RepositoryBenchmark.cxx
src/HistoMerger.cxx
Expand All @@ -25,11 +25,11 @@ set(
include/QualityControl/Quality.h
include/QualityControl/CheckInterface.h
include/QualityControl/Checker.h
include/QualityControl/CheckerDataProcessorFactory.h
include/QualityControl/CheckerFactory.h
include/QualityControl/DatabaseInterface.h
include/QualityControl/CcdbDatabase.h
include/QualityControl/TaskRunner.h
include/QualityControl/TaskDataProcessorFactory.h
include/QualityControl/TaskRunnerFactory.h
include/QualityControl/HistoMerger.h
)

Expand Down
2 changes: 1 addition & 1 deletion Framework/include/QualityControl/Checker.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class Checker : public framework::Task
framework::OutputSpec getOutputSpec() { return mOutputSpec; };

/// \brief Unified DataDescription naming scheme for all checkers
static o2::header::DataDescription checkerDataDescription(const std::string taskName);
static o2::header::DataDescription createCheckerDataDescription(const std::string taskName);

private:
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
///
/// \file CheckerDataProcessorFactory.h
/// \file CheckerFactory.h
/// \author Piotr Konopka
///
#ifndef QC_CHECKER_DATAPROCESSORFACTORY_H
#define QC_CHECKER_DATAPROCESSORFACTORY_H
#ifndef QC_CHECKERFACTORY_H
#define QC_CHECKERFACTORY_H

#include "Framework/DataProcessorSpec.h"

Expand All @@ -15,11 +15,11 @@ namespace checker
{

/// \brief Factory in charge of creating DataProcessorSpec of QC Checker
class CheckerDataProcessorFactory
class CheckerFactory
{
public:
CheckerDataProcessorFactory() = default;
virtual ~CheckerDataProcessorFactory() = default;
CheckerFactory() = default;
virtual ~CheckerFactory() = default;

framework::DataProcessorSpec create(std::string checkerName, std::string taskName, std::string configurationSource);
};
Expand All @@ -28,4 +28,4 @@ class CheckerDataProcessorFactory
} // namespace quality_control
} // namespace o2

#endif // QC_CHECKER_DATAPROCESSORFACTORY_H
#endif // QC_CHECKERFACTORY_H
2 changes: 1 addition & 1 deletion Framework/include/QualityControl/TaskRunner.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class TaskRunner
void setResetAfterPublish(bool);

/// \brief Unified DataDescription naming scheme for all tasks
static o2::header::DataDescription taskDataDescription(const std::string taskName);
static o2::header::DataDescription createTaskDataDescription(const std::string taskName);

private:
void populateConfig(std::string taskName);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
///
/// \file TaskDataProcessorFactory.h
/// \file TaskRunnerFactory.h
/// \author Piotr Konopka
///

#ifndef QC_CORE_TASKDATAPROCESSORFACTORY_H
#define QC_CORE_TASKDATAPROCESSORFACTORY_H
#ifndef QC_CORE_TASKFACTORY_H
#define QC_CORE_TASKFACTORY_H

#include "Framework/DataProcessorSpec.h"

Expand All @@ -16,11 +16,11 @@ namespace core
{

/// \brief Factory in charge of creating DataProcessorSpec of QC task
class TaskDataProcessorFactory
class TaskRunnerFactory
{
public:
TaskDataProcessorFactory();
virtual ~TaskDataProcessorFactory();
TaskRunnerFactory();
virtual ~TaskRunnerFactory();

o2::framework::DataProcessorSpec create(std::string taskName, std::string configurationSource);
};
Expand All @@ -29,4 +29,4 @@ class TaskDataProcessorFactory
} // namespace quality_control
} // namespace o2

#endif // QC_CORE_TASKDATAPROCESSORFACTORY_H
#endif // QC_CORE_TASKFACTORY_H
8 changes: 4 additions & 4 deletions Framework/src/Checker.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ namespace checker
{

// TODO do we need a CheckFactory ? here it is embedded in the Checker
// TODO maybe we could use the CheckerDataProcessorFactory
// TODO maybe we could use the CheckerFactory

Checker::Checker(std::string checkerName, std::string taskName, std::string configurationSource)
: mCheckerName(checkerName),
mConfigurationSource(configurationSource),
mInputSpec{ "mo", "QC", TaskRunner::taskDataDescription(taskName), 0 },
mOutputSpec{ "QC", Checker::checkerDataDescription(taskName), 0 },
mInputSpec{ "mo", "QC", TaskRunner::createTaskDataDescription(taskName), 0 },
mOutputSpec{ "QC", Checker::createCheckerDataDescription(taskName), 0 },
mLogger(QcInfoLogger::GetInstance()),
startFirstObject{ system_clock::time_point::min() },
endLastObject{ system_clock::time_point::min() },
Expand Down Expand Up @@ -126,7 +126,7 @@ void Checker::run(framework::ProcessingContext& ctx)
}
}

o2::header::DataDescription Checker::checkerDataDescription(const std::string taskName)
o2::header::DataDescription Checker::createCheckerDataDescription(const std::string taskName)
{
o2::header::DataDescription description;
description.runtimeInit(std::string(taskName.substr(0, o2::header::DataDescription::size - 4) + "-chk").c_str());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
///
/// \file CheckerDataProcessorFactory.cxx
/// \file CheckerFactory.cxx
/// \author Piotr Konopka
///

#include <Framework/DataProcessorSpec.h>

#include "QualityControl/Checker.h"
#include "QualityControl/CheckerDataProcessorFactory.h"
#include "QualityControl/CheckerFactory.h"

namespace o2
{
Expand All @@ -18,8 +18,7 @@ namespace checker
using namespace o2::framework;
using namespace o2::quality_control::checker;

DataProcessorSpec CheckerDataProcessorFactory::create(std::string checkerName, std::string taskName,
std::string configurationSource)
DataProcessorSpec CheckerFactory::create(std::string checkerName, std::string taskName, std::string configurationSource)
{
Checker qcChecker{ checkerName, taskName, configurationSource };

Expand Down
4 changes: 2 additions & 2 deletions Framework/src/TaskRunner.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ void TaskRunner::timerCallback(ProcessingContext& pCtx) { finishCycle(pCtx.outpu

void TaskRunner::setResetAfterPublish(bool resetAfterPublish) { mResetAfterPublish = resetAfterPublish; }

o2::header::DataDescription TaskRunner::taskDataDescription(const std::string taskName)
o2::header::DataDescription TaskRunner::createTaskDataDescription(const std::string taskName)
{
o2::header::DataDescription description;
description.runtimeInit(std::string(taskName.substr(0, o2::header::DataDescription::size - 3) + "-mo").c_str());
Expand All @@ -155,7 +155,7 @@ void TaskRunner::populateConfig(std::string taskName)
mInputSpecs = framework::DataSampling::InputSpecsForPolicy(mConfigFile.get(), taskConfigTree.get<std::string>("dataSamplingPolicy"));

mMonitorObjectsSpec.origin.runtimeInit("QC");
mMonitorObjectsSpec.description = taskDataDescription(taskName);
mMonitorObjectsSpec.description = createTaskDataDescription(taskName);
mMonitorObjectsSpec.subSpec = 0;
mMonitorObjectsSpec.lifetime = o2::framework::Lifetime::QA;
} catch (...) { // catch already here the configuration exception and print it
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
// or submit itself to any jurisdiction.

///
/// \file TaskDataProcessorFactory.cxx
/// \file TaskRunnerFactory.cxx
/// \author Piotr Konopka
///

#include "QualityControl/TaskDataProcessorFactory.h"
#include "QualityControl/TaskRunnerFactory.h"
#include "QualityControl/TaskRunner.h"

namespace o2
Expand All @@ -25,11 +25,11 @@ namespace core

using namespace o2::framework;

TaskDataProcessorFactory::TaskDataProcessorFactory() {}
TaskRunnerFactory::TaskRunnerFactory() {}

TaskDataProcessorFactory::~TaskDataProcessorFactory() {}
TaskRunnerFactory::~TaskRunnerFactory() {}

DataProcessorSpec TaskDataProcessorFactory::create(std::string taskName, std::string configurationSource)
DataProcessorSpec TaskRunnerFactory::create(std::string taskName, std::string configurationSource)
{
auto qcTask = std::make_shared<TaskRunner>(taskName, configurationSource);

Expand Down
10 changes: 5 additions & 5 deletions Framework/src/runBasic.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ void customize(std::vector<ChannelConfigurationPolicy>& policies)
#include "Framework/runDataProcessing.h"

#include "QualityControl/Checker.h"
#include "QualityControl/CheckerDataProcessorFactory.h"
#include "QualityControl/TaskDataProcessorFactory.h"
#include "QualityControl/CheckerFactory.h"
#include "QualityControl/TaskRunnerFactory.h"

using namespace o2::framework;
using namespace o2::quality_control::core;
Expand Down Expand Up @@ -90,18 +90,18 @@ WorkflowSpec defineDataProcessing(ConfigContext const&)
// Exemplary initialization of QC Task:
const std::string qcTaskName = "QcTask";
const std::string qcConfigurationSource = std::string("json://") + getenv("QUALITYCONTROL_ROOT") + "/etc/basic.json";
TaskDataProcessorFactory taskFactory;
TaskRunnerFactory taskFactory;
specs.push_back(taskFactory.create(qcTaskName, qcConfigurationSource));

// Now the QC Checker
CheckerDataProcessorFactory checkerFactory;
CheckerFactory checkerFactory;
specs.push_back(checkerFactory.create("checker_0", qcTaskName, qcConfigurationSource));

// Finally the printer
DataProcessorSpec printer{
"printer",
Inputs{
{ "checked-mo", "QC", Checker::checkerDataDescription(qcTaskName), 0 }
{ "checked-mo", "QC", Checker::createCheckerDataDescription(qcTaskName), 0 }
},
Outputs{},
AlgorithmSpec{
Expand Down
4 changes: 2 additions & 2 deletions Framework/src/runMergerTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ void customize(std::vector<CompletionPolicy>& policies)
#include "Framework/runDataProcessing.h"

#include "QualityControl/Checker.h"
#include "QualityControl/CheckerDataProcessorFactory.h"
#include "QualityControl/CheckerFactory.h"
#include "QualityControl/HistoMerger.h"
#include "QualityControl/TaskDataProcessorFactory.h"
#include "QualityControl/TaskRunnerFactory.h"

using namespace o2::quality_control::core;
using namespace o2::quality_control::checker;
Expand Down
10 changes: 5 additions & 5 deletions Framework/src/runReadout.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ void customize(std::vector<ChannelConfigurationPolicy>& policies)
#include "Framework/DataSamplingReadoutAdapter.h"
#include "Framework/runDataProcessing.h"
#include "QualityControl/Checker.h"
#include "QualityControl/CheckerDataProcessorFactory.h"
#include "QualityControl/TaskDataProcessorFactory.h"
#include "QualityControl/CheckerFactory.h"
#include "QualityControl/TaskRunnerFactory.h"
#include "QualityControl/TaskRunner.h"

using namespace o2::framework;
Expand All @@ -70,15 +70,15 @@ WorkflowSpec defineDataProcessing(ConfigContext const&)
const std::string qcTaskName = "daqTask";
const std::string qcConfigurationSource =
std::string("json:/") + getenv("QUALITYCONTROL_ROOT") + "/etc/readout.json";
TaskDataProcessorFactory qcFactory;
TaskRunnerFactory qcFactory;
specs.push_back(qcFactory.create(qcTaskName, qcConfigurationSource));
CheckerDataProcessorFactory checkerFactory;
CheckerFactory checkerFactory;
specs.push_back(checkerFactory.create("checker_0", qcTaskName, qcConfigurationSource));

DataProcessorSpec printer{
"printer",
Inputs{
{ "checked-mo", "QC", Checker::checkerDataDescription(qcTaskName), 0 }
{ "checked-mo", "QC", Checker::createCheckerDataDescription(qcTaskName), 0 }
},
Outputs{},
AlgorithmSpec{
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ accordingly.
```
...
#include "QualityControl/TaskDataProcessorFactory.h"
#include "QualityControl/TaskRunnerFactory.h"
#include "QualityControl/TaskRunner.h"
#include "Framework/DataSampling.h"
#include "Framework/runDataProcessing.h"
Expand All @@ -195,7 +195,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const&) {
const std::string qcConfigurationSource = std::string("file://") + getenv("QUALITYCONTROL_ROOT") + "/etc/qcTaskDplConfig.json";
// An entry in config file which describes your QC task
const std::string qcTaskName = "skeletonTask";
o2::quality_control::core::TaskDataProcessorFactory qcFactory;
o2::quality_control::core::TaskRunnerFactory qcFactory;
specs.push_back(qcFactory.create(qcTaskName, qcConfigurationSource));
o2::framework::DataSampling::GenerateInfrastructure(specs, qcConfigurationSource);
Expand Down

0 comments on commit 2794f18

Please sign in to comment.