carb::tasking::RequiredObject

Defined in carb/tasking/TaskingHelpers.h

struct RequiredObject : public carb::tasking::Object

Helper class to ensure correct compliance with the requiredObject parameter of ITasking::add[Throttled]SubTask() and wait() functions.

The following may be converted into a RequiredObject: TaskContext, Future, Any, All, Counter*, or CounterWrapper.

Public Functions

inline constexpr RequiredObject(std::nullptr_t)

Constructor that accepts a std::nullptr_t.

template<class T, std::enable_if_t<std::is_convertible<T, Counter*>::value, bool> = false>
inline constexpr RequiredObject(T &&c)

Constructor that accepts an object that can be converted to Counter*.

Parameters

c – An object convertible to Counter*. This can be Any, All, Counter* or CounterWrapper.

template<class T, std::enable_if_t<std::is_convertible<T, TaskContext>::value, bool> = true>
inline constexpr RequiredObject(T &&tc)

Constructor that accepts an object that can be converted to TaskContext.

Parameters

tc – A TaskContext or object convertible to TaskContext, such as a Future.

inline constexpr RequiredObject(const TaskGroup &tg)

Constructor that accepts a TaskGroup&.

inline constexpr RequiredObject(const TaskGroup *tg)

Constructor that accepts a TaskGroup*.

nullptr may be provided.

Public Members

ObjectType type

The ObjectType of the represented type.

void *data

Interpreted based on the ObjectType provided.