TAO_ESF_Proxy_List< PROXY > Class Template Reference

A concrete proxy collection. More...

#include <ESF_Proxy_List.h>

Collaboration diagram for TAO_ESF_Proxy_List< PROXY >:

Collaboration graph
[legend]
List of all members.

Public Types

typedef ACE_Unbounded_Set<
PROXY * > 
Implementation
 A typedef for the underlying implementaiton class.
typedef ACE_Unbounded_Set_Iterator<
PROXY * > 
Iterator
 A typedef for the underlying iterator.

Public Member Functions

 TAO_ESF_Proxy_List (void)
 Constructor.
ACE_Unbounded_Set_Iterator<
PROXY * > 
begin (void)
ACE_Unbounded_Set_Iterator<
PROXY * > 
end (void)
 Return one past the last element in the collection.
size_t size (void) const
 Return the number of elements in the collection.
void connected (PROXY *)
 Insert a new element to the collection.
void reconnected (PROXY *)
 Insert a new element that could be there already.
void disconnected (PROXY *)
 Remove an element from the collection.
void shutdown (void)

Private Attributes

ACE_Unbounded_Set< PROXY * > impl_
 The underlying implementation object.

Detailed Description

template<class PROXY>
class TAO_ESF_Proxy_List< PROXY >

A concrete proxy collection.

Based on the ACE_Unbounded_Set<> collection, used a double linked list internally.

Definition at line 31 of file ESF_Proxy_List.h.


Member Typedef Documentation

template<class PROXY>
typedef ACE_Unbounded_Set<PROXY*> TAO_ESF_Proxy_List< PROXY >::Implementation

A typedef for the underlying implementaiton class.

Definition at line 35 of file ESF_Proxy_List.h.

template<class PROXY>
typedef ACE_Unbounded_Set_Iterator<PROXY*> TAO_ESF_Proxy_List< PROXY >::Iterator

A typedef for the underlying iterator.

Definition at line 38 of file ESF_Proxy_List.h.


Constructor & Destructor Documentation

template<class PROXY>
TAO_BEGIN_VERSIONED_NAMESPACE_DECL TAO_ESF_Proxy_List< PROXY >::TAO_ESF_Proxy_List ( void   ) 

Constructor.

Definition at line 15 of file ESF_Proxy_List.cpp.

00016 {
00017 }


Member Function Documentation

template<class PROXY>
TAO_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE ACE_Unbounded_Set_Iterator< PROXY * > TAO_ESF_Proxy_List< PROXY >::begin ( void   ) 

Return the first element in the collection, or end() if there are none

Definition at line 8 of file ESF_Proxy_List.inl.

References ACE_Unbounded_Set_Ex< T, C >::begin(), and TAO_ESF_Proxy_List< PROXY >::impl_.

00009 {
00010   return this->impl_.begin ();
00011 }

template<class PROXY>
void TAO_ESF_Proxy_List< PROXY >::connected ( PROXY *   ) 

Insert a new element to the collection.

Definition at line 20 of file ESF_Proxy_List.cpp.

References TAO_ESF_Proxy_List< PROXY >::impl_, and ACE_Unbounded_Set_Ex< T, C >::insert().

00021 {
00022   int r = this->impl_.insert (proxy);
00023   if (r == 0)
00024     return;
00025 
00026   if (r == 1)
00027     {
00028       // @@ Already there, throw some user exception..
00029       proxy->_decr_refcnt ();
00030     }
00031   if (r == -1)
00032     {
00033       // @@ Cannot insert, running out of memory? throw some other
00034       // user exception
00035       proxy->_decr_refcnt ();
00036     }
00037 }

template<class PROXY>
void TAO_ESF_Proxy_List< PROXY >::disconnected ( PROXY *   ) 

Remove an element from the collection.

Definition at line 64 of file ESF_Proxy_List.cpp.

References TAO_ESF_Proxy_List< PROXY >::impl_, and ACE_Unbounded_Set_Ex< T, C >::remove().

00065 {
00066   int r = this->impl_.remove (proxy);
00067   if (r != 0)
00068     {
00069       // @@ Cannot remove, throw some other
00070       // user exception
00071       return;
00072     }
00073   proxy->_decr_refcnt ();
00074 }

template<class PROXY>
ACE_INLINE ACE_Unbounded_Set_Iterator< PROXY * > TAO_ESF_Proxy_List< PROXY >::end ( void   ) 

Return one past the last element in the collection.

Definition at line 14 of file ESF_Proxy_List.inl.

References ACE_Unbounded_Set_Ex< T, C >::end(), and TAO_ESF_Proxy_List< PROXY >::impl_.

Referenced by TAO_ESF_Proxy_List< PROXY >::shutdown().

00015 {
00016   return this->impl_.end ();
00017 }

template<class PROXY>
void TAO_ESF_Proxy_List< PROXY >::reconnected ( PROXY *   ) 

Insert a new element that could be there already.

Definition at line 40 of file ESF_Proxy_List.cpp.

References TAO_ESF_Proxy_List< PROXY >::impl_, and ACE_Unbounded_Set_Ex< T, C >::insert().

00041 {
00042   int r = this->impl_.insert (proxy);
00043   if (r == 0)
00044     return;
00045 
00046   if (r == 1)
00047     {
00048       // Reference count is incremented by the callers to [re]connected.
00049       // @@ Find out if the protocol could be simplified, and decoupling
00050       //    increased.
00051       proxy->_decr_refcnt ();
00052       return;
00053     }
00054 
00055   if (r == -1)
00056     {
00057       // @@ Cannot insert, running out of memory? throw some other
00058       // user exception
00059       proxy->_decr_refcnt ();
00060     }
00061 }

template<class PROXY>
void TAO_ESF_Proxy_List< PROXY >::shutdown ( void   ) 

Shutdown the collection, i.e. remove all elements and release resources

Definition at line 77 of file ESF_Proxy_List.cpp.

References ACE_Unbounded_Set_Ex< T, C >::end(), TAO_ESF_Proxy_List< PROXY >::end(), TAO_ESF_Proxy_List< PROXY >::impl_, and ACE_Unbounded_Set_Ex< T, C >::reset().

00078 {
00079   Iterator end = this->impl_.end ();
00080   for (Iterator i = this->impl_.begin (); i != end; ++i)
00081     {
00082       // Decrement reference count
00083       (*i)->_decr_refcnt ();
00084     }
00085   this->impl_.reset ();
00086 }

template<class PROXY>
ACE_INLINE size_t TAO_ESF_Proxy_List< PROXY >::size ( void   )  const

Return the number of elements in the collection.

Definition at line 20 of file ESF_Proxy_List.inl.

References TAO_ESF_Proxy_List< PROXY >::impl_, and ACE_Unbounded_Set_Ex< T, C >::size().

00021 {
00022   return this->impl_.size ();
00023 }


Member Data Documentation

template<class PROXY>
ACE_Unbounded_Set<PROXY*> TAO_ESF_Proxy_List< PROXY >::impl_ [private]

The underlying implementation object.

Definition at line 68 of file ESF_Proxy_List.h.

Referenced by TAO_ESF_Proxy_List< PROXY >::begin(), TAO_ESF_Proxy_List< PROXY >::connected(), TAO_ESF_Proxy_List< PROXY >::disconnected(), TAO_ESF_Proxy_List< PROXY >::end(), TAO_ESF_Proxy_List< PROXY >::reconnected(), TAO_ESF_Proxy_List< PROXY >::shutdown(), and TAO_ESF_Proxy_List< PROXY >::size().


The documentation for this class was generated from the following files:
Generated on Tue Feb 2 17:43:51 2010 for TAO_ESF by  doxygen 1.4.7