Use =default for skeleton copy constructor
[ACE_TAO.git] / TAO / tao / ZIOP / ZIOP_Policy_i.cpp
blob7000776893ca958bf5c744f085d3eda68db95162
1 #include "tao/ZIOP/ZIOP_Policy_i.h"
2 #include "tao/CDR.h"
3 #include "tao/Stub.h"
4 #include "tao/debug.h"
5 #include "tao/ORB_Constants.h"
7 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
9 namespace TAO
11 CompressorIdLevelListPolicy::CompressorIdLevelListPolicy (
12 const ::Compression::CompressorIdLevelList& val)
13 : ::CORBA::Object ()
14 , ::CORBA::Policy ()
15 , ::ZIOP::CompressorIdLevelListPolicy ()
16 , ::CORBA::LocalObject ()
17 , value_ (val)
21 CompressorIdLevelListPolicy::CompressorIdLevelListPolicy ()
22 : ::CORBA::Object ()
23 , ::CORBA::Policy ()
24 , ::ZIOP::CompressorIdLevelListPolicy ()
25 , ::CORBA::LocalObject ()
26 , value_ (0)
30 CompressorIdLevelListPolicy::CompressorIdLevelListPolicy (const CompressorIdLevelListPolicy &rhs)
31 : ::CORBA::Object ()
32 , ::CORBA::Policy ()
33 , ::ZIOP::CompressorIdLevelListPolicy ()
34 , ::CORBA::LocalObject ()
35 , value_ (rhs.value_)
39 CORBA::PolicyType
40 CompressorIdLevelListPolicy::policy_type ()
42 // Future policy implementors: notice how this minimizes the
43 // footprint of the class.
44 return ZIOP::COMPRESSOR_ID_LEVEL_LIST_POLICY_ID;
48 CompressorIdLevelListPolicy *
49 CompressorIdLevelListPolicy::clone () const
51 CompressorIdLevelListPolicy *copy = 0;
52 ACE_NEW_RETURN (copy,
53 CompressorIdLevelListPolicy (*this),
54 0);
55 return copy;
58 CORBA::Policy_ptr
59 CompressorIdLevelListPolicy::copy ()
61 CompressorIdLevelListPolicy* tmp = 0;
62 ACE_NEW_THROW_EX (tmp, CompressorIdLevelListPolicy (*this),
63 CORBA::NO_MEMORY (TAO::VMCID,
64 CORBA::COMPLETED_NO));
66 return tmp;
69 void
70 CompressorIdLevelListPolicy::destroy ()
74 ::Compression::CompressorIdLevelList *
75 CompressorIdLevelListPolicy::compressor_ids ()
77 return &this->value_;
80 TAO_Cached_Policy_Type
81 CompressorIdLevelListPolicy::_tao_cached_type () const
83 return TAO_CACHED_COMPRESSION_ID_LEVEL_LIST_POLICY;
86 TAO_Policy_Scope
87 CompressorIdLevelListPolicy::_tao_scope () const
89 return static_cast<TAO_Policy_Scope> (TAO_POLICY_DEFAULT_SCOPE |
90 TAO_POLICY_CLIENT_EXPOSED);
93 CORBA::Boolean
94 CompressorIdLevelListPolicy::_tao_encode (TAO_OutputCDR &out_cdr)
96 return out_cdr << this->value_;
99 CORBA::Boolean
100 CompressorIdLevelListPolicy::_tao_decode (TAO_InputCDR &in_cdr)
102 return in_cdr >> this->value_;
105 CompressionEnablingPolicy::CompressionEnablingPolicy (
106 const ::CORBA::Boolean val)
107 : ::CORBA::Object ()
108 , ::CORBA::Policy ()
109 , ::ZIOP::CompressionEnablingPolicy ()
110 , ::CORBA::LocalObject ()
111 , value_ (val)
115 CompressionEnablingPolicy::CompressionEnablingPolicy ()
116 : ::CORBA::Object ()
117 , ::CORBA::Policy ()
118 , ::ZIOP::CompressionEnablingPolicy ()
119 , ::CORBA::LocalObject ()
120 , value_ (false)
124 CompressionEnablingPolicy::CompressionEnablingPolicy (const CompressionEnablingPolicy &rhs)
125 : ::CORBA::Object ()
126 , ::CORBA::Policy ()
127 , ::ZIOP::CompressionEnablingPolicy ()
128 , ::CORBA::LocalObject ()
129 , value_ (rhs.value_)
133 CORBA::PolicyType
134 CompressionEnablingPolicy::policy_type ()
136 // Future policy implementors: notice how this minimizes the
137 // footprint of the class.
138 return ZIOP::COMPRESSION_ENABLING_POLICY_ID;
142 CompressionEnablingPolicy *
143 CompressionEnablingPolicy::clone () const
145 CompressionEnablingPolicy *copy = 0;
146 ACE_NEW_RETURN (copy,
147 CompressionEnablingPolicy (*this),
149 return copy;
152 CORBA::Policy_ptr
153 CompressionEnablingPolicy::copy ()
155 // Future policy implementors: notice how the following code is
156 // exception safe!
158 CompressionEnablingPolicy* tmp = 0;
159 ACE_NEW_THROW_EX (tmp, CompressionEnablingPolicy (*this),
160 CORBA::NO_MEMORY (TAO::VMCID,
161 CORBA::COMPLETED_NO));
163 return tmp;
166 void
167 CompressionEnablingPolicy::destroy ()
171 ::CORBA::Boolean
172 CompressionEnablingPolicy::compression_enabled ()
174 return this->value_;
178 TAO_Cached_Policy_Type
179 CompressionEnablingPolicy::_tao_cached_type () const
181 return TAO_CACHED_COMPRESSION_ENABLING_POLICY;
184 TAO_Policy_Scope
185 CompressionEnablingPolicy::_tao_scope () const
187 return static_cast<TAO_Policy_Scope> (TAO_POLICY_DEFAULT_SCOPE |
188 TAO_POLICY_CLIENT_EXPOSED);
191 CORBA::Boolean
192 CompressionEnablingPolicy::_tao_encode (TAO_OutputCDR &out_cdr)
194 return out_cdr << ACE_OutputCDR::from_boolean (this->value_);
197 CORBA::Boolean
198 CompressionEnablingPolicy::_tao_decode (TAO_InputCDR &in_cdr)
200 return in_cdr >> ACE_InputCDR::to_boolean (this->value_);
203 CompressionLowValuePolicy::CompressionLowValuePolicy (
204 const ::CORBA::ULong val)
205 : ::CORBA::Object ()
206 , ::CORBA::Policy ()
207 , ::ZIOP::CompressionLowValuePolicy ()
208 , ::CORBA::LocalObject ()
209 , value_ (val)
213 CompressionLowValuePolicy::CompressionLowValuePolicy (const CompressionLowValuePolicy &rhs)
214 : ::CORBA::Object ()
215 , ::CORBA::Policy ()
216 , ::ZIOP::CompressionLowValuePolicy ()
217 , ::CORBA::LocalObject ()
218 , value_ (rhs.value_)
222 CORBA::PolicyType
223 CompressionLowValuePolicy::policy_type ()
225 // Future policy implementors: notice how this minimizes the
226 // footprint of the class.
227 return ZIOP::COMPRESSION_LOW_VALUE_POLICY_ID;
231 CompressionLowValuePolicy *
232 CompressionLowValuePolicy::clone () const
234 CompressionLowValuePolicy *copy = 0;
235 ACE_NEW_RETURN (copy,
236 CompressionLowValuePolicy (*this),
238 return copy;
241 CORBA::Policy_ptr
242 CompressionLowValuePolicy::copy ()
244 // Future policy implementors: notice how the following code is
245 // exception safe!
247 CompressionLowValuePolicy* tmp = 0;
248 ACE_NEW_THROW_EX (tmp, CompressionLowValuePolicy (*this),
249 CORBA::NO_MEMORY (TAO::VMCID,
250 CORBA::COMPLETED_NO));
252 return tmp;
255 void
256 CompressionLowValuePolicy::destroy ()
260 ::CORBA::ULong
261 CompressionLowValuePolicy::low_value ()
263 return this->value_;
267 TAO_Cached_Policy_Type
268 CompressionLowValuePolicy::_tao_cached_type () const
270 return TAO_CACHED_COMPRESSION_LOW_VALUE_POLICY;
273 CompressionMinRatioPolicy::CompressionMinRatioPolicy (
274 const ::Compression::CompressionRatio val)
275 : ::CORBA::Object ()
276 , ::CORBA::Policy ()
277 , ::ZIOP::CompressionMinRatioPolicy ()
278 , ::CORBA::LocalObject ()
279 , value_ (val)
283 CompressionMinRatioPolicy::CompressionMinRatioPolicy (const CompressionMinRatioPolicy &rhs)
284 : ::CORBA::Object ()
285 , ::CORBA::Policy ()
286 , ::ZIOP::CompressionMinRatioPolicy ()
287 , ::CORBA::LocalObject ()
288 , value_ (rhs.value_)
292 CORBA::PolicyType
293 CompressionMinRatioPolicy::policy_type ()
295 // Future policy implementors: notice how this minimizes the
296 // footprint of the class.
297 return ZIOP::COMPRESSION_MIN_RATIO_POLICY_ID;
301 CompressionMinRatioPolicy *
302 CompressionMinRatioPolicy::clone () const
304 CompressionMinRatioPolicy *copy = 0;
305 ACE_NEW_RETURN (copy,
306 CompressionMinRatioPolicy (*this),
308 return copy;
311 CORBA::Policy_ptr
312 CompressionMinRatioPolicy::copy ()
314 // Future policy implementors: notice how the following code is
315 // exception safe!
317 CompressionMinRatioPolicy* tmp = 0;
318 ACE_NEW_THROW_EX (tmp, CompressionMinRatioPolicy (*this),
319 CORBA::NO_MEMORY (TAO::VMCID,
320 CORBA::COMPLETED_NO));
322 return tmp;
325 void
326 CompressionMinRatioPolicy::destroy ()
330 ::Compression::CompressionRatio
331 CompressionMinRatioPolicy::ratio ()
333 return this->value_;
337 TAO_Cached_Policy_Type
338 CompressionMinRatioPolicy::_tao_cached_type () const
340 return TAO_CACHED_MIN_COMPRESSION_RATIO_POLICY;
344 TAO_END_VERSIONED_NAMESPACE_DECL