Class MultiMessageAvailableCondition
Defined in File multi_message_available.hpp
Base Type
public holoscan::gxf::GXFCondition
(Class GXFCondition)
-
class MultiMessageAvailableCondition : public holoscan::gxf::GXFCondition
Condition class that allows an operator to execute only when one or more messages are available across the specified input ports.
This condition applies to a specific set of input ports of the operator as determined by setting the “receivers” argument. It can operate in one of two modes:
“SumOfAll” mode: The condition checks if the sum of messages available across all input ports is greater than or equal to a given threshold. For this mode,
min_sum
should be specified.”PerReceiver” mode: The condition checks if the number of messages available at each input port is greater than or equal to a given threshold. For this mode,
min_sizes
should be specified. This mode is equivalent to assigning individiaul MessageAvailableConditions to each of the receivers.
Note: This condition must currently be set via the
Operator::multi_port_condition
method usingConditionType::kMultiMessageAvailable
. The “receivers” argument must be set based on the input port names as described in the “Parameters” section below.==Parameters==
sampling_mode (std::string or MultiMessageAvailableCondition::SamplingMode) : The mode of operation of this condition (see above). Options are currently “SumOfAll” or “PerReceiver”.
min_sizes (std::vector<size_t>): The condition permits execution if all given receivers have at least the given number of messages available in this list. This option is only intended for use with “PerReceiver”
sampling_mode
. The length ofmin_sizes
must match the number of receivers associated with the condition.min_sum (size_t): The condition permits execution if the sum of message counts of all receivers have at least the given number of messages available. This option is only intended for use with the “SumOfAll”
sampling_mode
.receivers (std::vector<std::string>): The receivers whose message queues will be checked. This should be specified by a vector containing the names of the Operator’s input ports the condition will apply to. The Holoscan SDK will then automatically replace the port names with the actual receiver objects at application run time.
Public Types
-
using SamplingMode = nvidia::gxf::SamplingMode
sampling mode to apply to the conditions across the input ports (receivers).
SamplingMode::kSumOfAll - min_sum specified is for the sum of all messages at all receivers SamplingMode::kPerReceiver - min_sizes specified is a minimum size per receiver connected
Public Functions
-
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 MultiMessageAvailableCondition(ArgT &&arg, ArgsT&&... args)
-
MultiMessageAvailableCondition() = default
-
inline virtual const char *gxf_typename() const override
-
inline std::vector<std::shared_ptr<Receiver>> &receivers()
-
virtual void initialize() override
Initialize the component.
This method is called only once when the component is created for the first time, and use of light-weight initialization.
-
virtual void setup(ComponentSpec &spec) override
Define the condition specification.
- Parameters
spec – The reference to the component specification.
-
void min_sum(size_t value)
-
inline size_t min_sum()
-
void sampling_mode(SamplingMode value)
-
inline SamplingMode sampling_mode()
-
void add_min_size(size_t value)
-
inline std::vector<size_t> min_sizes()
-
nvidia::gxf::MultiMessageAvailableSchedulingTerm *get() const