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

QoS_Session.h

Go to the documentation of this file.
00001 /* -*- C++ -*- */
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    QoS_Session.h
00006  *
00007  *  $Id: QoS_Session.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_H
00015 #define ACE_QOS_SESSION_H
00016 #include "ace/pre.h"
00017 
00018 #include "ACE_QoS_Export.h"
00019 #include "ace/INET_Addr.h"
00020 #include "ace/OS_QoS.h"
00021 
00022 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00023 # pragma once
00024 #endif /* ACE_LACKS_PRAGMA_ONCE */
00025 
00026 class ACE_SOCK;
00027 class ACE_QoS_Manager;
00028 
00029 typedef int ACE_Protocol_ID;
00030 // IPPROTO_UDP or IPPROTO_TCP.
00031 
00032 /**
00033  * @class ACE_QoS_Session
00034  *
00035  * @brief A QoS Session object.
00036  *
00037  * This class defines the interface for a QoS Session. It abstracts the
00038  * notion of QoS on different platforms and presents a simple, easy-to-use
00039  * API. Current [RAPI,GQoS] and future implementations will conform to this
00040  * interface.
00041  */
00042 class ACE_QoS_Export ACE_QoS_Session
00043 {
00044 
00045 public:
00046 
00047   enum RSVP_Event_Type
00048   {
00049     RSVP_PATH_EVENT,
00050     RSVP_RESV_EVENT,
00051     RSVP_RESV_CONFIRM,
00052     RSVP_RESV_ERROR,
00053     RSVP_PATH_ERROR    
00054   };
00055 
00056   /// A flag to indicate if this endpoint is a sender or a receiver or
00057   /// both.
00058   enum ACE_End_Point_Type
00059   {
00060     ACE_QOS_SENDER,
00061     ACE_QOS_RECEIVER,
00062     ACE_QOS_BOTH
00063   };
00064 
00065   
00066   /// to shutup g++.
00067   virtual ~ACE_QoS_Session (void) {};
00068 
00069   /// Open a QoS session [dest IP, dest port, Protocol ID].
00070   virtual int open (ACE_INET_Addr dest_addr,
00071                     ACE_Protocol_ID protocol_id) = 0;
00072 
00073   /// Close the QoS Session.
00074   virtual int close (void) = 0;
00075 
00076   /// Returns the QoS in the current session.
00077   virtual ACE_QoS qos (void) const = 0;
00078 
00079   /// Set QoS for the current session. The qos manager is used to
00080   /// confirm if this QoS session was subscribed to by the socket.
00081   virtual int qos (ACE_SOCK *socket,
00082                    ACE_QoS_Manager *qos_manager,
00083                    const ACE_QoS &ace_qos) = 0;
00084 
00085   /**
00086    * Sets the QoS for this session object to ace_qos. Does not
00087    * interfere with the QoS in the underlying socket. This call is
00088    * useful to update the QoS object when the underlying socket QoS is
00089    * being set through a mechanism other than the previous qos ()
00090    * method e.g. inside the dgram_mcast.subscribe () where the QoS for
00091    * the socket is set through ACE_OS::join_leaf ().
00092    */
00093   virtual void qos (const ACE_QoS &ace_qos) = 0;
00094 
00095   /**
00096    * This is called from handle_qos () method of the the QoS Event
00097    * Handler.  Invoking this method is an indication of a QoS event
00098    * occurring, that may have resulted in a change of QoS for the
00099    * underlying session. This method updates the QoS object associated
00100    * with this session.
00101    */
00102   virtual int update_qos (void) = 0;
00103 
00104   /// Get/Set methods for the flags_.
00105   virtual ACE_End_Point_Type flags (void) const = 0;
00106   virtual void flags (const ACE_End_Point_Type flags) = 0;
00107 
00108   /// Get the session id.
00109   virtual int session_id (void) const = 0;
00110 
00111   /// Set the session id.
00112   virtual void session_id (const int session_id) = 0;
00113 
00114   /// Get the file descriptor on which RSVP events will occur.
00115   virtual ACE_HANDLE rsvp_events_handle (void) = 0;
00116 
00117   virtual void  rsvp_event_type (RSVP_Event_Type event_type) = 0;
00118   ///Set the RAPI event that last occured
00119   
00120   virtual RSVP_Event_Type rsvp_event_type (void) = 0;
00121   ///Get the RAPI event that last occured
00122 
00123 
00124   /// Get the destination address for this session.
00125   virtual ACE_INET_Addr dest_addr (void) const = 0;
00126 
00127   /// Set the destination address for this session.
00128   virtual void dest_addr (const ACE_INET_Addr &dest_addr) = 0;
00129 
00130   /// Get the source port for this session.
00131   virtual u_short source_port (void) const = 0;
00132 
00133   /// Set the source port for this session.
00134   virtual void source_port (const u_short &source_port) = 0;
00135 
00136   /**
00137    * Returns the version of the underlying RSVP implementation. Is
00138    * meaningful only when the underlying implementation has
00139    * versioning.
00140    */
00141   virtual int version (void) = 0;
00142 
00143 protected:
00144 
00145   /// Source port if this is a Sender session. Used for rapi_sender ().
00146   u_short source_port_;
00147 
00148   /// session id for the session.
00149   int session_id_;
00150 
00151   /// Destination address for this session.
00152   ACE_INET_Addr dest_addr_;
00153 
00154   /// Is this a TCP or a UDP session.
00155   ACE_Protocol_ID protocol_id_;
00156 
00157   /// QoS for this session.
00158   ACE_QoS qos_;
00159 
00160   /// Specifies if this is a sending/receiving/both session.
00161   ACE_End_Point_Type flags_;
00162 
00163   RSVP_Event_Type rsvp_event_type_;
00164   //Has the last rsvp event that occured
00165 
00166 };
00167 
00168 #include "ace/post.h"
00169 #endif /* ACE_QOS_SESSION_H */

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