EPAM B2BITS CME MDP Handler C++  5.4.2
Public Member Functions | Protected Member Functions | List of all members
Cme::Mdp::ReferenceCounter Class Reference

#include <B2BITS_CmeMdpReferenceCounter.h>

Inheritance diagram for Cme::Mdp::ReferenceCounter:
Inheritance graph
[legend]

Public Member Functions

 ReferenceCounter () throw ()
 
virtual bool addRef () const throw ()
 
virtual long release () const throw ()
 
virtual long getNRef () const throw ()
 

Protected Member Functions

virtual ~ReferenceCounter ()
 
long decrement () const throw ()
 
long increment () const throw ()
 

Detailed Description

A generic reference counter.

See also
RefCounterPtr.

Constructor & Destructor Documentation

Cme::Mdp::ReferenceCounter::ReferenceCounter ( )
throw (
)

Constructor.

virtual Cme::Mdp::ReferenceCounter::~ReferenceCounter ( )
protectedvirtual

Destructor.

Member Function Documentation

virtual bool Cme::Mdp::ReferenceCounter::addRef ( ) const
throw (
)
virtual

Increments reference counter.

Returns
Return value should be ignored.
long Cme::Mdp::ReferenceCounter::decrement ( ) const
throw (
)
protected

Decrements counter and returns new counter value.

virtual long Cme::Mdp::ReferenceCounter::getNRef ( ) const
throw (
)
virtual

Returns the current value of the reference counter.

long Cme::Mdp::ReferenceCounter::increment ( ) const
throw (
)
protected

Increments counter and returns new counter value.

virtual long Cme::Mdp::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.