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

A custom smart pointer for Object. More...

#include <object.h>

Collaboration diagram for mxnet::runtime::ObjectPtr< T >:
Collaboration graph

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 assignmemt More...
 
ObjectPtr< T > & operator= (ObjectPtr< T > &&other)
 move assignmemt 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 ObjectHash
 
template<typename >
class ObjectPtr
 we always used ObjectPtr for a reference pointer to the node, so this alias can be changed in case. More...
 
template<typename >
class ObjAllocatorBase
 
class MXNetPODValue_
 
class MXNetArgsSetter
 
class MXNetRetValue
 
class MXNetArgValue
 
template<typename RefType , typename ObjType >
RefType GetRef (const ObjType *ptr)
 
template<typename BaseType , typename ObjType >
ObjectPtr< BaseType > GetObjectPtr (ObjType *ptr)
 

Detailed Description

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

A custom smart pointer for Object.

Template Parameters
Tthe content data type.
See also
make_object

Constructor & Destructor Documentation

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

default constructor

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

default constructor

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

copy constructor

Parameters
otherThe value to be moved
template<typename T>
template<typename U >
mxnet::runtime::ObjectPtr< T >::ObjectPtr ( const ObjectPtr< U > &  other)
inline

copy constructor

Parameters
otherThe value to be moved
template<typename T>
mxnet::runtime::ObjectPtr< T >::ObjectPtr ( ObjectPtr< T > &&  other)
inline

move constructor

Parameters
otherThe value to be moved
template<typename T>
template<typename Y >
mxnet::runtime::ObjectPtr< T >::ObjectPtr ( ObjectPtr< Y > &&  other)
inline

move constructor

Parameters
otherThe value to be moved
template<typename T>
mxnet::runtime::ObjectPtr< T >::~ObjectPtr ( )
inline

destructor

Member Function Documentation

template<typename T>
T* mxnet::runtime::ObjectPtr< T >::get ( ) const
inline
Returns
Get the content of the pointer
template<typename T>
bool mxnet::runtime::ObjectPtr< T >::operator!= ( const ObjectPtr< T > &  other) const
inline
Returns
Whether two ObjectPtr equals each other
template<typename T>
bool mxnet::runtime::ObjectPtr< T >::operator!= ( std::nullptr_t  null) const
inline
Returns
Whether the pointer is not nullptr
template<typename T>
T& mxnet::runtime::ObjectPtr< T >::operator* ( ) const
inline
Returns
The reference
template<typename T>
T* mxnet::runtime::ObjectPtr< T >::operator-> ( ) const
inline
Returns
The pointer
template<typename T>
ObjectPtr<T>& mxnet::runtime::ObjectPtr< T >::operator= ( const ObjectPtr< T > &  other)
inline

copy assignmemt

Parameters
otherThe value to be assigned.
Returns
reference to self.
template<typename T>
ObjectPtr<T>& mxnet::runtime::ObjectPtr< T >::operator= ( ObjectPtr< T > &&  other)
inline

move assignmemt

Parameters
otherThe value to be assigned.
Returns
reference to self.
template<typename T>
bool mxnet::runtime::ObjectPtr< T >::operator== ( const ObjectPtr< T > &  other) const
inline
Returns
Whether two ObjectPtr do not equal each other
template<typename T>
bool mxnet::runtime::ObjectPtr< T >::operator== ( std::nullptr_t  null) const
inline
Returns
Whether the pointer is nullptr
template<typename T>
void mxnet::runtime::ObjectPtr< T >::reset ( )
inline

reset the content of ptr to be nullptr

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

Swap this array with another Object.

Parameters
otherThe other Object
template<typename T>
bool mxnet::runtime::ObjectPtr< T >::unique ( ) const
inline
Returns
whether the reference is unique
template<typename T>
int mxnet::runtime::ObjectPtr< T >::use_count ( ) const
inline
Returns
The use count of the ptr, for debug purposes

Friends And Related Function Documentation

template<typename T>
template<typename BaseType , typename ObjType >
ObjectPtr<BaseType> GetObjectPtr ( ObjType *  ptr)
friend
template<typename T>
template<typename RefType , typename ObjType >
RefType GetRef ( const ObjType *  ptr)
friend
template<typename T>
friend class MXNetArgsSetter
friend
template<typename T>
friend class MXNetArgValue
friend
template<typename T>
friend class MXNetPODValue_
friend
template<typename T>
friend class MXNetRetValue
friend
template<typename T>
template<typename >
friend class ObjAllocatorBase
friend
template<typename T>
friend class Object
friend
template<typename T>
friend struct ObjectHash
friend
template<typename T>
template<typename >
friend class ObjectPtr
friend

we always used ObjectPtr for a reference pointer to the node, so this alias can be changed in case.

By default, ObjectPtr is a std::shared_ptr of node

template<typename T>
friend class ObjectRef
friend

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