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

ACE_QoS_Session_Factory Class Reference

Concrete factory for the QoS Session objects. More...

#include <QoS_Session_Factory.h>

Collaboration diagram for ACE_QoS_Session_Factory:

Collaboration graph
[legend]
List of all members.

Public Types

enum  ACE_QoS_Session_Type { ACE_RAPI_SESSION, ACE_GQOS_SESSION }
 Types of sessions for this factory to manage. More...


Public Methods

 ACE_QoS_Session_Factory (void)
 Default constructor. More...

 ~ACE_QoS_Session_Factory (void)
 Default destructor. More...

ACE_QoS_Sessioncreate_session (ACE_QoS_Session_Type qos_session_type=ACE_DEFAULT_QOS_SESSION)
 Create a QoS session of the given type (RAPI or GQoS). More...

int destroy_session (ACE_QoS_Session *qos_session)
 Destroy the QoS Session. More...


Static Public Attributes

const enum ACE_QoS_Session_Type ACE_DEFAULT_QOS_SESSION

Private Types

typedef ACE_Unbounded_Set<
ACE_QoS_Session * > 
QOS_SESSION_SET
 Unordered set of QoS Sessions. More...


Private Methods

int add_session (ACE_QoS_Session *qos_session)
 Used by the create_session () to add new sessions to the set of sessions created by this factory. More...

int remove_session (ACE_QoS_Session *qos_session)
 Used by the destroy_session () to remove a session from the set of sessions created by this factory. More...


Private Attributes

QOS_SESSION_SET qos_session_set_

Detailed Description

Concrete factory for the QoS Session objects.

This class manages the life cycle of QoS Session objects. These objects are currently either RAPI session objects or GQoS session objects. It stores the sessions in an unbounded set.

Definition at line 39 of file QoS_Session_Factory.h.


Member Typedef Documentation

typedef ACE_Unbounded_Set<ACE_QoS_Session *> ACE_QoS_Session_Factory::QOS_SESSION_SET [private]
 

Unordered set of QoS Sessions.

Definition at line 86 of file QoS_Session_Factory.h.


Member Enumeration Documentation

enum ACE_QoS_Session_Factory::ACE_QoS_Session_Type
 

Types of sessions for this factory to manage.

Enumeration values:
ACE_RAPI_SESSION  ACE_RAPI_SESSION on Unix platforms with RAPI support.
ACE_GQOS_SESSION  ACE_GQOS_SESSION on Windows platforms with GQOS support.

Definition at line 53 of file QoS_Session_Factory.h.

00054   {
00055     /// ACE_RAPI_SESSION on Unix platforms with RAPI support
00056     ACE_RAPI_SESSION,
00057 
00058     /// ACE_GQOS_SESSION on Windows platforms with GQOS support
00059     ACE_GQOS_SESSION
00060   };


Constructor & Destructor Documentation

ACE_QoS_Session_Factory::ACE_QoS_Session_Factory void   
 

Default constructor.

Definition at line 22 of file QoS_Session_Factory.cpp.

References ACE_TRACE.

00023 {
00024   ACE_TRACE ("ACE_QoS_Session_Factory::ACE_QoS_Session_Factory");
00025 }

ACE_QoS_Session_Factory::~ACE_QoS_Session_Factory void   
 

Default destructor.

Definition at line 27 of file QoS_Session_Factory.cpp.

References ACE_TRACE.

00028 {
00029   ACE_TRACE ("ACE_QoS_Session_Factory::~ACE_QoS_Session_Factory");
00030 }


Member Function Documentation

int ACE_QoS_Session_Factory::add_session ACE_QoS_Session   qos_session [private]
 

Used by the create_session () to add new sessions to the set of sessions created by this factory.

Definition at line 78 of file QoS_Session_Factory.cpp.

References ACE_ERROR_RETURN, ACE_LIB_TEXT, ACE_Unbounded_Set< ACE_QoS_Session * >::insert, LM_ERROR, and qos_session_set_.

Referenced by create_session.

00079 {
00080   if (this->qos_session_set_.insert (qos_session) != 0)
00081     ACE_ERROR_RETURN ((LM_ERROR,
00082                        ACE_LIB_TEXT ("Error in adding a new session")
00083                        ACE_LIB_TEXT ("to the session set\n")),
00084                       -1);
00085 
00086   return 0;
00087 }

ACE_QoS_Session * ACE_QoS_Session_Factory::create_session ACE_QoS_Session_Type    qos_session_type = ACE_DEFAULT_QOS_SESSION
 

Create a QoS session of the given type (RAPI or GQoS).

Definition at line 34 of file QoS_Session_Factory.cpp.

References ACE_ERROR_RETURN, ACE_GQOS_SESSION, ACE_LIB_TEXT, ACE_NEW_RETURN, ACE_RAPI_SESSION, add_session, and LM_ERROR.

00035 {
00036 
00037   ACE_QoS_Session * qos_session = 0;
00038 
00039 #if defined (ACE_HAS_RAPI)
00040   if (qos_session_type == ACE_RAPI_SESSION)
00041     ACE_NEW_RETURN (qos_session,
00042                     ACE_RAPI_Session,
00043                     0);
00044 #endif /* ACE_HAS_RAPI */
00045 
00046   if (qos_session_type == ACE_GQOS_SESSION)
00047     ACE_NEW_RETURN (qos_session,
00048                     ACE_GQoS_Session,
00049                     0);
00050 
00051   if (this->add_session (qos_session) == -1)
00052     {
00053       delete qos_session;
00054       ACE_ERROR_RETURN ((LM_ERROR,
00055                          ACE_LIB_TEXT ("Error in adding session\n")),
00056                         0);
00057     }
00058 
00059   return qos_session;
00060 }

int ACE_QoS_Session_Factory::destroy_session ACE_QoS_Session   qos_session
 

Destroy the QoS Session.

Definition at line 64 of file QoS_Session_Factory.cpp.

References ACE_ERROR_RETURN, ACE_LIB_TEXT, LM_ERROR, and remove_session.

00065 {
00066 
00067   if ((qos_session != 0) && (this->remove_session (qos_session) == -1))
00068     ACE_ERROR_RETURN ((LM_ERROR,
00069                        ACE_LIB_TEXT ("Error in destroying session\n")),
00070                       -1);
00071 
00072   return 0;
00073 }

int ACE_QoS_Session_Factory::remove_session ACE_QoS_Session   qos_session [private]
 

Used by the destroy_session () to remove a session from the set of sessions created by this factory.

Definition at line 92 of file QoS_Session_Factory.cpp.

References ACE_ERROR_RETURN, ACE_LIB_TEXT, LM_ERROR, qos_session_set_, and ACE_Unbounded_Set< ACE_QoS_Session * >::remove.

Referenced by destroy_session.

00093 {
00094   if (this->qos_session_set_.remove (qos_session) == -1)
00095     ACE_ERROR_RETURN ((LM_ERROR,
00096                        ACE_LIB_TEXT ("Error in removing a session")
00097                        ACE_LIB_TEXT ("from the session set\n")),
00098                       -1);
00099 
00100   return 0;
00101 }


Member Data Documentation

const enum ACE_QoS_Session_Type ACE_QoS_Session_Factory::ACE_DEFAULT_QOS_SESSION [static]
 

The default QoS type supported on this platform.

ACE_DEFAULT_QOS_SESSION = ACE_RAPI_SESSION on Unix platforms with RAPI support = ACE_GQOS_SESSION on Windows platforms with GQOS support

Definition at line 67 of file QoS_Session_Factory.h.

QOS_SESSION_SET ACE_QoS_Session_Factory::qos_session_set_ [private]
 

Definition at line 87 of file QoS_Session_Factory.h.

Referenced by add_session, and remove_session.


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 13:17:49 2003 for ACE_QoS by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002