CppParser
Loading...
Searching...
No Matches
CppEasyPtr< CppObjT > Class Template Reference

Helps working with raw or unique_ptr of CppObj in a uniform way. More...

#include <cppeasyptr.h>

Collaboration diagram for CppEasyPtr< CppObjT >:
Collaboration graph

Public Member Functions

 CppEasyPtr (CppObjT *rawPtr)
 
 CppEasyPtr (const std::unique_ptr< CppObjT > &ptr)
 
template<typename = std::enable_if<!std::is_const<CppObjT>::value>>
 CppEasyPtr (CppObj *rawPtr)
 
template<typename = std::enable_if<std::is_const<CppObjT>::value>>
 CppEasyPtr (const CppObj *rawPtr)
 
template<typename _UCppObj >
 CppEasyPtr (const std::unique_ptr< _UCppObj > &ptr)
 
CppObjT * operator-> () const
 
 operator bool () const
 
 operator CppObjT * () const
 
 operator CppObj * () const
 
 operator const CppObj * () const
 
CppObjT & operator* () const
 
template<typename _UCppObj >
 operator _UCppObj * () const
 
CppObjT * get () const
 

Private Attributes

CppObjT * ptr_
 

Detailed Description

template<typename CppObjT>
class CppEasyPtr< CppObjT >

Helps working with raw or unique_ptr of CppObj in a uniform way.

It is design to not handle the ownership of the object. Just to make it easy to work with raw pointer or unique_ptr in the same way.

Template Parameters
CppObjTCppObj or any of it's descendent type.

Definition at line 43 of file cppeasyptr.h.

Constructor & Destructor Documentation

◆ CppEasyPtr() [1/5]

template<typename CppObjT >
CppEasyPtr< CppObjT >::CppEasyPtr ( CppObjT *  rawPtr)
inline

Definition at line 46 of file cppeasyptr.h.

◆ CppEasyPtr() [2/5]

template<typename CppObjT >
CppEasyPtr< CppObjT >::CppEasyPtr ( const std::unique_ptr< CppObjT > &  ptr)
inline

Definition at line 50 of file cppeasyptr.h.

◆ CppEasyPtr() [3/5]

template<typename CppObjT >
template<typename = std::enable_if<!std::is_const<CppObjT>::value>>
CppEasyPtr< CppObjT >::CppEasyPtr ( CppObj rawPtr)
inline

Definition at line 56 of file cppeasyptr.h.

Here is the call graph for this function:

◆ CppEasyPtr() [4/5]

template<typename CppObjT >
template<typename = std::enable_if<std::is_const<CppObjT>::value>>
CppEasyPtr< CppObjT >::CppEasyPtr ( const CppObj rawPtr)
inline

Definition at line 64 of file cppeasyptr.h.

Here is the call graph for this function:

◆ CppEasyPtr() [5/5]

template<typename CppObjT >
template<typename _UCppObj >
CppEasyPtr< CppObjT >::CppEasyPtr ( const std::unique_ptr< _UCppObj > &  ptr)
inline

Definition at line 72 of file cppeasyptr.h.

Member Function Documentation

◆ get()

template<typename CppObjT >
CppObjT * CppEasyPtr< CppObjT >::get ( ) const
inline

Definition at line 115 of file cppeasyptr.h.

◆ operator _UCppObj *()

template<typename CppObjT >
template<typename _UCppObj >
CppEasyPtr< CppObjT >::operator _UCppObj * ( ) const
inline

Definition at line 110 of file cppeasyptr.h.

◆ operator bool()

template<typename CppObjT >
CppEasyPtr< CppObjT >::operator bool ( ) const
inline

Definition at line 84 of file cppeasyptr.h.

◆ operator const CppObj *()

template<typename CppObjT >
CppEasyPtr< CppObjT >::operator const CppObj * ( ) const
inline

Definition at line 99 of file cppeasyptr.h.

◆ operator CppObj *()

template<typename CppObjT >
CppEasyPtr< CppObjT >::operator CppObj * ( ) const
inline

Definition at line 94 of file cppeasyptr.h.

◆ operator CppObjT *()

template<typename CppObjT >
CppEasyPtr< CppObjT >::operator CppObjT * ( ) const
inline

Definition at line 89 of file cppeasyptr.h.

◆ operator*()

template<typename CppObjT >
CppObjT & CppEasyPtr< CppObjT >::operator* ( ) const
inline

Definition at line 104 of file cppeasyptr.h.

◆ operator->()

template<typename CppObjT >
CppObjT * CppEasyPtr< CppObjT >::operator-> ( ) const
inline

Definition at line 79 of file cppeasyptr.h.

Member Data Documentation

◆ ptr_

template<typename CppObjT >
CppObjT* CppEasyPtr< CppObjT >::ptr_
private

Definition at line 121 of file cppeasyptr.h.


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