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 ()
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
)
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
)
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_
)
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 (),
52 CORBA::SystemException::_tao_minor_code (
55 CORBA::COMPLETED_NO
));
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;
71 TAO_Client_Network_Priority_Policy (*this),
76 TAO::DiffservCodepoint
77 TAO_Client_Network_Priority_Policy::request_diffserv_codepoint ()
79 return this->request_diffserv_codepoint_
;
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_
;
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_
;
109 TAO_Client_Network_Priority_Policy::network_priority_model (
110 TAO::NetworkPriorityModel npm
)
112 this->network_priority_model_
= npm
;
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 ());
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
;
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