Public Types | Public Member Functions | Static Public Attributes | Private Types | Private Member Functions | Private Attributes

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 Member Functions

 ACE_QoS_Session_Factory (void)
 Default constructor.
 ~ACE_QoS_Session_Factory (void)
 Default destructor.
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).
int destroy_session (ACE_QoS_Session *qos_session)
 Destroy the QoS Session.

Static Public Attributes

static 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.

Private Member Functions

int add_session (ACE_QoS_Session *qos_session)
int remove_session (ACE_QoS_Session *qos_session)

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 41 of file QoS_Session_Factory.h.


Member Typedef Documentation

Unordered set of QoS Sessions.

Definition at line 88 of file QoS_Session_Factory.h.


Member Enumeration Documentation

Types of sessions for this factory to manage.

Enumerator:
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 55 of file QoS_Session_Factory.h.

  {
    /// ACE_RAPI_SESSION on Unix platforms with RAPI support
    ACE_RAPI_SESSION,

    /// ACE_GQOS_SESSION on Windows platforms with GQOS support
    ACE_GQOS_SESSION
  };


Constructor & Destructor Documentation

ACE_QoS_Session_Factory::ACE_QoS_Session_Factory ( void   ) 

Default constructor.

Definition at line 24 of file QoS_Session_Factory.cpp.

{
  ACE_TRACE ("ACE_QoS_Session_Factory::ACE_QoS_Session_Factory");
}

ACE_QoS_Session_Factory::~ACE_QoS_Session_Factory ( void   ) 

Default destructor.

Definition at line 29 of file QoS_Session_Factory.cpp.

{
  ACE_TRACE ("ACE_QoS_Session_Factory::~ACE_QoS_Session_Factory");
}


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 80 of file QoS_Session_Factory.cpp.

{
  if (this->qos_session_set_.insert (qos_session) != 0)
    ACE_ERROR_RETURN ((LM_ERROR,
                       ACE_TEXT ("Error in adding a new session")
                       ACE_TEXT ("to the session set\n")),
                      -1);

  return 0;
}

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 36 of file QoS_Session_Factory.cpp.

{

  ACE_QoS_Session * qos_session = 0;

#if defined (ACE_HAS_RAPI)
  if (qos_session_type == ACE_RAPI_SESSION)
    ACE_NEW_RETURN (qos_session,
                    ACE_RAPI_Session,
                    0);
#endif /* ACE_HAS_RAPI */

  if (qos_session_type == ACE_GQOS_SESSION)
    ACE_NEW_RETURN (qos_session,
                    ACE_GQoS_Session,
                    0);

  if (this->add_session (qos_session) == -1)
    {
      delete qos_session;
      ACE_ERROR_RETURN ((LM_ERROR,
                         ACE_TEXT ("Error in adding session\n")),
                        0);
    }

  return qos_session;
}

int ACE_QoS_Session_Factory::destroy_session ( ACE_QoS_Session qos_session  ) 

Destroy the QoS Session.

Definition at line 66 of file QoS_Session_Factory.cpp.

{

  if ((qos_session != 0) && (this->remove_session (qos_session) == -1))
    ACE_ERROR_RETURN ((LM_ERROR,
                       ACE_TEXT ("Error in destroying session\n")),
                      -1);

  return 0;
}

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 94 of file QoS_Session_Factory.cpp.

{
  if (this->qos_session_set_.remove (qos_session) == -1)
    ACE_ERROR_RETURN ((LM_ERROR,
                       ACE_TEXT ("Error in removing a session")
                       ACE_TEXT ("from the session set\n")),
                      -1);

  return 0;
}


Member Data Documentation

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 69 of file QoS_Session_Factory.h.

Definition at line 89 of file QoS_Session_Factory.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines