Skip to content

Commit 7de84fe

Browse files
authored
[Common] Enclose TableHelper in o2::common namespace (#11808)
1 parent dfb6b1a commit 7de84fe

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

Common/Core/TableHelper.cxx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@
1717

1818
#include "Common/Core/TableHelper.h"
1919

20-
#include <string>
21-
2220
#include "Framework/InitContext.h"
2321
#include "Framework/RunningWorkflowInfo.h"
2422

23+
#include <string>
24+
2525
/// Function to print the table required in the full workflow
2626
/// @param initContext initContext of the init function
27-
void printTablesInWorkflow(o2::framework::InitContext& initContext)
27+
void o2::common::core::printTablesInWorkflow(o2::framework::InitContext& initContext)
2828
{
2929
auto& workflows = initContext.services().get<o2::framework::RunningWorkflowInfo const>();
3030
for (auto const& device : workflows.devices) {
@@ -37,7 +37,7 @@ void printTablesInWorkflow(o2::framework::InitContext& initContext)
3737
/// Function to check if a table is required in a workflow
3838
/// @param initContext initContext of the init function
3939
/// @param table name of the table to check for
40-
bool isTableRequiredInWorkflow(o2::framework::InitContext& initContext, const std::string& table)
40+
bool o2::common::core::isTableRequiredInWorkflow(o2::framework::InitContext& initContext, const std::string& table)
4141
{
4242
LOG(debug) << "Checking if table " << table << " is needed";
4343
bool tableNeeded = false;
@@ -57,7 +57,7 @@ bool isTableRequiredInWorkflow(o2::framework::InitContext& initContext, const st
5757
/// @param initContext initContext of the init function
5858
/// @param table name of the table to check for
5959
/// @param flag bool value of flag to set, if the given value is true it will be kept, disregarding the table usage in the workflow.
60-
void enableFlagIfTableRequired(o2::framework::InitContext& initContext, const std::string& table, bool& flag)
60+
void o2::common::core::enableFlagIfTableRequired(o2::framework::InitContext& initContext, const std::string& table, bool& flag)
6161
{
6262
if (flag) {
6363
LOG(info) << "Table enabled: " + table;
@@ -75,7 +75,7 @@ void enableFlagIfTableRequired(o2::framework::InitContext& initContext, const st
7575
/// @param initContext initContext of the init function
7676
/// @param table name of the table to check for
7777
/// @param flag int value of flag to set, only if initially set to -1. Initial values of 0 or 1 will be kept disregarding the table usage in the workflow.
78-
void enableFlagIfTableRequired(o2::framework::InitContext& initContext, const std::string& table, int& flag)
78+
void o2::common::core::enableFlagIfTableRequired(o2::framework::InitContext& initContext, const std::string& table, int& flag)
7979
{
8080
if (flag > 0) {
8181
flag = 1;

Common/Core/TableHelper.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424

2525
#include <string>
2626

27+
namespace o2::common::core
28+
{
29+
2730
/// Function to print the table required in the full workflow
2831
/// @param initContext initContext of the init function
2932
void printTablesInWorkflow(o2::framework::InitContext& initContext);
@@ -109,4 +112,11 @@ bool getTaskOptionValue(o2::framework::InitContext& initContext, const std::stri
109112
return getTaskOptionValue(initContext, taskName, configurable.name, configurable.value, verbose);
110113
}
111114

115+
} // namespace o2::common::core
116+
117+
using o2::common::core::enableFlagIfTableRequired;
118+
using o2::common::core::getTaskOptionValue;
119+
using o2::common::core::isTableRequiredInWorkflow;
120+
using o2::common::core::printTablesInWorkflow;
121+
112122
#endif // COMMON_CORE_TABLEHELPER_H_

0 commit comments

Comments
 (0)