Template Class Arc#

Inheritance Relationships#

Base Type#

Class Documentation#

template<typename T>
class Arc : public tvm::ffi::ObjectPtr<T>#

A non-null owning pointer for Object.

Arc has the same layout as ObjectPtr and supports the same copy, move, and derived-to-base conversions. Unlike ObjectPtr, its safe public API cannot create a null value. A moved-from Arc and an Arc explicitly constructed with UnsafeInit may be null; such values must be populated before use. Operations on Arc rely on the non-null invariant and do not validate it at runtime.

See also

make_arc

Template Parameters:

T – The Object subclass being owned.

Public Functions

Arc() = delete#
Arc(std::nullptr_t) = delete#
Arc(const Arc&) = default#

Copy constructor.

Arc(Arc&&) = default#

Move constructor.

template<typename U, std::enable_if_t<std::is_base_of_v<T, U>, int> = 0>
inline Arc(const Arc<U> &other)#

Copy-upcast an Arc of a derived Object type.

Parameters:

other – The Arc to copy.

template<typename U, std::enable_if_t<std::is_base_of_v<T, U>, int> = 0>
inline Arc(Arc<U> &&other)#

Move-upcast an Arc of a derived Object type.

Parameters:

other – The Arc to move.

inline explicit Arc(UnsafeInit tag)#

Construct an empty Arc for controlled construct-then-populate flows.

Parameters:

tag – The unsafe initialization tag.