Use =default for skeleton copy constructor
[ACE_TAO.git] / TAO / tao / DiffServPolicy / DiffServ_Service_Context_Handler.cpp
blobdff79249f78b5cf8819afd263393b2d8243b7344
1 #include "tao/DiffServPolicy/DiffServ_Service_Context_Handler.h"
3 #include "tao/DiffServPolicy/Client_Network_Priority_Policy.h"
4 #include "tao/CDR.h"
5 #include "tao/TAO_Server_Request.h"
6 #include "tao/Transport.h"
7 #include "tao/ORB_Core.h"
8 #include "tao/GIOP_Message_Base.h"
9 #include "tao/operation_details.h"
10 #include "tao/Transport_Mux_Strategy.h"
11 #include "tao/Stub.h"
13 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
15 int
16 TAO_DiffServ_Service_Context_Handler::process_service_context (
17 TAO_Transport&,
18 const IOP::ServiceContext&,
19 TAO_ServerRequest *)
21 return 0;
24 int
25 TAO_DiffServ_Service_Context_Handler::generate_service_context (
26 TAO_Stub *stub,
27 TAO_Transport&,
28 TAO_Operation_Details &opdetails,
29 TAO_Target_Specification &,
30 TAO_OutputCDR &)
32 if (stub)
34 CORBA::Policy_var cnpp =
35 stub->get_cached_policy (TAO_CACHED_POLICY_CLIENT_NETWORK_PRIORITY);
37 TAO::NetworkPriorityPolicy_var cnp =
38 TAO::NetworkPriorityPolicy::_narrow (cnpp.in ());
40 if (!CORBA::is_nil (cnp.in ()))
42 TAO::DiffservCodepoint const reply_diffserv_codepoint =
43 cnp->reply_diffserv_codepoint ();
45 CORBA::Long const rep_dscp_codepoint = reply_diffserv_codepoint;
47 TAO_OutputCDR cdr;
48 if (!(cdr << ACE_OutputCDR::from_boolean (TAO_ENCAP_BYTE_ORDER))
49 || !(cdr << rep_dscp_codepoint))
51 throw CORBA::MARSHAL ();
54 opdetails.request_service_context ().set_context (IOP::REP_NWPRIORITY, cdr);
58 return 0;
61 TAO_END_VERSIONED_NAMESPACE_DECL