1 #include "tao/ZIOP/ZIOP_Policy_i.h"
5 #include "tao/ORB_Constants.h"
7 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
11 CompressorIdLevelListPolicy::CompressorIdLevelListPolicy (
12 const ::Compression::CompressorIdLevelList
& val
)
15 , ::ZIOP::CompressorIdLevelListPolicy ()
16 , ::CORBA::LocalObject ()
21 CompressorIdLevelListPolicy::CompressorIdLevelListPolicy ()
24 , ::ZIOP::CompressorIdLevelListPolicy ()
25 , ::CORBA::LocalObject ()
30 CompressorIdLevelListPolicy::CompressorIdLevelListPolicy (const CompressorIdLevelListPolicy
&rhs
)
33 , ::ZIOP::CompressorIdLevelListPolicy ()
34 , ::CORBA::LocalObject ()
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;
53 CompressorIdLevelListPolicy (*this),
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
));
70 CompressorIdLevelListPolicy::destroy ()
74 ::Compression::CompressorIdLevelList
*
75 CompressorIdLevelListPolicy::compressor_ids ()
80 TAO_Cached_Policy_Type
81 CompressorIdLevelListPolicy::_tao_cached_type () const
83 return TAO_CACHED_COMPRESSION_ID_LEVEL_LIST_POLICY
;
87 CompressorIdLevelListPolicy::_tao_scope () const
89 return static_cast<TAO_Policy_Scope
> (TAO_POLICY_DEFAULT_SCOPE
|
90 TAO_POLICY_CLIENT_EXPOSED
);
94 CompressorIdLevelListPolicy::_tao_encode (TAO_OutputCDR
&out_cdr
)
96 return out_cdr
<< this->value_
;
100 CompressorIdLevelListPolicy::_tao_decode (TAO_InputCDR
&in_cdr
)
102 return in_cdr
>> this->value_
;
105 CompressionEnablingPolicy::CompressionEnablingPolicy (
106 const ::CORBA::Boolean val
)
109 , ::ZIOP::CompressionEnablingPolicy ()
110 , ::CORBA::LocalObject ()
115 CompressionEnablingPolicy::CompressionEnablingPolicy ()
118 , ::ZIOP::CompressionEnablingPolicy ()
119 , ::CORBA::LocalObject ()
124 CompressionEnablingPolicy::CompressionEnablingPolicy (const CompressionEnablingPolicy
&rhs
)
127 , ::ZIOP::CompressionEnablingPolicy ()
128 , ::CORBA::LocalObject ()
129 , value_ (rhs
.value_
)
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),
153 CompressionEnablingPolicy::copy ()
155 // Future policy implementors: notice how the following code is
158 CompressionEnablingPolicy
* tmp
= 0;
159 ACE_NEW_THROW_EX (tmp
, CompressionEnablingPolicy (*this),
160 CORBA::NO_MEMORY (TAO::VMCID
,
161 CORBA::COMPLETED_NO
));
167 CompressionEnablingPolicy::destroy ()
172 CompressionEnablingPolicy::compression_enabled ()
178 TAO_Cached_Policy_Type
179 CompressionEnablingPolicy::_tao_cached_type () const
181 return TAO_CACHED_COMPRESSION_ENABLING_POLICY
;
185 CompressionEnablingPolicy::_tao_scope () const
187 return static_cast<TAO_Policy_Scope
> (TAO_POLICY_DEFAULT_SCOPE
|
188 TAO_POLICY_CLIENT_EXPOSED
);
192 CompressionEnablingPolicy::_tao_encode (TAO_OutputCDR
&out_cdr
)
194 return out_cdr
<< ACE_OutputCDR::from_boolean (this->value_
);
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
)
207 , ::ZIOP::CompressionLowValuePolicy ()
208 , ::CORBA::LocalObject ()
213 CompressionLowValuePolicy::CompressionLowValuePolicy (const CompressionLowValuePolicy
&rhs
)
216 , ::ZIOP::CompressionLowValuePolicy ()
217 , ::CORBA::LocalObject ()
218 , value_ (rhs
.value_
)
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),
242 CompressionLowValuePolicy::copy ()
244 // Future policy implementors: notice how the following code is
247 CompressionLowValuePolicy
* tmp
= 0;
248 ACE_NEW_THROW_EX (tmp
, CompressionLowValuePolicy (*this),
249 CORBA::NO_MEMORY (TAO::VMCID
,
250 CORBA::COMPLETED_NO
));
256 CompressionLowValuePolicy::destroy ()
261 CompressionLowValuePolicy::low_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
)
277 , ::ZIOP::CompressionMinRatioPolicy ()
278 , ::CORBA::LocalObject ()
283 CompressionMinRatioPolicy::CompressionMinRatioPolicy (const CompressionMinRatioPolicy
&rhs
)
286 , ::ZIOP::CompressionMinRatioPolicy ()
287 , ::CORBA::LocalObject ()
288 , value_ (rhs
.value_
)
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),
312 CompressionMinRatioPolicy::copy ()
314 // Future policy implementors: notice how the following code is
317 CompressionMinRatioPolicy
* tmp
= 0;
318 ACE_NEW_THROW_EX (tmp
, CompressionMinRatioPolicy (*this),
319 CORBA::NO_MEMORY (TAO::VMCID
,
320 CORBA::COMPLETED_NO
));
326 CompressionMinRatioPolicy::destroy ()
330 ::Compression::CompressionRatio
331 CompressionMinRatioPolicy::ratio ()
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