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

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


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)

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 


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

Definition at line 67 of file ncbi_autoinit.cpp.

References m_Ptr, and NCBI_ASSERT.


CAutoInitPtr_Base::DECLARE_CLASS_STATIC_MUTEX ( sm_Mutex  )

◆ IsInitialized()

bool CAutoInitPtr_Base::IsInitialized ( void  ) const

◆ x_Cleanup()

void CAutoInitPtr_Base::x_Cleanup ( void  )

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

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

Definition at line 97 of file ncbi_autoinit.hpp.

Referenced by x_Cleanup().

◆ m_UserCleanup

FUserCleanup CAutoInitPtr_Base::m_UserCleanup

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 Sat Jul 13 13:35:24 2024 by rev. 669887