B2BITS FIX Antenna C++ 2.33.0
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
Utils::ReferenceCounter Class Reference

A generic reference counter. More...

#include <B2BITS_ReferenceCounter.h>

+ Inheritance diagram for Utils::ReferenceCounter:

Public Member Functions

virtual bool addRef () const throw ()
 Increments reference counter.
 
virtual long getNRef () const throw ()
 Returns the current value of the reference counter.
 
 ReferenceCounter () throw ()
 Constructor.
 
virtual long release () const throw ()
 Decrements reference counter.
 

Protected Member Functions

long decrement () const throw ()
 Decrements counter and returns new counter value.
 
long increment () const throw ()
 Increments counter and returns new counter value.
 
virtual ~ReferenceCounter ()
 Destructor.
 

Detailed Description

A generic reference counter.

Constructor & Destructor Documentation

◆ ReferenceCounter()

Utils::ReferenceCounter::ReferenceCounter ( )
throw ( )

Constructor.

◆ ~ReferenceCounter()

virtual Utils::ReferenceCounter::~ReferenceCounter ( )
protectedvirtual

Destructor.

Member Function Documentation

◆ addRef()

virtual bool Utils::ReferenceCounter::addRef ( ) const
throw ( )
virtual

Increments reference counter.

Returns
Return value should be ignored.

◆ decrement()

long Utils::ReferenceCounter::decrement ( ) const
throw ( )
protected

Decrements counter and returns new counter value.

◆ getNRef()

virtual long Utils::ReferenceCounter::getNRef ( ) const
throw ( )
virtual

Returns the current value of the reference counter.

◆ increment()

long Utils::ReferenceCounter::increment ( ) const
throw ( )
protected

Increments counter and returns new counter value.

◆ release()

virtual long Utils::ReferenceCounter::release ( ) const
throw ( )
virtual

Decrements reference counter.

If it becomes equal to 0 then calls destructor.

Returns
0 if there are no more references to this object; otherwise any positive value.