Skip to content

Commit 4257fb3

Browse files
authored
Inherit directly configurables
1 parent 8c821c2 commit 4257fb3

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, o2::framework::Configurable<ValueType>& value, const bool verbose = true)
106+
{
107+
return getTaskOptionValue<o2::framework::Configurable<ValueType>>(initContext, taskName, value.name, value.value, true);
108+
}
109+
98110
#endif // COMMON_CORE_TABLEHELPER_H_

0 commit comments

Comments
 (0)