Class Condition

Base Type

Derived Type

class Condition : public holoscan::Component

Base class for all conditions.

A condition is a predicate that can be evaluated at runtime to determine if an operator should execute. This matches the semantics of GXF’s Scheduling Term.

Subclassed by holoscan::gxf::GXFCondition

Public Functions

Condition() = default

Condition(Condition&&) = default

template<typename ArgT, typename ...ArgsT, typename = std::enable_if_t<!std::is_base_of_v<Condition, std::decay_t<ArgT>> && (std::is_same_v<Arg, std::decay_t<ArgT>> || std::is_same_v<ArgList, std::decay_t<ArgT>>)>>
inline Condition(ArgT &&arg, ArgsT&&... args)

Construct a new Condition object.

~Condition() override = default

inline Condition &name(const std::string &name) &

Set the name of the condition.

Parameters:

name – The name of the condition.

Returns:

The reference to the condition.

inline Condition &&name(const std::string &name) &&

Set the name of the condition.

Parameters:

name – The name of the condition.

Returns:

The reference to the condition.

inline Condition &fragment(Fragment *fragment)

Set the fragment of the condition.

Parameters:

fragment – The pointer to the fragment of the condition.

Returns:

The reference to the condition.

inline Condition &spec(std::unique_ptr<ComponentSpec> spec)

Set the component specification to the condition.

The component specification would be ‘moved’ to the condition.

Parameters:

spec – The component specification.

Returns:

The reference to the condition.

inline ComponentSpec *spec()

Get the component specification of the condition.

Returns:

The pointer to the component specification.

inline virtual void setup(ComponentSpec &spec)

Define the condition specification.

Parameters:

spec – The reference to the component specification.

inline const std::string &name() const

Get the name of the component.

Returns:

The name of the component.

inline Fragment *fragment()

Get a pointer to Fragment object.

Returns:

The Pointer to Fragment object.

inline void add_arg(const Arg &arg)

Add an argument to the component.

Parameters:

arg – The argument to add.

inline void add_arg(Arg &&arg)

Add an argument to the component.

Parameters:

arg – The argument to add.

inline void add_arg(const ArgList &arg)

Add a list of arguments to the component.

Parameters:

arg – The list of arguments to add.

inline void add_arg(ArgList &&arg)

Add a list of arguments to the component.

Parameters:

arg – The list of arguments to add.

Protected Attributes

std::unique_ptr<ComponentSpec> spec_

The component specification.

© Copyright 2022, NVIDIA. Last updated on Jun 28, 2023.