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

QoS_Session_Impl.h

Go to the documentation of this file.
00001 /* -*- C++ -*- */
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    QoS_Session_Impl.h
00006  *
00007  *  $Id: QoS_Session_Impl.h,v 1.1.1.2 2003/02/21 18:36:32 chad Exp $
00008  *
00009  *  @author Vishal Kachroo <vishal@cs.wustl.edu>
00010  */
00011 //=============================================================================
00012 
00013 
00014 #ifndef ACE_QOS_SESSION_IMPL_H
00015 #define ACE_QOS_SESSION_IMPL_H
00016 #include "ace/pre.h"
00017 
00018 #include "ace/QoS/QoS_Session.h"
00019 
00020 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00021 # pragma once
00022 #endif /* ACE_LACKS_PRAGMA_ONCE */
00023 
00024 
00025 #if defined (ACE_HAS_RAPI)
00026 #include "rapi_lib.h"
00027 
00028 #define DEFAULT_SOURCE_SENDER_PORT 10001
00029 
00030 /**
00031  * @class ACE_RAPI_Session
00032  *
00033  * @brief A RAPI QoS session object.
00034  *
00035  * This class is a RAPI (RSVP API, an implementation of RSVP on UNIX)
00036  * implementation of the ACE_QoS_Session interface.
00037  */
00038 class ACE_QoS_Export ACE_RAPI_Session : public ACE_QoS_Session
00039 {
00040 
00041 public:
00042 
00043   /// Default destructor.
00044   ~ACE_RAPI_Session (void);
00045 
00046   /// Error handling for RSVP callback
00047   static int rsvp_error;
00048 
00049   /// Open a RAPI QoS session [dest IP, dest port, Protocol ID].
00050   virtual int open (ACE_INET_Addr dest_addr,
00051                     ACE_Protocol_ID protocol_id);
00052 
00053   /// Close the RAPI QoS Session.
00054   virtual int close (void);
00055 
00056   /// Returns the QoS for this RAPI session.
00057   virtual ACE_QoS qos (void) const;
00058 
00059   /// Set QoS for this RAPI session. The socket parameter is used to confirm if
00060   /// this QoS session was subscribed to by the socket.
00061   virtual int qos (ACE_SOCK *socket,
00062                    ACE_QoS_Manager *qos_manager,
00063                    const ACE_QoS &ace_qos);
00064 
00065   /**
00066    * Sets the QoS for this session object to ace_qos. Does not interfere with the
00067    * QoS in the underlying socket. This call is useful to update the QoS object
00068    * when the underlying socket QoS is being set through a mechanism other than
00069    * the previous qos () method e.g. inside the dgram_mcast.subscribe () where the
00070    * QoS for the socket is set through ACE_OS::join_leaf ().
00071    */
00072   virtual void qos (const ACE_QoS &ace_qos);
00073 
00074   /**
00075    * Calls rapi_dispatch () that further triggers the call back function.
00076    * It is a mechanism of updating the QoS for this session asynchronously, as
00077    * RSVP events occur.
00078    */
00079   virtual int update_qos (void);
00080 
00081   /// Get methods for the flags_.
00082   virtual ACE_End_Point_Type flags (void) const;
00083 
00084   /// Set methods for the flags_.
00085   virtual void flags (const ACE_End_Point_Type flags);
00086 
00087   /// Get the RAPI session id.
00088   virtual int session_id (void) const;
00089 
00090   /// Set the RAPI session id.
00091   virtual void session_id (const int session_id);
00092 
00093   /// Get the RAPI file descriptor for RSVP events.
00094   virtual ACE_HANDLE rsvp_events_handle (void);
00095 
00096   ///Set the RAPI event that last occured
00097   virtual void  rsvp_event_type (RSVP_Event_Type event_type);
00098 
00099   ///Get the RAPI event that last occured
00100   virtual RSVP_Event_Type rsvp_event_type (void);
00101 
00102   /// Get the destination address for this RAPI session.
00103   virtual ACE_INET_Addr dest_addr (void) const;
00104 
00105   /// Set the destination address for this RAPI session.
00106   virtual void dest_addr (const ACE_INET_Addr &dest_addr);
00107 
00108   /// Get the source port for this session.
00109   virtual u_short source_port (void) const;
00110 
00111   /// Set the source port for this session.
00112   virtual void source_port (const u_short &source_port);
00113 
00114   /// RAPI version. Returned value = 100 * major-version + minor-version.
00115   virtual int version ();
00116 
00117   /// The factory is a friend so it can create this object through
00118   /// the only private constructor.
00119   friend class ACE_QoS_Session_Factory;
00120 
00121 private:
00122 
00123   /// Default constuctor. Constructor is defined private so that only
00124   /// the friend factory can instantiate this class.
00125   ACE_RAPI_Session (void);
00126 
00127   /// Construct a simplified RAPI Sender TSpec object
00128   /// from an ACE_Flow_Spec object. Used internally by this class.
00129   rapi_tspec_t *init_tspec_simplified (const ACE_Flow_Spec &flow_spec);
00130 
00131   /// Construct a simplified RAPI Receiver FlowSpec object
00132   /// from an ACE_Flow_Spec object. Used internally by the class.
00133   rapi_flowspec_t *init_flowspec_simplified(const ACE_Flow_Spec &flow_spec);
00134 
00135   /// Set sending QoS for this RAPI session.
00136   int sending_qos (const ACE_QoS &ace_qos);
00137 
00138   /// Set receiving  QoS for this RAPI session.
00139   int receiving_qos (const ACE_QoS &ace_qos);
00140 
00141 };
00142 
00143 #endif /* ACE_HAS_RAPI */
00144 
00145 /**
00146  * @class ACE_GQoS_Session
00147  *
00148  * @brief A GQoS session object.
00149  *
00150  * This class is a GQoS (Generic QoS, an implementation of RSVP on
00151  * Win2K) implementation of the ACE_QoS_Session interface.
00152  */
00153 class ACE_QoS_Export ACE_GQoS_Session : public ACE_QoS_Session
00154 {
00155 
00156 public:
00157 
00158   /// Default destructor.
00159   ~ACE_GQoS_Session (void);
00160 
00161   /// This is a session ID generator. It does a lot more than expected
00162   /// from an int!.
00163   static int GQoS_session_id;
00164 
00165   /// Open a GQoS session [dest IP, dest port, Protocol ID].
00166   virtual int open (ACE_INET_Addr dest_addr,
00167                     ACE_Protocol_ID protocol_id);
00168 
00169   /// Close the GQoS Session.
00170   virtual int close (void);
00171 
00172   /// Returns the QoS for this GQoS session.
00173   virtual ACE_QoS qos (void) const;
00174 
00175   /// Set QoS for this GQoS session. The socket parameter is used to confirm if
00176   /// this QoS session was subscribed to by the socket.
00177   virtual int qos (ACE_SOCK *socket,
00178                    ACE_QoS_Manager *qos_manager,
00179                    const ACE_QoS &ace_qos);
00180 
00181   /**
00182    * Sets the QoS for this session object to ace_qos. Does not interfere with the
00183    * QoS in the underlying socket. This call is useful to update the QoS object
00184    * when the underlying socket QoS is being set through a mechanism other than
00185    * the previous qos () method e.g. inside the dgram_mcast.subscribe () where the
00186    * QoS for the socket is set through ACE_OS::join_leaf ().
00187    */
00188   virtual void qos (const ACE_QoS &ace_qos);
00189 
00190   /// Calls the ioctl (ACE_SIO_GET_QOS). It is a mechanism of updating the
00191   /// QoS for this session asynchronously, as RSVP events occur.
00192   virtual int update_qos (void);
00193 
00194   /// Get/Set methods for the flags_.
00195   virtual ACE_End_Point_Type flags (void) const;
00196   virtual void flags (const ACE_End_Point_Type flags);
00197 
00198   /// Get the destination address for this GQoS session.
00199   virtual ACE_INET_Addr dest_addr (void) const;
00200 
00201   /// Set the destination address for this GQoS session.
00202   virtual void dest_addr (const ACE_INET_Addr &dest_addr);
00203 
00204   /// Get the source port for this session.
00205   virtual u_short source_port (void) const;
00206 
00207   /// Set the source port for this session.
00208   virtual void source_port (const u_short &source_port);
00209 
00210   /// Get the GQoS session id.
00211   virtual int session_id (void) const;
00212 
00213   /// Set the GQoS session id.
00214   virtual void session_id (const int session_id);
00215 
00216   /// Get the file descriptor of the underlying socket.
00217   virtual ACE_HANDLE rsvp_events_handle (void);
00218 
00219   virtual void  rsvp_event_type (RSVP_Event_Type event_type);
00220   ///Set the RAPI event that last occured
00221 
00222   virtual RSVP_Event_Type rsvp_event_type (void);
00223   ///Get the RAPI event that last occured
00224 
00225   /// GQoS version.
00226   virtual int version ();
00227 
00228   /// The factory is a friend so it can create this object through
00229   /// the only private constructor.
00230   friend class ACE_QoS_Session_Factory;
00231 
00232 private:
00233 
00234   /// Default constructor. Constructor is defined private so that only
00235   /// the friend factory can instantiate this class.
00236   ACE_GQoS_Session (void);
00237 
00238 };
00239 
00240 #if defined (__ACE_INLINE__)
00241 #include "QoS_Session_Impl.i"
00242 #endif /* __ACE_INLINE__ */
00243 
00244 #include "ace/post.h"
00245 #endif /* ACE_QOS_SESSION_IMPL_H */

Generated on Mon Jun 16 13:17:26 2003 for ACE_QoS by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002