Define HOLOSCAN_WRAP_GXF_COMPONENT_AS_RESOURCE
Defined in File gxf_component_resource.hpp
-
HOLOSCAN_WRAP_GXF_COMPONENT_AS_RESOURCE(class_name, gxf_typename)
Wrap a GXF Component as a Holoscan Resource.
This macro is designed to simplify the creation of Holoscan resources that encapsulate a GXF Component. It defines a class derived from
holoscan::GXFResource
and sets up the constructor to forward arguments to the base class while automatically setting the GXF type name.The resulting class is intended to act as a bridge, allowing GXF Components to be used directly within the Holoscan framework as resources, facilitating seamless integration and usage.
Example Usage:
// Define a Holoscan resource that wraps a GXF Component within a Holoscan application class App : public holoscan::Application { ... HOLOSCAN_WRAP_GXF_CODELET_AS_OPERATOR(MyTensorOp, "nvidia::gxf::test::SendTensor") HOLOSCAN_WRAP_GXF_COMPONENT_AS_RESOURCE(MyBlockMemoryPool, "nvidia::gxf::BlockMemoryPool") void compose() override { using namespace holoscan; ... auto tx = make_operator<MyCodeletOp>( "tx", make_condition<CountCondition>(15), Arg("pool") = make_resource<MyBlockMemoryPool>( "pool", Arg("storage_type") = static_cast<int32_t>(1), Arg("block_size") = 1024UL, Arg("num_blocks") = 2UL)); ... } ... };
- Parameters
class_name – The name of the new Holoscan resource class.
gxf_typename – The GXF type name that identifies the specific GXF Component being wrapped.