Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

TAO_LF_Follower Class Reference

Represent a thread blocked, as a follower, in the Leader/Followers set. More...

#include <LF_Follower.h>

Inheritance diagram for TAO_LF_Follower:

Inheritance graph
[legend]
Collaboration diagram for TAO_LF_Follower:

Collaboration graph
[legend]
List of all members.

Public Methods

 TAO_LF_Follower (TAO_Leader_Follower &leader_follower)
 Constructor. More...

 ~TAO_LF_Follower (void)
 Destructor. More...

TAO_Leader_Followerleader_follower (void)
 Access the leader follower that owns this follower. More...

int wait (ACE_Time_Value *tv)
 Wait until on the underlying condition variable. More...

int signal (void)
 Signal the underlying condition variable. More...


Private Attributes

TAO_Leader_Followerleader_follower_
 The Leader/Follower set this Follower belongs to. More...

ACE_SYNCH_CONDITION condition_
 Condition variable used to. More...


Detailed Description

Represent a thread blocked, as a follower, in the Leader/Followers set.

Todo:
Currently this class offers little abstraction, the follower loop should be implemented by this class.

Definition at line 38 of file LF_Follower.h.


Constructor & Destructor Documentation

TAO_LF_Follower::TAO_LF_Follower TAO_Leader_Follower   leader_follower
 

Constructor.

Definition at line 14 of file LF_Follower.cpp.

00015   : leader_follower_ (leader_follower)
00016   , condition_ (leader_follower.lock ())
00017 {
00018 }

TAO_LF_Follower::~TAO_LF_Follower void   
 

Destructor.

Definition at line 20 of file LF_Follower.cpp.

00021 {
00022 }


Member Function Documentation

ACE_INLINE TAO_Leader_Follower & TAO_LF_Follower::leader_follower void   
 

Access the leader follower that owns this follower.

Definition at line 4 of file LF_Follower.inl.

References leader_follower_.

Referenced by TAO_LF_Event::state_changed.

00005 {
00006   return this->leader_follower_;
00007 }

int TAO_LF_Follower::signal void   
 

Signal the underlying condition variable.

Definition at line 25 of file LF_Follower.cpp.

References condition_, leader_follower_, and TAO_Leader_Follower::remove_follower.

Referenced by TAO_Leader_Follower::elect_new_leader_i, and TAO_LF_Event::state_changed.

00026 {
00027   // We *must* remove ourselves from the list of followers, otherwise
00028   // we could get signalled twice: to wake up as a follower and as the
00029   // next leader.
00030   // The follower may not be there if the reply is received while
00031   // the consumer is not yet waiting for it (i.e. it send the
00032   // request but has not blocked to receive the reply yet).
00033   // Ignore errors.
00034   (void) this->leader_follower_.remove_follower (this);
00035 
00036   return this->condition_.signal ();
00037 }

ACE_INLINE int TAO_LF_Follower::wait ACE_Time_Value   tv
 

Wait until on the underlying condition variable.

Definition at line 10 of file LF_Follower.inl.

References condition_.

00011 {
00012   return this->condition_.wait (tv);
00013 }


Member Data Documentation

ACE_SYNCH_CONDITION TAO_LF_Follower::condition_ [private]
 

Condition variable used to.

Definition at line 61 of file LF_Follower.h.

Referenced by signal, and wait.

TAO_Leader_Follower& TAO_LF_Follower::leader_follower_ [private]
 

The Leader/Follower set this Follower belongs to.

Definition at line 58 of file LF_Follower.h.

Referenced by leader_follower, and signal.


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 15:26:23 2003 for TAO by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002