Use =default for skeleton copy constructor
[ACE_TAO.git] / TAO / tao / DiffServPolicy / Client_Network_Priority_Policy.cpp
blob20760ca02f4541f6129b2b3bb7867d6160da74bc
1 #include "tao/DiffServPolicy/Client_Network_Priority_Policy.h"
2 #include "tao/ORB_Constants.h"
3 #include "tao/SystemException.h"
5 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
7 TAO_Client_Network_Priority_Policy::TAO_Client_Network_Priority_Policy ()
8 : ::CORBA::Object ()
9 , ::CORBA::Policy ()
10 , TAO::NetworkPriorityPolicy ()
11 , ::CORBA::LocalObject ()
12 , request_diffserv_codepoint_ (0)
13 , reply_diffserv_codepoint_ (0)
14 , network_priority_model_ (TAO::NO_NETWORK_PRIORITY)
18 TAO_Client_Network_Priority_Policy::TAO_Client_Network_Priority_Policy (
19 const TAO::DiffservCodepoint request_diffserv_codepoint,
20 const TAO::DiffservCodepoint reply_diffserv_codepoint,
21 TAO::NetworkPriorityModel network_priority_model)
22 : ::CORBA::Object ()
23 , ::CORBA::Policy ()
24 , TAO::NetworkPriorityPolicy ()
25 , ::CORBA::LocalObject ()
26 , request_diffserv_codepoint_ (request_diffserv_codepoint)
27 , reply_diffserv_codepoint_ (reply_diffserv_codepoint)
28 , network_priority_model_ (network_priority_model)
32 TAO_Client_Network_Priority_Policy::TAO_Client_Network_Priority_Policy (
33 const TAO_Client_Network_Priority_Policy &rhs)
34 : ::CORBA::Object ()
35 , ::CORBA::Policy ()
36 , TAO::NetworkPriorityPolicy ()
37 , ::CORBA::LocalObject ()
38 , request_diffserv_codepoint_ (rhs.request_diffserv_codepoint_)
39 , reply_diffserv_codepoint_ (rhs.reply_diffserv_codepoint_)
40 , network_priority_model_ (rhs.network_priority_model_)
44 CORBA::Policy_ptr
45 TAO_Client_Network_Priority_Policy::create (const CORBA::Any &)
47 CORBA::Policy_ptr policy = CORBA::Policy::_nil ();
49 ACE_NEW_THROW_EX (policy,
50 TAO_Client_Network_Priority_Policy (),
51 CORBA::NO_MEMORY (
52 CORBA::SystemException::_tao_minor_code (
53 TAO::VMCID,
54 ENOMEM),
55 CORBA::COMPLETED_NO));
57 return policy;
60 CORBA::PolicyType
61 TAO_Client_Network_Priority_Policy::policy_type ()
63 return TAO::CLIENT_NETWORK_PRIORITY_TYPE;
66 TAO_Client_Network_Priority_Policy *
67 TAO_Client_Network_Priority_Policy::clone () const
69 TAO_Client_Network_Priority_Policy *copy = 0;
70 ACE_NEW_RETURN (copy,
71 TAO_Client_Network_Priority_Policy (*this),
72 0);
73 return copy;
76 TAO::DiffservCodepoint
77 TAO_Client_Network_Priority_Policy::request_diffserv_codepoint ()
79 return this->request_diffserv_codepoint_;
82 void
83 TAO_Client_Network_Priority_Policy::request_diffserv_codepoint (
84 TAO::DiffservCodepoint req_dscp)
86 this->request_diffserv_codepoint_ = req_dscp;
89 TAO::DiffservCodepoint
90 TAO_Client_Network_Priority_Policy::reply_diffserv_codepoint ()
92 return this->reply_diffserv_codepoint_;
95 void
96 TAO_Client_Network_Priority_Policy::reply_diffserv_codepoint (
97 TAO::DiffservCodepoint reply_dscp)
99 this->reply_diffserv_codepoint_ = reply_dscp;
102 TAO::NetworkPriorityModel
103 TAO_Client_Network_Priority_Policy::network_priority_model ()
105 return this->network_priority_model_;
108 void
109 TAO_Client_Network_Priority_Policy::network_priority_model (
110 TAO::NetworkPriorityModel npm)
112 this->network_priority_model_ = npm;
115 CORBA::Policy_ptr
116 TAO_Client_Network_Priority_Policy::copy ()
118 TAO_Client_Network_Priority_Policy* servant = 0;
119 ACE_NEW_THROW_EX (servant,
120 TAO_Client_Network_Priority_Policy (*this),
121 CORBA::NO_MEMORY ());
123 return servant;
126 void
127 TAO_Client_Network_Priority_Policy::destroy ()
131 TAO_Cached_Policy_Type
132 TAO_Client_Network_Priority_Policy::_tao_cached_type () const
134 return TAO_CACHED_POLICY_CLIENT_NETWORK_PRIORITY;
137 TAO_Policy_Scope
138 TAO_Client_Network_Priority_Policy::_tao_scope () const
140 return static_cast<TAO_Policy_Scope> (TAO_POLICY_DEFAULT_SCOPE |
141 TAO_POLICY_CLIENT_EXPOSED);
144 TAO_END_VERSIONED_NAMESPACE_DECL