soui 5.0.0.1
Soui5 Doc
 
Loading...
Searching...
No Matches
TObjRefImpl< T > Class Template Reference

Template class implementing the IObjRef interface. More...

#include <obj-ref-impl.hpp>

Inheritance diagram for TObjRefImpl< T >:
TObjRefImpl2< T, T2 >

Public Member Functions

 TObjRefImpl ()
 Constructor that initializes the reference count to 1.
 
virtual ~TObjRefImpl ()
 Virtual destructor.
 
long AddRef () override
 Increments the reference count.
 
long Release () override
 Decrements the reference count and deletes the object if the count reaches zero.
 
void OnFinalRelease () override
 Deletes the object.
 

Protected Attributes

LONG m_cRef
 Reference count.
 

Detailed Description

template<class T>
class TObjRefImpl< T >

Template class implementing the IObjRef interface.

Template Parameters
TThe base class that implements the IObjRef interface.

Definition at line 14 of file obj-ref-impl.hpp.

Constructor & Destructor Documentation

◆ TObjRefImpl()

template<class T>
TObjRefImpl< T >::TObjRefImpl ( )
inline

Constructor that initializes the reference count to 1.

Definition at line 18 of file obj-ref-impl.hpp.

◆ ~TObjRefImpl()

template<class T>
virtual TObjRefImpl< T >::~TObjRefImpl ( )
inlinevirtual

Virtual destructor.

Definition at line 23 of file obj-ref-impl.hpp.

Member Function Documentation

◆ AddRef()

template<class T>
long TObjRefImpl< T >::AddRef ( )
inlineoverride

Increments the reference count.

Returns
The new reference count.

Definition at line 29 of file obj-ref-impl.hpp.

◆ OnFinalRelease()

template<class T>
void TObjRefImpl< T >::OnFinalRelease ( )
inlineoverride

Deletes the object.

Definition at line 47 of file obj-ref-impl.hpp.

◆ Release()

template<class T>
long TObjRefImpl< T >::Release ( )
inlineoverride

Decrements the reference count and deletes the object if the count reaches zero.

Returns
The new reference count.

Definition at line 36 of file obj-ref-impl.hpp.

Member Data Documentation

◆ m_cRef

template<class T>
LONG TObjRefImpl< T >::m_cRef
protected

Reference count.

Definition at line 54 of file obj-ref-impl.hpp.


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