NCBI C++ ToolKit
Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
CAutoInitPtr_Base Class Reference

Search Toolkit Book for CAutoInitPtr_Base

CAutoInitPtr_Base:: More...

#include <corelib/ncbi_autoinit.hpp>

+ Inheritance diagram for CAutoInitPtr_Base:

Public Types

typedef void(* FUserCleanup) (void *ptr)
 User cleanup function type. More...
 

Public Member Functions

 ~CAutoInitPtr_Base (void)
 
bool IsInitialized (void) const
 

Protected Types

typedef void(* FSelfCleanup) (void **ptr)
 Cleanup function type used by derived classes. More...
 

Protected Member Functions

 CAutoInitPtr_Base (FSelfCleanup self_cleanup, FUserCleanup user_cleanup=0)
 Constructor. More...
 
void AssertUninitialized (void) const
 
 DECLARE_CLASS_STATIC_MUTEX (sm_Mutex)
 

Protected Attributes

void * m_Ptr
 Pointer to the data. More...
 

Private Member Functions

void x_Cleanup (void)
 

Private Attributes

FSelfCleanup m_SelfCleanup
 
FUserCleanup m_UserCleanup
 

Detailed Description

CAutoInitPtr_Base::

Base class for CAutoInitPtr<> and CAutoInitRef<> templates.

Definition at line 60 of file ncbi_autoinit.hpp.

Member Typedef Documentation

◆ FSelfCleanup

typedef void(* CAutoInitPtr_Base::FSelfCleanup) (void **ptr)
protected

Cleanup function type used by derived classes.

Definition at line 72 of file ncbi_autoinit.hpp.

◆ FUserCleanup

typedef void(* CAutoInitPtr_Base::FUserCleanup) (void *ptr)

User cleanup function type.

Definition at line 64 of file ncbi_autoinit.hpp.

Constructor & Destructor Documentation

◆ ~CAutoInitPtr_Base()

CAutoInitPtr_Base::~CAutoInitPtr_Base ( void  )

Definition at line 60 of file ncbi_autoinit.cpp.

References x_Cleanup().

◆ CAutoInitPtr_Base()

CAutoInitPtr_Base::CAutoInitPtr_Base ( FSelfCleanup  self_cleanup,
FUserCleanup  user_cleanup = 0 
)
inlineprotected

Constructor.

Parameters
self_cleanupCleanup function to be executed on destruction, provided by a derived class.
user_cleanupUser-provided cleanup function to be executed on destruction.

Definition at line 81 of file ncbi_autoinit.hpp.

Member Function Documentation

◆ AssertUninitialized()

void CAutoInitPtr_Base::AssertUninitialized ( void  ) const
protected

Definition at line 67 of file ncbi_autoinit.cpp.

References m_Ptr, and NCBI_ASSERT.

◆ DECLARE_CLASS_STATIC_MUTEX()

CAutoInitPtr_Base::DECLARE_CLASS_STATIC_MUTEX ( sm_Mutex  )
protected

◆ IsInitialized()

bool CAutoInitPtr_Base::IsInitialized ( void  ) const
inline

◆ x_Cleanup()

void CAutoInitPtr_Base::x_Cleanup ( void  )
inlineprivate

Definition at line 100 of file ncbi_autoinit.hpp.

References m_Ptr, m_SelfCleanup, and m_UserCleanup.

Referenced by ~CAutoInitPtr_Base().

Member Data Documentation

◆ m_Ptr

void* CAutoInitPtr_Base::m_Ptr
protected

Pointer to the data.

Definition at line 92 of file ncbi_autoinit.hpp.

Referenced by AssertUninitialized(), CAutoInitPtr< T >::Get(), CAutoInitRef< T >::Get(), IsInitialized(), and x_Cleanup().

◆ m_SelfCleanup

FSelfCleanup CAutoInitPtr_Base::m_SelfCleanup
private

Definition at line 97 of file ncbi_autoinit.hpp.

Referenced by x_Cleanup().

◆ m_UserCleanup

FUserCleanup CAutoInitPtr_Base::m_UserCleanup
private

Definition at line 98 of file ncbi_autoinit.hpp.

Referenced by x_Cleanup().


The documentation for this class was generated from the following files:
Modified on Thu Feb 29 12:17:51 2024 by modify_doxy.py rev. 669887