Name

OwnerPtr — A pointer that owns the object pointed to.

Synopsis

template<typename T> 
class OwnerPtr (PtrBaseSernaApi::PtrBase< T >) :

  # Allows correct passing of OwnerPtr by value as a temporary object. 
  template<typename T1> 
  struct OwnerPtrRef:
    # construct/copy/destruct
    __init__(T1 *)

    # public member functions


    T1 * p_;
  
  # construct/copy/destruct
  __init__()
  __init__(T *)
  template<class T1 > __init__(OwnerPtr< T1 > &)
  __init__(OwnerPtrRef< T >)
  OwnerPtr& operator=(T *)
  template<class T1 > OwnerPtr& operator=(OwnerPtr< T1 > &)
  __del__()

  # public member functions

  None reset(T *) 
  None clear() 
  template<class T1 > operator OwnerPtrRef< T1 >() 
  template<class T1 > operator OwnerPtr< T1 >() 

Description

Destroys the owned object when being destroyed by itself. T must not be of array type. Behaviour of this class mimics std::auto_ptr, the main difference is common interface of PtrBase<T>.

OwnerPtr construct/copy/destruct

  1. __init__()


  2. __init__(T * p)


  3. template<class T1 > __init__(OwnerPtr< T1 > & other)


  4. __init__(OwnerPtrRef< T > ref)


  5. OwnerPtr& operator=(T * p)


  6. template<class T1 > OwnerPtr& operator=(OwnerPtr< T1 > & other)


  7. __del__()


OwnerPtr public member functions

  1. None reset(T * p)


  2. None clear()

    Implicitly destroy object.


  3. template<class T1 > operator OwnerPtrRef< T1 >()


  4. template<class T1 > operator OwnerPtr< T1 >()