Use =default for skeleton copy constructor
[ACE_TAO.git] / ACE / ace / QoS / QoS_Session.h
blob1bc7da691fcc579877c3c3655641c6d0019b9886
1 /* -*- C++ -*- */
3 //=============================================================================
4 /**
5 * @file QoS_Session.h
7 * @author Vishal Kachroo <vishal@cs.wustl.edu>
8 */
9 //=============================================================================
12 #ifndef ACE_QOS_SESSION_H
13 #define ACE_QOS_SESSION_H
14 #include /**/ "ace/pre.h"
16 #include "ACE_QoS_Export.h"
17 #include "ace/INET_Addr.h"
18 #include "ace/OS_QoS.h"
20 #if !defined (ACE_LACKS_PRAGMA_ONCE)
21 # pragma once
22 #endif /* ACE_LACKS_PRAGMA_ONCE */
24 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
26 class ACE_SOCK;
27 class ACE_QoS_Manager;
29 typedef int ACE_Protocol_ID;
30 // IPPROTO_UDP or IPPROTO_TCP.
32 /**
33 * @class ACE_QoS_Session
35 * @brief A QoS Session object.
37 * This class defines the interface for a QoS Session. It abstracts the
38 * notion of QoS on different platforms and presents a simple, easy-to-use
39 * API. Current [RAPI,GQoS] and future implementations will conform to this
40 * interface.
42 class ACE_QoS_Export ACE_QoS_Session
44 public:
45 enum RSVP_Event_Type
47 RSVP_PATH_EVENT,
48 RSVP_RESV_EVENT,
49 RSVP_RESV_CONFIRM,
50 RSVP_RESV_ERROR,
51 RSVP_PATH_ERROR
54 /// A flag to indicate if this endpoint is a sender or a receiver or
55 /// both.
56 enum ACE_End_Point_Type
58 ACE_QOS_SENDER,
59 ACE_QOS_RECEIVER,
60 ACE_QOS_BOTH
64 /// to shutup g++.
65 virtual ~ACE_QoS_Session () {};
67 /// Open a QoS session [dest IP, dest port, Protocol ID].
68 virtual int open (ACE_INET_Addr dest_addr,
69 ACE_Protocol_ID protocol_id) = 0;
71 /// Close the QoS Session.
72 virtual int close () = 0;
74 /// Returns the QoS in the current session.
75 virtual ACE_QoS qos () const = 0;
77 /// Set QoS for the current session. The qos manager is used to
78 /// confirm if this QoS session was subscribed to by the socket.
79 virtual int qos (ACE_SOCK *socket,
80 ACE_QoS_Manager *qos_manager,
81 const ACE_QoS &ace_qos) = 0;
83 /**
84 * Sets the QoS for this session object to ace_qos. Does not
85 * interfere with the QoS in the underlying socket. This call is
86 * useful to update the QoS object when the underlying socket QoS is
87 * being set through a mechanism other than the previous qos ()
88 * method e.g. inside the dgram_mcast.subscribe () where the QoS for
89 * the socket is set through ACE_OS::join_leaf ().
91 virtual void qos (const ACE_QoS &ace_qos) = 0;
93 /**
94 * This is called from handle_qos () method of the the QoS Event
95 * Handler. Invoking this method is an indication of a QoS event
96 * occurring, that may have resulted in a change of QoS for the
97 * underlying session. This method updates the QoS object associated
98 * with this session.
100 virtual int update_qos () = 0;
102 /// Get/Set methods for the flags_.
103 virtual ACE_End_Point_Type flags () const = 0;
104 virtual void flags (const ACE_End_Point_Type flags) = 0;
106 /// Get the session id.
107 virtual int session_id () const = 0;
109 /// Set the session id.
110 virtual void session_id (const int session_id) = 0;
112 /// Get the file descriptor on which RSVP events will occur.
113 virtual ACE_HANDLE rsvp_events_handle () = 0;
115 virtual void rsvp_event_type (RSVP_Event_Type event_type) = 0;
116 ///Set the RAPI event that last occurred
118 virtual RSVP_Event_Type rsvp_event_type () = 0;
119 ///Get the RAPI event that last occurred
122 /// Get the destination address for this session.
123 virtual ACE_INET_Addr dest_addr () const = 0;
125 /// Set the destination address for this session.
126 virtual void dest_addr (const ACE_INET_Addr &dest_addr) = 0;
128 /// Get the source port for this session.
129 virtual u_short source_port () const = 0;
131 /// Set the source port for this session.
132 virtual void source_port (const u_short &source_port) = 0;
134 //Set the source host
135 virtual ACE_INET_Addr* source_addr () const = 0;
137 /// Set the source port for this session.
138 virtual void source_addr (ACE_INET_Addr* source_addr) = 0;
142 * Returns the version of the underlying RSVP implementation. Is
143 * meaningful only when the underlying implementation has
144 * versioning.
146 virtual int version () = 0;
148 protected:
149 /// Source port if this is a Sender session. Used for rapi_sender ().
150 u_short source_port_;
152 /// session id for the session.
153 int session_id_;
155 /// Destination address for this session.
156 ACE_INET_Addr dest_addr_;
158 /// Source address for this session.
159 ACE_INET_Addr* src_addr_;
161 /// Is this a TCP or a UDP session.
162 ACE_Protocol_ID protocol_id_;
164 /// QoS for this session.
165 ACE_QoS qos_;
167 /// Specifies if this is a sending/receiving/both session.
168 ACE_End_Point_Type flags_;
170 RSVP_Event_Type rsvp_event_type_;
171 //Has the last rsvp event that occurred
174 ACE_END_VERSIONED_NAMESPACE_DECL
176 #include /**/ "ace/post.h"
177 #endif /* ACE_QOS_SESSION_H */