Class Condition
Defined in File condition.hpp
Base Type
public holoscan::Component
(Class Component)
Derived Type
public holoscan::gxf::GXFCondition
(Class GXFCondition)
-
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<::holoscan::Condition, std::decay_t<ArgT>> && (std::is_same_v<::holoscan::Arg, std::decay_t<ArgT>> || std::is_same_v<::holoscan::ArgList, std::decay_t<ArgT>>)>>
inline explicit 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.
Set the component specification 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.
Get the shared pointer to the component spec.
- Returns
The shared pointer to the component spec.
Add a resource to the condition.
- Parameters
arg – The resource to add.
Add a resource to the condition.
- Parameters
arg – The resource to add.
-
inline std::unordered_map<std::string, std::shared_ptr<Resource>> &resources()
Get the resources of the condition.
- Returns
The resources of the condition.
-
inline virtual void setup(ComponentSpec &spec)
Define the condition specification.
- Parameters
spec – The reference to the component specification.
-
virtual YAML::Node to_yaml_node() const override
Get a YAML representation of the condition.
- Returns
YAML node including spec of the condition in addition to the base component properties.
Protected Attributes
-
bool is_initialized_ = false
Whether the condition is initialized.
-
std::unordered_map<std::string, std::shared_ptr<Resource>> resources_
The resources used by the condition.
Friends
- friend class holoscan::Operator
-
Condition() = default