xapian-core  1.4.18
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
Xapian::Internal::opt_intrusive_base Class Reference

Base class for objects managed by opt_intrusive_ptr. More...

#include <intrusive_ptr.h>

+ Inheritance diagram for Xapian::Internal::opt_intrusive_base:

Public Member Functions

 opt_intrusive_base (const opt_intrusive_base &)
 
opt_intrusive_baseoperator= (const opt_intrusive_base &)
 
 opt_intrusive_base ()
 Construct object which is initially not reference counted. More...
 
virtual ~opt_intrusive_base ()
 
void ref () const
 
void unref () const
 

Public Attributes

unsigned _refs
 Reference count. More...
 

Protected Member Functions

void release () const
 Start reference counting. More...
 

Detailed Description

Base class for objects managed by opt_intrusive_ptr.

Definition at line 213 of file intrusive_ptr.h.

Constructor & Destructor Documentation

◆ opt_intrusive_base() [1/2]

Xapian::Internal::opt_intrusive_base::opt_intrusive_base ( const opt_intrusive_base )
inline

Definition at line 215 of file intrusive_ptr.h.

◆ opt_intrusive_base() [2/2]

Xapian::Internal::opt_intrusive_base::opt_intrusive_base ( )
inline

Construct object which is initially not reference counted.

The reference counting starts if release() is called.

Definition at line 226 of file intrusive_ptr.h.

◆ ~opt_intrusive_base()

virtual Xapian::Internal::opt_intrusive_base::~opt_intrusive_base ( )
inlinevirtual

Definition at line 231 of file intrusive_ptr.h.

Member Function Documentation

◆ operator=()

opt_intrusive_base& Xapian::Internal::opt_intrusive_base::operator= ( const opt_intrusive_base )
inline

Definition at line 217 of file intrusive_ptr.h.

◆ ref()

void Xapian::Internal::opt_intrusive_base::ref ( ) const
inline

Definition at line 233 of file intrusive_ptr.h.

References Xapian::Internal::intrusive_base::_refs.

◆ release()

void Xapian::Internal::opt_intrusive_base::release ( ) const
inlineprotected

Start reference counting.

The object is constructed with _refs set to 0, meaning it isn't being reference counted.

Calling release() sets _refs to 1 if it is 0, and from then opt_intrusive_ptr will increment and decrement _refs. If it is decremented to 1, the object is deleted.

Definition at line 262 of file intrusive_ptr.h.

◆ unref()

void Xapian::Internal::opt_intrusive_base::unref ( ) const
inline

Definition at line 240 of file intrusive_ptr.h.

References Xapian::Internal::intrusive_base::_refs.

Member Data Documentation

◆ _refs

unsigned Xapian::Internal::opt_intrusive_base::_refs
mutable

Reference count.

This needs to be mutable so we can add/remove references through const pointers.

Definition at line 250 of file intrusive_ptr.h.


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