Class ResourceAllocator

Inheritance Relationships

Derived Type

Class Documentation

class ResourceAllocator

A base class that encapsulates an NVCVResourceAllocator struct

This class is a convenience wrapper around NVCVResourceAllocator. The derived classes expose additional functionality, specific to the resource type being allocated.

Warning

ResourceAllocator does not own the context object pointed to by cdata().ctx. The destruction of ResourceAllocator does not call the cleanup function.

Subclassed by nvcv::MemAllocator

Public Functions

ResourceAllocator() = default
inline explicit ResourceAllocator(const NVCVResourceAllocator &alloc)
inline const NVCVResourceAllocator &cdata() const &

Returns the underlying allocator descriptor

inline NVCVResourceAllocator cdata() &&

Returns the underlying allocator descriptor

template<typename Derived>
inline Derived cast() const

Casts the resource allocator to a compatible type.

Public Static Functions

static inline constexpr bool IsCompatibleKind(NVCVResourceType)

Protected Functions

inline NVCVResourceAllocator &data() &

Protected Attributes

NVCVResourceAllocator m_data = {}