Event_Map_T.inl

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // $Id: Event_Map_T.inl 78005 2007-04-12 19:14:05Z elliott_c $
00004 
00005 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00006 
00007 template <class PROXY, class ACE_LOCK> ACE_INLINE  TAO_Notify_Event_Map_Entry_T<PROXY>*
00008 TAO_Notify_Event_Map_T<PROXY, ACE_LOCK>::find (const TAO_Notify_EventType& event_type)
00009 {
00010   TAO_Notify_Event_Map_Entry_T<PROXY>* entry = 0;
00011 
00012   ACE_READ_GUARD_RETURN (ACE_LOCK, ace_mon, this->lock_, 0);
00013 
00014   if (map_.find (event_type, entry) == 0)
00015     {
00016       entry->_incr_refcnt ();
00017       return entry;
00018     }
00019   else
00020     {
00021       // The event_type that we have doesn't hash directly to a particular
00022       // entry.  So, we need to iterate through the map and see if any of
00023       // the event type keys are equivalent to event_type.
00024       typedef ACE_Hash_Map_Iterator_Ex <TAO_Notify_EventType, ENTRY*,
00025                                         ACE_Hash<TAO_Notify_EventType>,
00026                                         ACE_Equal_To<TAO_Notify_EventType>,
00027                                         ACE_SYNCH_NULL_MUTEX>
00028               Iterator_Type;
00029       Iterator_Type end = this->map_.end ();
00030       for(Iterator_Type i = this->map_.begin (); i != end; ++i)
00031         {
00032           if ((*i).ext_id_ == event_type)
00033             {                            
00034               entry = (*i).int_id_;
00035               entry->_incr_refcnt ();
00036               return entry;
00037             }
00038         }
00039     }
00040 
00041   return 0;
00042 }
00043 
00044 template <class PROXY, class ACE_LOCK> ACE_INLINE void
00045 TAO_Notify_Event_Map_T<PROXY, ACE_LOCK>::release (ENTRY* entry)
00046 {
00047   ACE_WRITE_GUARD (ACE_LOCK, ace_mon, this->lock_);
00048 
00049   if (entry->_decr_refcnt () == 0)
00050     delete entry;
00051 }
00052 
00053 template <class PROXY, class ACE_LOCK>  ACE_INLINE  typename TAO_Notify_Event_Map_Entry_T<PROXY>::COLLECTION*
00054 TAO_Notify_Event_Map_T<PROXY, ACE_LOCK>::broadcast_collection (void)
00055 {
00056   return this->broadcast_entry_.collection ();
00057 }
00058 
00059 template <class PROXY, class ACE_LOCK>  ACE_INLINE  typename TAO_Notify_Event_Map_Entry_T<PROXY>::COLLECTION*
00060 TAO_Notify_Event_Map_T<PROXY, ACE_LOCK>::updates_collection (void)
00061 {
00062   return this->updates_entry_.collection ();
00063 }
00064 
00065 template <class PROXY, class ACE_LOCK> ACE_INLINE int
00066 TAO_Notify_Event_Map_T<PROXY, ACE_LOCK>::proxy_count (void)
00067 {
00068   return this->proxy_count_;
00069 }
00070 
00071 template <class PROXY, class ACE_LOCK> ACE_INLINE const TAO_Notify_EventTypeSeq&
00072 TAO_Notify_Event_Map_T<PROXY, ACE_LOCK>::event_types (void)
00073 {
00074   return this->event_types_;
00075 }
00076 
00077 TAO_END_VERSIONED_NAMESPACE_DECL

Generated on Tue Feb 2 17:45:29 2010 for TAO_CosNotification by  doxygen 1.4.7