tvm
Public Member Functions | Friends | List of all members
tvm::runtime::ObjectPtr< T > Class Template Reference

A custom smart pointer for Object. More...

#include <object.h>

Collaboration diagram for tvm::runtime::ObjectPtr< T >:

Public Member Functions

 ObjectPtr ()
 default constructor More...
 
 ObjectPtr (std::nullptr_t)
 default constructor More...
 
 ObjectPtr (const ObjectPtr< T > &other)
 copy constructor More...
 
template<typename U >
 ObjectPtr (const ObjectPtr< U > &other)
 copy constructor More...
 
 ObjectPtr (ObjectPtr< T > &&other)
 move constructor More...
 
template<typename Y >
 ObjectPtr (ObjectPtr< Y > &&other)
 move constructor More...
 
 ~ObjectPtr ()
 destructor More...
 
void swap (ObjectPtr< T > &other)
 Swap this array with another Object. More...
 
T * get () const
 
T * operator-> () const
 
T & operator* () const
 
ObjectPtr< T > & operator= (const ObjectPtr< T > &other)
 copy assignment More...
 
ObjectPtr< T > & operator= (ObjectPtr< T > &&other)
 move assignment More...
 
 operator bool () const
 nullptr check More...
 
void reset ()
 reset the content of ptr to be nullptr More...
 
int use_count () const
 
bool unique () const
 
bool operator== (const ObjectPtr< T > &other) const
 
bool operator!= (const ObjectPtr< T > &other) const
 
bool operator== (std::nullptr_t null) const
 
bool operator!= (std::nullptr_t null) const
 

Friends

class Object
 
class ObjectRef
 
struct ObjectPtrHash
 
template<typename >
class ObjectPtr
 
template<typename >
class ObjAllocatorBase
 
class TVMPODValue_
 
class TVMArgsSetter
 
class TVMRetValue
 
class TVMArgValue
 
class TVMMovableArgValue_
 
template<typename RelayRefType , typename ObjType >
RelayRefType GetRef (const ObjType *ptr)
 
template<typename BaseType , typename ObjType >
ObjectPtr< BaseType > GetObjectPtr (ObjType *ptr)
 

Detailed Description

template<typename T>
class tvm::runtime::ObjectPtr< T >

A custom smart pointer for Object.

Template Parameters
Tthe content data type.
See also
make_object

Constructor & Destructor Documentation

◆ ObjectPtr() [1/6]

template<typename T >
tvm::runtime::ObjectPtr< T >::ObjectPtr ( )
inline

default constructor

◆ ObjectPtr() [2/6]

template<typename T >
tvm::runtime::ObjectPtr< T >::ObjectPtr ( std::nullptr_t  )
inline

default constructor

◆ ObjectPtr() [3/6]

template<typename T >
tvm::runtime::ObjectPtr< T >::ObjectPtr ( const ObjectPtr< T > &  other)
inline

copy constructor

Parameters
otherThe value to be moved

◆ ObjectPtr() [4/6]

template<typename T >
template<typename U >
tvm::runtime::ObjectPtr< T >::ObjectPtr ( const ObjectPtr< U > &  other)
inline

copy constructor

Parameters
otherThe value to be moved

◆ ObjectPtr() [5/6]

template<typename T >
tvm::runtime::ObjectPtr< T >::ObjectPtr ( ObjectPtr< T > &&  other)
inline

move constructor

Parameters
otherThe value to be moved

◆ ObjectPtr() [6/6]

template<typename T >
template<typename Y >
tvm::runtime::ObjectPtr< T >::ObjectPtr ( ObjectPtr< Y > &&  other)
inline

move constructor

Parameters
otherThe value to be moved

◆ ~ObjectPtr()

template<typename T >
tvm::runtime::ObjectPtr< T >::~ObjectPtr ( )
inline

destructor

Member Function Documentation

◆ get()

template<typename T >
T* tvm::runtime::ObjectPtr< T >::get ( ) const
inline
Returns
Get the content of the pointer

◆ operator bool()

template<typename T >
tvm::runtime::ObjectPtr< T >::operator bool ( ) const
inlineexplicit

nullptr check

Returns
result of comparison of internal pointer with nullptr.

◆ operator!=() [1/2]

template<typename T >
bool tvm::runtime::ObjectPtr< T >::operator!= ( const ObjectPtr< T > &  other) const
inline
Returns
Whether two ObjectPtr equals each other

◆ operator!=() [2/2]

template<typename T >
bool tvm::runtime::ObjectPtr< T >::operator!= ( std::nullptr_t  null) const
inline
Returns
Whether the pointer is not nullptr

◆ operator*()

template<typename T >
T& tvm::runtime::ObjectPtr< T >::operator* ( ) const
inline
Returns
The reference

◆ operator->()

template<typename T >
T* tvm::runtime::ObjectPtr< T >::operator-> ( ) const
inline
Returns
The pointer

◆ operator=() [1/2]

template<typename T >
ObjectPtr<T>& tvm::runtime::ObjectPtr< T >::operator= ( const ObjectPtr< T > &  other)
inline

copy assignment

Parameters
otherThe value to be assigned.
Returns
reference to self.

◆ operator=() [2/2]

template<typename T >
ObjectPtr<T>& tvm::runtime::ObjectPtr< T >::operator= ( ObjectPtr< T > &&  other)
inline

move assignment

Parameters
otherThe value to be assigned.
Returns
reference to self.

◆ operator==() [1/2]

template<typename T >
bool tvm::runtime::ObjectPtr< T >::operator== ( const ObjectPtr< T > &  other) const
inline
Returns
Whether two ObjectPtr do not equal each other

◆ operator==() [2/2]

template<typename T >
bool tvm::runtime::ObjectPtr< T >::operator== ( std::nullptr_t  null) const
inline
Returns
Whether the pointer is nullptr

◆ reset()

template<typename T >
void tvm::runtime::ObjectPtr< T >::reset ( )
inline

reset the content of ptr to be nullptr

◆ swap()

template<typename T >
void tvm::runtime::ObjectPtr< T >::swap ( ObjectPtr< T > &  other)
inline

Swap this array with another Object.

Parameters
otherThe other Object

◆ unique()

template<typename T >
bool tvm::runtime::ObjectPtr< T >::unique ( ) const
inline
Returns
whether the reference is unique

◆ use_count()

template<typename T >
int tvm::runtime::ObjectPtr< T >::use_count ( ) const
inline
Returns
The use count of the ptr, for debug purposes

Friends And Related Function Documentation

◆ GetObjectPtr

template<typename T >
template<typename BaseType , typename ObjType >
ObjectPtr<BaseType> GetObjectPtr ( ObjType *  ptr)
friend

◆ GetRef

template<typename T >
template<typename RelayRefType , typename ObjType >
RelayRefType GetRef ( const ObjType *  ptr)
friend

◆ ObjAllocatorBase

template<typename T >
template<typename >
friend class ObjAllocatorBase
friend

◆ Object

template<typename T >
friend class Object
friend

◆ ObjectPtr

template<typename T >
template<typename >
friend class ObjectPtr
friend

◆ ObjectPtrHash

template<typename T >
friend struct ObjectPtrHash
friend

◆ ObjectRef

template<typename T >
friend class ObjectRef
friend

◆ TVMArgsSetter

template<typename T >
friend class TVMArgsSetter
friend

◆ TVMArgValue

template<typename T >
friend class TVMArgValue
friend

◆ TVMMovableArgValue_

template<typename T >
friend class TVMMovableArgValue_
friend

◆ TVMPODValue_

template<typename T >
friend class TVMPODValue_
friend

◆ TVMRetValue

template<typename T >
friend class TVMRetValue
friend

The documentation for this class was generated from the following file: