Revert to Current Include Style
[ACE_TAO.git] / ACE / ace / QoS / QoS_Session_Impl.h
blob28a905a2862689e6c11644a44db64b8f46da9d0d
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file QoS_Session_Impl.h
7 * @author Vishal Kachroo <vishal@cs.wustl.edu>
8 */
9 //=============================================================================
12 #ifndef ACE_QOS_SESSION_IMPL_H
13 #define ACE_QOS_SESSION_IMPL_H
14 #include /**/ "ace/pre.h"
16 #include "ace/QoS/QoS_Session.h"
18 #if !defined (ACE_LACKS_PRAGMA_ONCE)
19 # pragma once
20 #endif /* ACE_LACKS_PRAGMA_ONCE */
23 #if defined (ACE_HAS_RAPI)
24 #include "rapi_lib.h"
26 #define DEFAULT_SOURCE_SENDER_PORT 10001
28 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
30 /**
31 * @class ACE_RAPI_Session
33 * @brief A RAPI QoS session object.
35 * This class is a RAPI (RSVP API, an implementation of RSVP on UNIX)
36 * implementation of the ACE_QoS_Session interface.
38 class ACE_QoS_Export ACE_RAPI_Session : public ACE_QoS_Session
41 public:
43 /// Default destructor.
44 ~ACE_RAPI_Session (void);
46 /// Error handling for RSVP callback
47 static int rsvp_error;
49 /// Open a RAPI QoS session [dest IP, dest port, Protocol ID].
50 virtual int open (ACE_INET_Addr dest_addr,
51 ACE_Protocol_ID protocol_id);
53 /// Close the RAPI QoS Session.
54 virtual int close (void);
56 /// Returns the QoS for this RAPI session.
57 virtual ACE_QoS qos (void) const;
59 /// Set QoS for this RAPI session. The socket parameter is used to confirm if
60 /// this QoS session was subscribed to by the socket.
61 virtual int qos (ACE_SOCK *socket,
62 ACE_QoS_Manager *qos_manager,
63 const ACE_QoS &ace_qos);
65 /**
66 * Sets the QoS for this session object to ace_qos. Does not interfere with the
67 * QoS in the underlying socket. This call is useful to update the QoS object
68 * when the underlying socket QoS is being set through a mechanism other than
69 * the previous qos () method e.g. inside the dgram_mcast.subscribe () where the
70 * QoS for the socket is set through ACE_OS::join_leaf ().
72 virtual void qos (const ACE_QoS &ace_qos);
74 /**
75 * Calls rapi_dispatch () that further triggers the call back function.
76 * It is a mechanism of updating the QoS for this session asynchronously, as
77 * RSVP events occur.
79 virtual int update_qos (void);
81 /// Get methods for the flags_.
82 virtual ACE_End_Point_Type flags (void) const;
84 /// Set methods for the flags_.
85 virtual void flags (const ACE_End_Point_Type flags);
87 /// Get the RAPI session id.
88 virtual int session_id (void) const;
90 /// Set the RAPI session id.
91 virtual void session_id (const int session_id);
93 /// Get the RAPI file descriptor for RSVP events.
94 virtual ACE_HANDLE rsvp_events_handle (void);
96 ///Set the RAPI event that last occurred
97 virtual void rsvp_event_type (RSVP_Event_Type event_type);
99 ///Get the RAPI event that last occurred
100 virtual RSVP_Event_Type rsvp_event_type (void);
102 /// Get the destination address for this RAPI session.
103 virtual ACE_INET_Addr dest_addr (void) const;
105 /// Set the destination address for this RAPI session.
106 virtual void dest_addr (const ACE_INET_Addr &dest_addr);
108 /// Get the source port for this session.
109 virtual u_short source_port (void) const;
111 /// Set the source port for this session.
112 virtual void source_port (const u_short &source_port);
114 //Set the source host
115 virtual ACE_INET_Addr* source_addr (void) const;
117 /// Set the source port for this session.
118 virtual void source_addr (ACE_INET_Addr* source_addr);
120 /// RAPI version. Returned value = 100 * major-version + minor-version.
121 virtual int version ();
123 /// The factory is a friend so it can create this object through
124 /// the only private constructor.
125 friend class ACE_QoS_Session_Factory;
127 private:
129 /// Default constuctor. Constructor is defined private so that only
130 /// the friend factory can instantiate this class.
131 ACE_RAPI_Session (void);
133 /// Construct a simplified RAPI Sender TSpec object
134 /// from an ACE_Flow_Spec object. Used internally by this class.
135 rapi_tspec_t *init_tspec_simplified (const ACE_Flow_Spec &flow_spec);
137 /// Construct a simplified RAPI Receiver FlowSpec object
138 /// from an ACE_Flow_Spec object. Used internally by the class.
139 rapi_flowspec_t *init_flowspec_simplified(const ACE_Flow_Spec &flow_spec);
141 /// Set sending QoS for this RAPI session.
142 int sending_qos (const ACE_QoS &ace_qos);
144 /// Set receiving QoS for this RAPI session.
145 int receiving_qos (const ACE_QoS &ace_qos);
149 ACE_END_VERSIONED_NAMESPACE_DECL
151 #endif /* ACE_HAS_RAPI */
153 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
156 * @class ACE_GQoS_Session
158 * @brief A GQoS session object.
160 * This class is a GQoS (Generic QoS, an implementation of RSVP on
161 * Win2K) implementation of the ACE_QoS_Session interface.
163 class ACE_QoS_Export ACE_GQoS_Session : public ACE_QoS_Session
166 public:
168 /// Default destructor.
169 ~ACE_GQoS_Session (void);
171 /// This is a session ID generator. It does a lot more than expected
172 /// from an int!.
173 static int GQoS_session_id;
175 /// Open a GQoS session [dest IP, dest port, Protocol ID].
176 virtual int open (ACE_INET_Addr dest_addr,
177 ACE_Protocol_ID protocol_id);
179 /// Close the GQoS Session.
180 virtual int close (void);
182 /// Returns the QoS for this GQoS session.
183 virtual ACE_QoS qos (void) const;
185 /// Set QoS for this GQoS session. The socket parameter is used to confirm if
186 /// this QoS session was subscribed to by the socket.
187 virtual int qos (ACE_SOCK *socket,
188 ACE_QoS_Manager *qos_manager,
189 const ACE_QoS &ace_qos);
192 * Sets the QoS for this session object to ace_qos. Does not interfere with the
193 * QoS in the underlying socket. This call is useful to update the QoS object
194 * when the underlying socket QoS is being set through a mechanism other than
195 * the previous qos () method e.g. inside the dgram_mcast.subscribe () where the
196 * QoS for the socket is set through ACE_OS::join_leaf ().
198 virtual void qos (const ACE_QoS &ace_qos);
200 /// Calls the ioctl (ACE_SIO_GET_QOS). It is a mechanism of updating the
201 /// QoS for this session asynchronously, as RSVP events occur.
202 virtual int update_qos (void);
204 /// Get/Set methods for the flags_.
205 virtual ACE_End_Point_Type flags (void) const;
206 virtual void flags (const ACE_End_Point_Type flags);
208 /// Get the destination address for this GQoS session.
209 virtual ACE_INET_Addr dest_addr (void) const;
211 /// Set the destination address for this GQoS session.
212 virtual void dest_addr (const ACE_INET_Addr &dest_addr);
214 /// Get the source port for this session.
215 virtual u_short source_port (void) const;
217 /// Set the source port for this session.
218 virtual void source_port (const u_short &source_port);
220 //Set the source host
221 virtual ACE_INET_Addr* source_addr (void) const;
223 /// Set the source port for this session.
224 virtual void source_addr (ACE_INET_Addr* source_addr);
226 /// Get the GQoS session id.
227 virtual int session_id (void) const;
229 /// Set the GQoS session id.
230 virtual void session_id (const int session_id);
232 /// Get the file descriptor of the underlying socket.
233 virtual ACE_HANDLE rsvp_events_handle (void);
235 virtual void rsvp_event_type (RSVP_Event_Type event_type);
236 ///Set the RAPI event that last occurred
238 virtual RSVP_Event_Type rsvp_event_type (void);
239 ///Get the RAPI event that last occurred
241 /// GQoS version.
242 virtual int version ();
244 /// The factory is a friend so it can create this object through
245 /// the only private constructor.
246 friend class ACE_QoS_Session_Factory;
248 private:
250 /// Default constructor. Constructor is defined private so that only
251 /// the friend factory can instantiate this class.
252 ACE_GQoS_Session (void);
256 ACE_END_VERSIONED_NAMESPACE_DECL
258 #if defined (__ACE_INLINE__)
259 #include "QoS_Session_Impl.inl"
260 #endif /* __ACE_INLINE__ */
262 #include /**/ "ace/post.h"
263 #endif /* ACE_QOS_SESSION_IMPL_H */