My Project
Private Types
CountedRefWeakPtr< PtrType > Class Template Reference

#include <countedref.h>

Private Types

typedef CountedRefWeakPtr self
 

Name template arguments

typedef PtrType ptr_type
 Construct unassigned weak reference. More...
 
typedef CountedRefPtr< CountedRefIndirectPtr< ptr_type > * > ptrptr_type
 Construct unassigned weak reference. More...
 
ptrptr_type m_indirect
 Construct unassigned weak reference. More...
 
 CountedRefWeakPtr ()
 Construct unassigned weak reference. More...
 
 CountedRefWeakPtr (ptr_type ptr)
 Convert from pointer. More...
 
 CountedRefWeakPtr (const self &rhs)
 Construct copy. More...
 
 ~CountedRefWeakPtr ()
 Unlink one reference (handled by CountedRefPtr) More...
 
void invalidate ()
 Mark weak reference as invalid. More...
 
bool unassigned () const
 Test whether reference was never used. More...
 
 operator bool () const
 Pointer-style interface. More...
 
selfoperator= (const self &rhs)
 Construct unassigned weak reference. More...
 
selfoperator= (ptr_type ptr)
 Construct unassigned weak reference. More...
 
bool operator== (ptr_type ptr) const
 Construct unassigned weak reference. More...
 
bool operator!= (ptr_type rhs) const
 Construct unassigned weak reference. More...
 
const ptr_type operator-> () const
 Construct unassigned weak reference. More...
 
ptr_type operator-> ()
 Construct unassigned weak reference. More...
 

Detailed Description

template<class PtrType>
class CountedRefWeakPtr< PtrType >

Definition at line 154 of file countedref.h.

Member Typedef Documentation

◆ ptr_type

template<class PtrType >
typedef PtrType CountedRefWeakPtr< PtrType >::ptr_type

Construct unassigned weak reference.

Definition at line 161 of file countedref.h.

◆ ptrptr_type

template<class PtrType >
typedef CountedRefPtr<CountedRefIndirectPtr<ptr_type>*> CountedRefWeakPtr< PtrType >::ptrptr_type

Construct unassigned weak reference.

Definition at line 162 of file countedref.h.

◆ self

template<class PtrType >
typedef CountedRefWeakPtr CountedRefWeakPtr< PtrType >::self
private

Definition at line 155 of file countedref.h.

Constructor & Destructor Documentation

◆ CountedRefWeakPtr() [1/3]

template<class PtrType >
CountedRefWeakPtr< PtrType >::CountedRefWeakPtr ( )
inline

Construct unassigned weak reference.

Definition at line 166 of file countedref.h.

166: m_indirect(NULL) { }
ptrptr_type m_indirect
Construct unassigned weak reference.
Definition: countedref.h:204
#define NULL
Definition: omList.c:12

◆ CountedRefWeakPtr() [2/3]

template<class PtrType >
CountedRefWeakPtr< PtrType >::CountedRefWeakPtr ( ptr_type  ptr)
inline

Convert from pointer.

Definition at line 169 of file countedref.h.

◆ CountedRefWeakPtr() [3/3]

template<class PtrType >
CountedRefWeakPtr< PtrType >::CountedRefWeakPtr ( const self rhs)
inline

Construct copy.

Definition at line 172 of file countedref.h.

172: m_indirect(rhs.m_indirect) { }

◆ ~CountedRefWeakPtr()

template<class PtrType >
CountedRefWeakPtr< PtrType >::~CountedRefWeakPtr ( )
inline

Unlink one reference (handled by CountedRefPtr)

Definition at line 175 of file countedref.h.

175{ }

Member Function Documentation

◆ invalidate()

template<class PtrType >
void CountedRefWeakPtr< PtrType >::invalidate ( )
inline

Mark weak reference as invalid.

Definition at line 178 of file countedref.h.

178{ *this = NULL; }

◆ operator bool()

template<class PtrType >
CountedRefWeakPtr< PtrType >::operator bool ( ) const
inline

Pointer-style interface.

Definition at line 184 of file countedref.h.

184{ return operator->(); }
const ptr_type operator->() const
Construct unassigned weak reference.
Definition: countedref.h:200

◆ operator!=()

template<class PtrType >
bool CountedRefWeakPtr< PtrType >::operator!= ( ptr_type  rhs) const
inline

Construct unassigned weak reference.

Definition at line 199 of file countedref.h.

199{ return !operator==(rhs); }
bool operator==(ptr_type ptr) const
Construct unassigned weak reference.
Definition: countedref.h:196

◆ operator->() [1/2]

template<class PtrType >
ptr_type CountedRefWeakPtr< PtrType >::operator-> ( )
inline

Construct unassigned weak reference.

Definition at line 201 of file countedref.h.

201{ return (m_indirect? m_indirect->m_ptr:NULL); }

◆ operator->() [2/2]

template<class PtrType >
const ptr_type CountedRefWeakPtr< PtrType >::operator-> ( ) const
inline

Construct unassigned weak reference.

Definition at line 200 of file countedref.h.

200{ return (m_indirect? m_indirect->m_ptr: NULL); }

◆ operator=() [1/2]

template<class PtrType >
self & CountedRefWeakPtr< PtrType >::operator= ( const self rhs)
inline

Construct unassigned weak reference.

Definition at line 185 of file countedref.h.

185 {
186 m_indirect = rhs.m_indirect;
187 return *this;
188 }

◆ operator=() [2/2]

template<class PtrType >
self & CountedRefWeakPtr< PtrType >::operator= ( ptr_type  ptr)
inline

Construct unassigned weak reference.

Definition at line 189 of file countedref.h.

189 {
190 if (!m_indirect)
192 else
193 m_indirect->m_ptr = ptr;
194 return *this;
195 }

◆ operator==()

template<class PtrType >
bool CountedRefWeakPtr< PtrType >::operator== ( ptr_type  ptr) const
inline

Construct unassigned weak reference.

Definition at line 196 of file countedref.h.

196 {
197 return m_indirect &&(m_indirect->m_ptr == ptr);
198 }

◆ unassigned()

template<class PtrType >
bool CountedRefWeakPtr< PtrType >::unassigned ( ) const
inline

Test whether reference was never used.

Definition at line 181 of file countedref.h.

181{ return !m_indirect; }

Field Documentation

◆ m_indirect

template<class PtrType >
ptrptr_type CountedRefWeakPtr< PtrType >::m_indirect
private

Construct unassigned weak reference.

Definition at line 204 of file countedref.h.


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