B2BITS FIX Antenna C++  2.27.1
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. More...
 
virtual long getNRef () const throw ()
 Returns the current value of the reference counter. More...
 
 ReferenceCounter () throw ()
 Constructor. More...
 
virtual long release () const throw ()
 Decrements reference counter. More...
 

Protected Member Functions

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

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.