Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

TAO_Notify_Refcountable Class Reference

Thread-safe refounting, calls the <release> method when refcount falls to 0. More...

#include <Refcountable.h>

Inheritance diagram for TAO_Notify_Refcountable:

Inheritance graph
[legend]
Collaboration diagram for TAO_Notify_Refcountable:

Collaboration graph
[legend]
List of all members.

Public Types

typedef TAO_Notify_Refcountable_Guard_T<
TAO_Notify_Refcountable
Ptr
typedef long Counter

Public Member Functions

 TAO_Notify_Refcountable (void)
 Constuctor.
virtual ~TAO_Notify_Refcountable ()
CORBA::ULong _incr_refcnt (void)
CORBA::ULong _decr_refcnt (void)

Protected Attributes

TAO_SYNCH_MUTEX lock_
 The mutex to serialize access to state variables.

Private Member Functions

virtual void release (void)=0
 The release method is called when the refcount reaches 0.

Private Attributes

ACE_Atomic_Op< TAO_SYNCH_MUTEX,
Counter
refcount_

Detailed Description

Thread-safe refounting, calls the <release> method when refcount falls to 0.

The refcount is initialized to 0. When an instance of a derived class becomes owned by a managed pointer (Refcountable_Guard_T) the reference count becomes non-zero. A debug message is printed from the destructor if a refcounted is deleted with a non-zero refcount.

Instances declared on the stack should always have a refcount of zero.

A method that creates or simply returns an instance of Refcountable should not increment the reference count. It is the responsibility of the client to increment the reference count (take ownership or guard against deletion). The client cannot know if the method will or will not incr the refcount in its behalf.

Use Refcountable_Guard_T or similar service to guarantee the exception safe direct pairing of increments and decrements. Avoid calling _incr_refcnt and _decr_refcnt.


Member Typedef Documentation

typedef long TAO_Notify_Refcountable::Counter
 

typedef TAO_Notify_Refcountable_Guard_T< TAO_Notify_Refcountable > TAO_Notify_Refcountable::Ptr
 

Reimplemented in TAO_Notify_ConsumerAdmin, TAO_Notify_Event, TAO_Notify_Event_Manager, TAO_Notify_EventChannel, TAO_Notify_EventChannelFactory, TAO_Notify_Proxy, TAO_Notify_ProxyConsumer, TAO_Notify_ProxySupplier, TAO_Notify_SupplierAdmin, TAO_Notify_Timer, TAO_Notify_Timer_Queue, TAO_Notify_Timer_Reactor, and TAO_Notify_Worker_Task.


Constructor & Destructor Documentation

TAO_Notify_Refcountable::TAO_Notify_Refcountable void   ) 
 

Constuctor.

TAO_Notify_Refcountable::~TAO_Notify_Refcountable  )  [virtual]
 

Destructor public for stack allocated instances


Member Function Documentation

CORBA::ULong TAO_Notify_Refcountable::_decr_refcnt void   ) 
 

CORBA::ULong TAO_Notify_Refcountable::_incr_refcnt void   ) 
 

This method sigantures deliberately match the RefCounting methods required for ESF Proxy Public for bridge implementations and various guard classes

virtual void TAO_Notify_Refcountable::release void   )  [private, pure virtual]
 

The release method is called when the refcount reaches 0.

Implemented in TAO_Notify_ConsumerAdmin, TAO_Notify_Event, TAO_Notify_Event_Manager, TAO_Notify_EventChannel, TAO_Notify_EventChannelFactory, TAO_Notify_EventTypeSeq, TAO_Notify_FilterAdmin, TAO_Notify_Reactive_Task, TAO_Notify::Reconnection_Registry, TAO_Notify_SupplierAdmin, TAO_Notify_ThreadPool_Task, TAO_Notify_Timer_Queue, and TAO_Notify_Timer_Reactor.


Member Data Documentation

TAO_SYNCH_MUTEX TAO_Notify_Refcountable::lock_ [protected]
 

The mutex to serialize access to state variables.

Reimplemented in TAO_Notify_FilterAdmin.

ACE_Atomic_Op< TAO_SYNCH_MUTEX, Counter > TAO_Notify_Refcountable::refcount_ [private]
 


The documentation for this class was generated from the following files:
Generated on Sat Aug 6 03:35:37 2005 for TAO_CosNotification by  doxygen 1.3.9.1