#include <QoS_Session_Factory.h>
Collaboration diagram for ACE_QoS_Session_Factory:
Public Types | |
ACE_RAPI_SESSION | |
ACE_RAPI_SESSION on Unix platforms with RAPI support. | |
ACE_GQOS_SESSION | |
ACE_GQOS_SESSION on Windows platforms with GQOS support. | |
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_Session * | create_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_ |
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.
typedef ACE_Unbounded_Set<ACE_QoS_Session *> ACE_QoS_Session_Factory::QOS_SESSION_SET [private] |
Types of sessions for this factory to manage.
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.
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 };
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_QoS_Session_Factory::ACE_QoS_Session_Factory | ( | void | ) |
Default constructor.
Definition at line 24 of file QoS_Session_Factory.cpp.
References ACE_TRACE.
00025 { 00026 ACE_TRACE ("ACE_QoS_Session_Factory::ACE_QoS_Session_Factory"); 00027 }
ACE_QoS_Session_Factory::~ACE_QoS_Session_Factory | ( | void | ) |
Default destructor.
Definition at line 29 of file QoS_Session_Factory.cpp.
References ACE_TRACE.
00030 { 00031 ACE_TRACE ("ACE_QoS_Session_Factory::~ACE_QoS_Session_Factory"); 00032 }
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.
References ACE_ERROR_RETURN, ACE_TEXT, and LM_ERROR.
00081 { 00082 if (this->qos_session_set_.insert (qos_session) != 0) 00083 ACE_ERROR_RETURN ((LM_ERROR, 00084 ACE_TEXT ("Error in adding a new session") 00085 ACE_TEXT ("to the session set\n")), 00086 -1); 00087 00088 return 0; 00089 }
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.
References ACE_ERROR_RETURN, ACE_GQOS_SESSION, ACE_NEW_RETURN, ACE_RAPI_SESSION, ACE_TEXT, and LM_ERROR.
00037 { 00038 00039 ACE_QoS_Session * qos_session = 0; 00040 00041 #if defined (ACE_HAS_RAPI) 00042 if (qos_session_type == ACE_RAPI_SESSION) 00043 ACE_NEW_RETURN (qos_session, 00044 ACE_RAPI_Session, 00045 0); 00046 #endif /* ACE_HAS_RAPI */ 00047 00048 if (qos_session_type == ACE_GQOS_SESSION) 00049 ACE_NEW_RETURN (qos_session, 00050 ACE_GQoS_Session, 00051 0); 00052 00053 if (this->add_session (qos_session) == -1) 00054 { 00055 delete qos_session; 00056 ACE_ERROR_RETURN ((LM_ERROR, 00057 ACE_TEXT ("Error in adding session\n")), 00058 0); 00059 } 00060 00061 return qos_session; 00062 }
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.
References ACE_ERROR_RETURN, ACE_TEXT, and LM_ERROR.
00067 { 00068 00069 if ((qos_session != 0) && (this->remove_session (qos_session) == -1)) 00070 ACE_ERROR_RETURN ((LM_ERROR, 00071 ACE_TEXT ("Error in destroying session\n")), 00072 -1); 00073 00074 return 0; 00075 }
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.
References ACE_ERROR_RETURN, ACE_TEXT, and LM_ERROR.
00095 { 00096 if (this->qos_session_set_.remove (qos_session) == -1) 00097 ACE_ERROR_RETURN ((LM_ERROR, 00098 ACE_TEXT ("Error in removing a session") 00099 ACE_TEXT ("from the session set\n")), 00100 -1); 00101 00102 return 0; 00103 }
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.