Class Receiver
Defined in File receiver.hpp
Base Type
public holoscan::gxf::GXFResource(Class GXFResource)
Derived Types
public holoscan::AsyncBufferReceiver(Class AsyncBufferReceiver)public holoscan::DoubleBufferReceiver(Class DoubleBufferReceiver)public holoscan::UcxReceiver(Class UcxReceiver)
-
class Receiver : public holoscan::gxf::GXFResource
Base receiver class.
Receivers are used by input ports to receive messages.
Subclassed by holoscan::AsyncBufferReceiver, holoscan::DoubleBufferReceiver, holoscan::UcxReceiver
Public Functions
-
template<typename ArgT, typename ...ArgsT, typename = std::enable_if_t<!std::is_base_of_v<::holoscan::Resource, 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 Receiver(ArgT &&arg, ArgsT&&... args)
-
Receiver() = default
-
Receiver(const std::string &name, nvidia::gxf::Receiver *component)
-
inline virtual const char *gxf_typename() const override
-
nvidia::gxf::Receiver *get() const
-
size_t capacity() const
Get the current capacity of the Receiver queue.
For double-buffer queues this is the capacity of the main stage
- Returns
The capacity of the Receiver queue.
-
size_t size() const
Get the number of elements currently in the main stage of the Receiver queue.
- Returns
The number of elements in the main stage.
-
size_t back_size() const
Get the number of elements currently in the back stage of the Receiver queue.
- Returns
The number of elements in the back stage.
-
nvidia::gxf::Expected<nvidia::gxf::Entity> peek(int32_t index = 0) const
Peek at a message in the queue without consuming it.
This method allows inspection of messages in the main stage of the receiver queue without removing them. This is useful for conditions that need to check message contents before the operator executes.
- Parameters
index – The index of the message to peek (0 = oldest message in queue).
- Returns
The entity at the given index, or an error if not available.
-
nvidia::gxf::Expected<void> sync()
Sync messages from back stage to main stage.
For double-buffer queues, this moves messages from the back stage (where they arrive) to the main stage (where they can be consumed). This is typically called by the framework before operator execution, but may be needed for conditions that check queue state before the operator is scheduled.
- Returns
Success if the sync completed, or an error otherwise.
-
template<typename ArgT, typename ...ArgsT, typename = std::enable_if_t<!std::is_base_of_v<::holoscan::Resource, std::decay_t<ArgT>> && (std::is_same_v<::holoscan::Arg, std::decay_t<ArgT>> || std::is_same_v<::holoscan::ArgList, std::decay_t<ArgT>>)>>