QoS_Session_Factory.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    QoS_Session_Factory.h
00006  *
00007  *  $Id: QoS_Session_Factory.h 69855 2005-12-08 22:25:45Z ossama $
00008  *
00009  *  @author Vishal Kachroo <vishal@cs.wustl.edu>
00010  */
00011 //=============================================================================
00012 
00013 
00014 #ifndef ACE_QOS_SESSION_FACTORY_H
00015 #define ACE_QOS_SESSION_FACTORY_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 #include "ace/Containers_T.h"
00025 #include "ACE_QoS_Export.h"
00026 
00027 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00028 
00029 // Forward declare this, so the factory uses only references to this.
00030 class ACE_QoS_Session;
00031 
00032 /**
00033  * @class ACE_QoS_Session_Factory
00034  *
00035  * @brief Concrete factory for the QoS Session objects.
00036  *
00037  * This class manages the life cycle of QoS Session objects. These
00038  * objects are currently either RAPI session objects or GQoS session
00039  * objects. It stores the sessions in an unbounded set.
00040  */
00041 class ACE_QoS_Export ACE_QoS_Session_Factory
00042 {
00043 
00044 public :
00045 
00046   // = Initialization and termination methods.
00047   /// Default constructor.
00048   ACE_QoS_Session_Factory (void);
00049 
00050   /// Default destructor.
00051   ~ACE_QoS_Session_Factory (void);
00052 
00053 
00054   /// Types of sessions for this factory to manage.
00055   enum ACE_QoS_Session_Type
00056   {
00057     /// ACE_RAPI_SESSION on Unix platforms with RAPI support
00058     ACE_RAPI_SESSION,
00059 
00060     /// ACE_GQOS_SESSION on Windows platforms with GQOS support
00061     ACE_GQOS_SESSION
00062   };
00063 
00064   /**  The default QoS type supported on this platform.
00065     *
00066     *       ACE_DEFAULT_QOS_SESSION = ACE_RAPI_SESSION on Unix platforms with RAPI support
00067     *                               = ACE_GQOS_SESSION on Windows platforms with GQOS support
00068     */
00069   static const enum ACE_QoS_Session_Type ACE_DEFAULT_QOS_SESSION;
00070 
00071   /// Create a QoS session of the given type (RAPI or GQoS).
00072   ACE_QoS_Session * create_session (ACE_QoS_Session_Type qos_session_type = ACE_DEFAULT_QOS_SESSION );
00073 
00074   /// Destroy the QoS Session.
00075   int destroy_session (ACE_QoS_Session *qos_session);
00076 
00077 private:
00078 
00079   /// Used by the create_session () to add new sessions to the
00080   /// set of sessions created by this factory.
00081   int add_session (ACE_QoS_Session *qos_session);
00082 
00083   /// Used by the destroy_session () to remove a session from the set
00084   /// of sessions created by this factory.
00085   int remove_session (ACE_QoS_Session *qos_session);
00086 
00087   /// Unordered set of QoS Sessions.
00088   typedef ACE_Unbounded_Set <ACE_QoS_Session *> QOS_SESSION_SET;
00089   QOS_SESSION_SET qos_session_set_;
00090 
00091 };
00092 
00093 ACE_END_VERSIONED_NAMESPACE_DECL
00094 
00095 #include /**/ "ace/post.h"
00096 #endif /* ACE_QOS_SESSION_FACTORY_H */

Generated on Sun Jan 27 13:03:37 2008 for ACE_QoS by doxygen 1.3.6