Class Resource
- Defined in File resource.hpp 
Base Type
- public holoscan::Component(Class Component)
Derived Types
- public holoscan::Endpoint(Class Endpoint)
- public holoscan::gxf::GXFResource(Class GXFResource)
- class Resource : public holoscan::Component
- 
enum class ResourceType
- Resource type used for the initialization of the resource. - Values: - 
enumerator kNative
 - 
enumerator kGXF
 
- 
enumerator kNative
- 
Resource() = default
- 
Resource(Resource&&) = default
- 
template<typename ArgT, typename ...ArgsT, typename = std::enable_if_t<!std::is_base_of_v<Resource, std::decay_t<ArgT>> && (std::is_same_v<Arg, std::decay_t<ArgT>> || std::is_same_v<ArgList, std::decay_t<ArgT>>)>>
 inline explicit Resource(ArgT &&arg, ArgsT&&... args)
- Construct a new Resource object. - Parameters
 
- 
~Resource() override = default
- 
inline ResourceType resource_type() const
- Get the resource type. - Returns
 
- 
inline Resource &name(const std::string &name) &
- Set the name of the resource. - Parameters
- Returns
 
- 
inline Resource &&name(const std::string &name) &&
- Set the name of the resource. - Parameters
- Returns
 
- Set the component specification to the resource. - Parameters
- Returns
 
- 
inline ComponentSpec *spec()
- Get the component specification of the resource. - Returns
 
- Get the shared pointer to the component spec. - Returns
 
- 
inline virtual void setup(ComponentSpec &spec)
- Define the resource specification. - Parameters
 
- 
virtual void initialize() override
- 
virtual YAML::Node to_yaml_node() const override
- Get a YAML representation of the resource. - Returns
 
- 
ResourceType resource_type_ = ResourceType::kNative
- 
bool is_initialized_ = false
- friend class holoscan::NetworkContext
- friend class holoscan::Scheduler
- friend class holoscan::Operator
Base class for all resources.
Resources such as system memory or a GPU memory pool that an Operator needs to perform its job. Resources are allocated during the initialization phase of the application. This matches the semantics of GXF’s Memory Allocator or any other components derived from the Component class in GXF.
Subclassed by holoscan::Endpoint, holoscan::gxf::GXFResource
Public Types
Public Functions
Protected Attributes
Friends