Skip to content

Commit 254173a

Browse files
authored
[Common] Table helper: inherit directly configurables (#11065)
1 parent 5ef29ad commit 254173a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Common/Core/TableHelper.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
#include <string>
2222

23+
#include "Framework/Configurable.h"
2324
#include "Framework/InitContext.h"
2425
#include "Framework/RunningWorkflowInfo.h"
2526

@@ -95,4 +96,15 @@ bool getTaskOptionValue(o2::framework::InitContext& initContext, const std::stri
9596
return false;
9697
}
9798

99+
/// Function to check for a specific configurable from another task in the current workflow and fetch its value. Useful for tasks that need to know the value of a configurable in another task.
100+
/// @param initContext initContext of the init function
101+
/// @param taskName name of the task to check for
102+
/// @param value Task configurable to inherit from (name and values are used)
103+
/// @param verbose if true, print debug messages
104+
template <typename ValueType>
105+
bool getTaskOptionValue(o2::framework::InitContext& initContext, const std::string& taskName, ValueType& configurable, const bool verbose = true)
106+
{
107+
return getTaskOptionValue(initContext, taskName, configurable.name, configurable.value, verbose);
108+
}
109+
98110
#endif // COMMON_CORE_TABLEHELPER_H_

0 commit comments

Comments
 (0)