TAO_Notify_ID_Factory Class Reference

A simple factory for generating ID's for objects created by Notify. More...

#include <ID_Factory.h>

List of all members.

Public Member Functions

 TAO_Notify_ID_Factory (void)
 Constructor.
 ~TAO_Notify_ID_Factory ()
 Destructor.
TAO_Notify_Object::ID id (void)
void set_last_used (const TAO_Notify_Object::ID id)

Private Attributes

TAO_Notify_Object::ID seed_
 Can't use atomic op, because we added the set_last_used() method.
TAO_SYNCH_MUTEX mtx_


Detailed Description

A simple factory for generating ID's for objects created by Notify.

Definition at line 35 of file ID_Factory.h.


Constructor & Destructor Documentation

TAO_BEGIN_VERSIONED_NAMESPACE_DECL TAO_Notify_ID_Factory::TAO_Notify_ID_Factory ( void   ) 

Constructor.

Definition at line 13 of file ID_Factory.cpp.

00014   : seed_ (0)
00015 {
00016 }

TAO_Notify_ID_Factory::~TAO_Notify_ID_Factory (  ) 

Destructor.

Definition at line 18 of file ID_Factory.cpp.

00019 {
00020 }


Member Function Documentation

TAO_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE TAO_Notify_Object::ID TAO_Notify_ID_Factory::id ( void   ) 

Definition at line 8 of file ID_Factory.inl.

References ACE_GUARD_RETURN, seed_, and TAO_SYNCH_MUTEX.

Referenced by TAO_Notify_POA_Helper::activate(), TAO_Notify_FilterAdmin::add_filter(), and TAO_Notify_POA_Helper::get_unique_id().

00009 {
00010   ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->mtx_, 0);
00011   return ++seed_;
00012 }

ACE_INLINE void TAO_Notify_ID_Factory::set_last_used ( const TAO_Notify_Object::ID  id  ) 

Definition at line 15 of file ID_Factory.inl.

References ACE_GUARD, seed_, and TAO_SYNCH_MUTEX.

Referenced by TAO_Notify_POA_Helper::activate_with_id(), and TAO_Notify_FilterAdmin::load_child().

00016 {
00017   ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->mtx_);
00018   if (this->seed_ < id)
00019   {
00020     this->seed_ = id;
00021   }
00022 }


Member Data Documentation

TAO_SYNCH_MUTEX TAO_Notify_ID_Factory::mtx_ [private]

Definition at line 51 of file ID_Factory.h.

TAO_Notify_Object::ID TAO_Notify_ID_Factory::seed_ [private]

Can't use atomic op, because we added the set_last_used() method.

Definition at line 50 of file ID_Factory.h.

Referenced by id(), and set_last_used().


The documentation for this class was generated from the following files:
Generated on Tue Feb 2 17:46:20 2010 for TAO_CosNotification by  doxygen 1.4.7