holoscan::gxf::Entity

Beta
View as Markdown

Class to wrap GXF Entity (nvidia::gxf::Entity).

#include <holoscan/gxf/entity.hpp>

Inherits from: nvidia::gxf::Entity (public)


Constructors

Entity

holoscan::gxf::Entity::Entity() = defaultholoscan::gxf::Entity::Entity() = default

Methods

operator bool

holoscan::gxf::Entity::operator bool() const

Return true if the entity is not null.

Calling this method on an entity object from {cpp:func}holoscan::IOContext::receive will return false if there is no entity to receive.

Returns: true if the entity is not null. Otherwise, false.

get

template <typename DataT,
typename = std::enable_if_t<!holoscan::is_vector_v<DataT> && holoscan::is_one_of_v<DataT, holoscan::Tensor>>>
std::shared_ptr<DataT> holoscan::gxf::Entity::get(
const char *name = nullptr,
bool log_errors = true
) const

add

template <typename DataT,
typename = std::enable_if_t<!holoscan::is_vector_v<DataT> && holoscan::is_one_of_v<DataT, holoscan::Tensor>>>
void holoscan::gxf::Entity::add(
const std::shared_ptr<DataT> &data,
const char *name = nullptr,
std::optional<cudaStream_t> stream = std::nullopt
)

Adds a tensor component to the entity.

Template parameters

DataT
typename

The data type (must be holoscan::Tensor).

Parameters

data
const std::shared_ptr<DataT> &

Shared pointer to the tensor data.

name
const char *Defaults to nullptr

Optional name for the component.

stream
std::optional<cudaStream_t>Defaults to std::nullopt

Optional CUDA stream for stream-aware memory deallocation. When provided, the stream is set on the tensor’s memory buffer, enabling allocators like BlockMemoryPool to defer memory reuse until GPU operations complete.


Static methods

New

static Entity holoscan::gxf::Entity::New(static Entity holoscan::gxf::Entity::New(
ExecutionContext *context
)