Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

RMCast_Receiver_Module.h

Go to the documentation of this file.
00001 /* -*- C++ -*- */
00002 // $Id: RMCast_Receiver_Module.h,v 1.1.1.1 2001/12/04 14:33:17 chad Exp $
00003 
00004 // ============================================================================
00005 //
00006 // = LIBRARY
00007 //    ace/RMCast
00008 //
00009 // = AUTHOR
00010 //    Carlos O'Ryan <coryan@uci.edu>
00011 //
00012 // ============================================================================
00013 
00014 #ifndef ACE_RMCAST_RECEIVER_MODULE_H
00015 #define ACE_RMCAST_RECEIVER_MODULE_H
00016 #include "ace/pre.h"
00017 
00018 #include "RMCast_Module.h"
00019 
00020 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00021 # pragma once
00022 #endif /* ACE_LACKS_PRAGMA_ONCE */
00023 
00024 /// Keep track of the receiver module.
00025 /**
00026  * A receiver proxy must reject invalid messages and communicate with
00027  * the sender to join and leave the multicast group.
00028  *
00029  * This module performs all the task related to 
00030  *
00031  */
00032 class ACE_RMCast_Export ACE_RMCast_Receiver_Module : public ACE_RMCast_Module
00033 {
00034 public:
00035   //! Constructor
00036   ACE_RMCast_Receiver_Module (void);
00037 
00038   //! Destructor
00039   virtual ~ACE_RMCast_Receiver_Module (void);
00040 
00041   virtual int data (ACE_RMCast::Data &);
00042   virtual int poll (ACE_RMCast::Poll &);
00043   virtual int ack_join (ACE_RMCast::Ack_Join &);
00044   virtual int ack_leave (ACE_RMCast::Ack_Leave &);
00045   virtual int ack (ACE_RMCast::Ack &);
00046   virtual int join (ACE_RMCast::Join &);
00047   virtual int leave (ACE_RMCast::Leave &);
00048 
00049   /// Simple enum used to describe the receiver state transitions
00050   /**
00051    * Receivers go through several states before they can fully accept
00052    * messages, the following comments describe those states, as well as
00053    * the possible transitions
00054    * This configuration is pesimistic, any invalid message is cause
00055    * enough to reclaim all the resources.  This partially addresses
00056    * situations where either accidentally or intentionally a sender is
00057    * multicasting packets to the wrong group.
00058 
00059    <CODE>
00060               NON_EXISTENT JOINING      JOINED       LEAVING<BR>
00061    ----------------------------------------------------------------<BR>
00062   <BR>
00063    DATA       JOINING      JOINING      JOINED       LEAVING<BR>
00064               Send/Join    Send/Join    Recv/Data    Send/Leave<BR>
00065   <BR>
00066    POLL       JOINING      JOINING      JOINED       LEAVING<BR>
00067               Send/Join    Send/Join    Send/Ack     Send/Leave<BR>
00068   <BR>
00069    ACK_JOIN   JOINING      JOINED       JOINED       LEAVING<BR>
00070               Send/Join    Receive Msg  Receive Msg  Send/Leave<BR>
00071   <BR>
00072    ACK_LEAVE  NON_EXISTENT NON_EXISTENT NON_EXISTENT NON_EXISTENT<BR>
00073               Noop         Destroy      Destroy      Destroy<BR>
00074   <BR>
00075    ACK        NON_EXISTENT NON_EXISTENT NON_EXISTENT NON_EXISTENT<BR>
00076               Noop         Destroy      Destroy      Destroy<BR>
00077   <BR>
00078    JOIN       NON_EXISTENT NON_EXISTENT NON_EXISTENT NON_EXISTENT<BR>
00079               Noop         Destroy      Destroy      Destroy<BR>
00080   <BR>
00081    LEAVE      NON_EXISTENT NON_EXISTENT NON_EXISTENT NON_EXISTENT<BR>
00082               Noop         Destroy      Destroy      Destroy<BR>
00083   <BR>
00084   </CODE>
00085   */
00086   enum Receiver_State
00087   {
00088     RS_NON_EXISTENT,
00089     RS_JOINING,
00090     RS_JOINED,
00091     RS_LEAVING
00092   };
00093 
00094 private:
00095   /// Enter the leaving state, prepare for termination
00096   void leaving (ACE_RMCast_Proxy *proxy);
00097 
00098 private:
00099   /// The current state of the receiver
00100   int state_;
00101 };
00102 
00103 #if defined (__ACE_INLINE__)
00104 #include "RMCast_Receiver_Module.i"
00105 #endif /* __ACE_INLINE__ */
00106 
00107 #include "ace/post.h"
00108 #endif /* ACE_RMCAST_RECEIVER_MODULE_H */

Generated on Mon Jun 16 13:12:37 2003 for ACE_RMCast by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002