Use =default for skeleton copy constructor
[ACE_TAO.git] / TAO / tao / DiffServPolicy / Server_Network_Priority_Policy.cpp
blob1a67c368d19c31c7f95ca1c9478f03d5a0b16f9e
1 #include "tao/DiffServPolicy/Server_Network_Priority_Policy.h"
2 #include "tao/SystemException.h"
3 #include "tao/ORB_Constants.h"
4 #include "tao/CDR.h"
6 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
8 TAO_Server_Network_Priority_Policy::TAO_Server_Network_Priority_Policy ()
9 : ::CORBA::Object ()
10 , ::CORBA::Policy ()
11 , TAO::NetworkPriorityPolicy ()
12 , ::CORBA::LocalObject ()
13 , request_diffserv_codepoint_ (0)
14 , reply_diffserv_codepoint_ (0)
15 , network_priority_model_ (TAO::NO_NETWORK_PRIORITY)
19 TAO_Server_Network_Priority_Policy::~TAO_Server_Network_Priority_Policy ()
23 TAO_Server_Network_Priority_Policy::TAO_Server_Network_Priority_Policy (
24 const TAO::DiffservCodepoint &request_diffserv_codepoint,
25 const TAO::DiffservCodepoint &reply_diffserv_codepoint,
26 TAO::NetworkPriorityModel &network_priority_model)
27 : ::CORBA::Object ()
28 , ::CORBA::Policy ()
29 , TAO::NetworkPriorityPolicy ()
30 , ::CORBA::LocalObject ()
31 , request_diffserv_codepoint_ (request_diffserv_codepoint)
32 , reply_diffserv_codepoint_ (reply_diffserv_codepoint)
33 , network_priority_model_ (network_priority_model)
37 TAO_Server_Network_Priority_Policy::TAO_Server_Network_Priority_Policy (
38 const TAO_Server_Network_Priority_Policy &rhs)
39 : ::CORBA::Object ()
40 , ::CORBA::Policy ()
41 , TAO::NetworkPriorityPolicy ()
42 , ::CORBA::LocalObject ()
43 , request_diffserv_codepoint_ (rhs.request_diffserv_codepoint_)
44 , reply_diffserv_codepoint_ (rhs.reply_diffserv_codepoint_)
45 , network_priority_model_ (rhs.network_priority_model_)
49 CORBA::Policy_ptr
50 TAO_Server_Network_Priority_Policy::create (const CORBA::Any &)
52 CORBA::Policy_ptr policy = CORBA::Policy::_nil ();
54 ACE_NEW_THROW_EX (policy,
55 TAO_Server_Network_Priority_Policy (),
56 CORBA::NO_MEMORY (TAO::VMCID,
57 CORBA::COMPLETED_NO));
58 return policy;
61 CORBA::PolicyType
62 TAO_Server_Network_Priority_Policy::policy_type ()
64 return TAO::NETWORK_PRIORITY_TYPE;
67 TAO_Server_Network_Priority_Policy *
68 TAO_Server_Network_Priority_Policy::clone () const
70 TAO_Server_Network_Priority_Policy *copy = 0;
71 ACE_NEW_RETURN (copy,
72 TAO_Server_Network_Priority_Policy (*this),
73 0);
74 return copy;
77 TAO::DiffservCodepoint
78 TAO_Server_Network_Priority_Policy::request_diffserv_codepoint ()
80 return this->request_diffserv_codepoint_;
83 void
84 TAO_Server_Network_Priority_Policy::request_diffserv_codepoint (
85 TAO::DiffservCodepoint req_dscp)
87 this->request_diffserv_codepoint_ = req_dscp;
90 TAO::DiffservCodepoint
91 TAO_Server_Network_Priority_Policy::reply_diffserv_codepoint ()
93 return this->reply_diffserv_codepoint_;
96 void
97 TAO_Server_Network_Priority_Policy::reply_diffserv_codepoint (
98 TAO::DiffservCodepoint reply_dscp)
100 this->reply_diffserv_codepoint_ = reply_dscp;
103 TAO::NetworkPriorityModel
104 TAO_Server_Network_Priority_Policy::network_priority_model ()
106 return this->network_priority_model_;
109 void
110 TAO_Server_Network_Priority_Policy::network_priority_model (
111 TAO::NetworkPriorityModel npm)
113 this->network_priority_model_ = npm;
116 CORBA::Policy_ptr
117 TAO_Server_Network_Priority_Policy::copy ()
119 TAO_Server_Network_Priority_Policy* servant = 0;
120 ACE_NEW_THROW_EX (servant,
121 TAO_Server_Network_Priority_Policy (*this),
122 CORBA::NO_MEMORY ());
124 return servant;
127 void
128 TAO_Server_Network_Priority_Policy::destroy ()
132 TAO_Cached_Policy_Type
133 TAO_Server_Network_Priority_Policy::_tao_cached_type () const
135 return TAO_CACHED_POLICY_NETWORK_PRIORITY;
138 TAO_Policy_Scope
139 TAO_Server_Network_Priority_Policy::_tao_scope () const
141 return static_cast<TAO_Policy_Scope> (TAO_POLICY_DEFAULT_SCOPE |
142 TAO_POLICY_CLIENT_EXPOSED);
145 CORBA::Boolean
146 TAO_Server_Network_Priority_Policy::_tao_encode (TAO_OutputCDR &out_cdr)
148 return ((out_cdr << request_diffserv_codepoint_) &&
149 (out_cdr << reply_diffserv_codepoint_) &&
150 (out_cdr << network_priority_model_));
153 CORBA::Boolean
154 TAO_Server_Network_Priority_Policy::_tao_decode (TAO_InputCDR &in_cdr)
156 return ((in_cdr >> request_diffserv_codepoint_) &&
157 (in_cdr >> reply_diffserv_codepoint_) &&
158 (in_cdr >> network_priority_model_));
161 TAO_END_VERSIONED_NAMESPACE_DECL