TAO_ESF_Immediate_Changes< PROXY, COLLECTION, ITERATOR, ACE_LOCK > Class Template Reference

Implement the Immediate_Changes strategy. More...

#include <ESF_Immediate_Changes.h>

Inheritance diagram for TAO_ESF_Immediate_Changes< PROXY, COLLECTION, ITERATOR, ACE_LOCK >:

Inheritance graph
[legend]
Collaboration diagram for TAO_ESF_Immediate_Changes< PROXY, COLLECTION, ITERATOR, ACE_LOCK >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TAO_ESF_Immediate_Changes (void)
 TAO_ESF_Immediate_Changes (const COLLECTION &collection)
virtual void for_each (TAO_ESF_Worker< PROXY > *worker)
virtual void connected (PROXY *proxy)
virtual void reconnected (PROXY *proxy)
virtual void disconnected (PROXY *proxy)
 Remove an element from the collection.
virtual void shutdown (void)
 The EC is shutting down, must release all the elements.

Private Attributes

COLLECTION collection_
ACE_LOCK lock_

Detailed Description

template<class PROXY, class COLLECTION, class ITERATOR, class ACE_LOCK>
class TAO_ESF_Immediate_Changes< PROXY, COLLECTION, ITERATOR, ACE_LOCK >

Implement the Immediate_Changes strategy.

Definition at line 30 of file ESF_Immediate_Changes.h.


Constructor & Destructor Documentation

template<class PROXY, class C, class ITERATOR, class ACE_LOCK>
TAO_BEGIN_VERSIONED_NAMESPACE_DECL TAO_ESF_Immediate_Changes< PROXY, C, ITERATOR, ACE_LOCK >::TAO_ESF_Immediate_Changes ( void   ) 

Definition at line 20 of file ESF_Immediate_Changes.cpp.

00021 {
00022 }

template<class PROXY, class C, class ITERATOR, class ACE_LOCK>
TAO_ESF_Immediate_Changes< PROXY, C, ITERATOR, ACE_LOCK >::TAO_ESF_Immediate_Changes ( const COLLECTION &  collection  ) 

Definition at line 26 of file ESF_Immediate_Changes.cpp.

00027       :  collection_ (collection)
00028 {
00029 }


Member Function Documentation

template<class PROXY, class COLLECTION, class ITERATOR, class ACE_LOCK>
TAO_BEGIN_VERSIONED_NAMESPACE_DECL void TAO_ESF_Immediate_Changes< PROXY, COLLECTION, ITERATOR, ACE_LOCK >::connected ( PROXY *  proxy  )  [virtual]

Insert a new element into the collection. The collection assumes ownership of the element.

Implements TAO_ESF_Proxy_Collection< PROXY >.

Definition at line 9 of file ESF_Immediate_Changes.inl.

References ACE_GUARD, and TAO_ESF_Immediate_Changes< PROXY, COLLECTION, ITERATOR, ACE_LOCK >::collection_.

00010 {
00011   ACE_GUARD (ACE_LOCK, ace_mon, this->lock_);
00012 
00013   proxy->_incr_refcnt ();
00014   this->collection_.connected (proxy);
00015 }

template<class PROXY, class COLLECTION, class ITERATOR, class ACE_LOCK>
void TAO_ESF_Immediate_Changes< PROXY, COLLECTION, ITERATOR, ACE_LOCK >::disconnected ( PROXY *  proxy  )  [virtual]

Remove an element from the collection.

Implements TAO_ESF_Proxy_Collection< PROXY >.

Definition at line 29 of file ESF_Immediate_Changes.inl.

References ACE_GUARD, and TAO_ESF_Immediate_Changes< PROXY, COLLECTION, ITERATOR, ACE_LOCK >::collection_.

00030 {
00031   ACE_GUARD (ACE_LOCK, ace_mon, this->lock_);
00032 
00033   this->collection_.disconnected (proxy);
00034 }

template<class PROXY, class C, class ITERATOR, class ACE_LOCK>
void TAO_ESF_Immediate_Changes< PROXY, C, ITERATOR, ACE_LOCK >::for_each ( TAO_ESF_Worker< PROXY > *  worker  )  [virtual]

Iterate over the collection and invoke worker->work() for each member of the collection. This encapsulates

Implements TAO_ESF_Proxy_Collection< PROXY >.

Definition at line 33 of file ESF_Immediate_Changes.cpp.

References ACE_GUARD, TAO_ESF_Immediate_Changes< PROXY, COLLECTION, ITERATOR, ACE_LOCK >::collection_, TAO_ESF_Worker< Object >::set_size(), and TAO_ESF_Worker< Object >::work().

00034 {
00035   ACE_GUARD (ACE_LOCK, ace_mon, this->lock_);
00036 
00037   worker->set_size(this->collection_.size());
00038   ITERATOR end = this->collection_.end ();
00039   for (ITERATOR i = this->collection_.begin (); i != end; ++i)
00040     {
00041       worker->work ((*i));
00042     }
00043 }

template<class PROXY, class COLLECTION, class ITERATOR, class ACE_LOCK>
void TAO_ESF_Immediate_Changes< PROXY, COLLECTION, ITERATOR, ACE_LOCK >::reconnected ( PROXY *  proxy  )  [virtual]

Insert an element into the collection. No errors can be raised if the element is already present. The collection assumes ownership, i.e. must invoke <proxy->_decr_refcnt()> if the element is already present in the collection.

Implements TAO_ESF_Proxy_Collection< PROXY >.

Definition at line 19 of file ESF_Immediate_Changes.inl.

References ACE_GUARD, and TAO_ESF_Immediate_Changes< PROXY, COLLECTION, ITERATOR, ACE_LOCK >::collection_.

00020 {
00021   ACE_GUARD (ACE_LOCK, ace_mon, this->lock_);
00022 
00023   proxy->_incr_refcnt ();
00024   this->collection_.reconnected (proxy);
00025 }

template<class PROXY, class COLLECTION, class ITERATOR, class ACE_LOCK>
void TAO_ESF_Immediate_Changes< PROXY, COLLECTION, ITERATOR, ACE_LOCK >::shutdown ( void   )  [virtual]

The EC is shutting down, must release all the elements.

Implements TAO_ESF_Proxy_Collection< PROXY >.

Definition at line 37 of file ESF_Immediate_Changes.inl.

References ACE_GUARD, and TAO_ESF_Immediate_Changes< PROXY, COLLECTION, ITERATOR, ACE_LOCK >::collection_.

00038 {
00039   ACE_GUARD (ACE_LOCK, ace_mon, this->lock_);
00040 
00041   this->collection_.shutdown ();
00042 }


Member Data Documentation

template<class PROXY, class COLLECTION, class ITERATOR, class ACE_LOCK>
COLLECTION TAO_ESF_Immediate_Changes< PROXY, COLLECTION, ITERATOR, ACE_LOCK >::collection_ [private]

Definition at line 44 of file ESF_Immediate_Changes.h.

Referenced by TAO_ESF_Immediate_Changes< PROXY, COLLECTION, ITERATOR, ACE_LOCK >::connected(), TAO_ESF_Immediate_Changes< PROXY, COLLECTION, ITERATOR, ACE_LOCK >::disconnected(), TAO_ESF_Immediate_Changes< PROXY, COLLECTION, ITERATOR, ACE_LOCK >::for_each(), TAO_ESF_Immediate_Changes< PROXY, COLLECTION, ITERATOR, ACE_LOCK >::reconnected(), and TAO_ESF_Immediate_Changes< PROXY, COLLECTION, ITERATOR, ACE_LOCK >::shutdown().

template<class PROXY, class COLLECTION, class ITERATOR, class ACE_LOCK>
ACE_LOCK TAO_ESF_Immediate_Changes< PROXY, COLLECTION, ITERATOR, ACE_LOCK >::lock_ [private]

Definition at line 46 of file ESF_Immediate_Changes.h.


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