Class PublisherAvailableCondition
Defined in File publisher_available.hpp
Base Type
public holoscan::Condition(Class Condition)
-
class PublisherAvailableCondition : public holoscan::Condition
Native condition that gates execution on pub/sub publisher match readiness.
This condition is ready when the configured receiver has at least
min_publisher_countmatched publishers.==Parameters==
receiver (
std::shared_ptr<holoscan::Receiver>, required): The receiver to monitor. In most applications this is provided as an input port name (for exampleArg("receiver", "in")) and resolved by the framework.min_publisher_count (
uint64_t, optional, default1): Minimum number of matched publishers required for READY state.require_pubsub_connector (
bool, optional, defaulttrue): If true, the receiver must resolve to aPubSubReceiver, otherwise initialization throws.poll_period_ms (
int64_t, optional, default100): Polling interval used while waiting for matched publishers. The condition returnsWAIT_TIMEuntil the next poll.latch_ready (
bool, optional, defaultfalse): If true, once the condition becomes ready it remains ready for the lifetime of the condition rather than returning to wait on later disconnects.
Public Functions
- HOLOSCAN_CONDITION_FORWARD_ARGS (PublisherAvailableCondition) PublisherAvailableCondition()=default
-
virtual void setup(ComponentSpec &spec) override
Define the condition specification.
- Parameters
spec – The reference to the component specification.
-
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 update_state(int64_t timestamp) override
Checks if the state of the condition can be updated and updates it.
- Parameters
timestamp – The current timestamp
-
virtual void check(int64_t timestamp, SchedulingStatusType *status_type, int64_t *target_timestamp) const override
Check the condition status before allowing execution.
If the condition is waiting for a time event ‘target_timestamp’ will contain the target timestamp.
- Parameters
timestamp – The current timestamp
status_type – The status of the condition
target_timestamp – The target timestamp (used if the term is waiting for a time event).
-
virtual void on_execute(int64_t timestamp) override
Called each time after the entity of this term was executed.
- Parameters
timestamp – The current timestamp