00001
00002
00003 #include "tao/ZIOP/ZIOP_Policy_i.h"
00004
00005 #include "tao/CDR.h"
00006 #include "tao/Stub.h"
00007 #include "tao/debug.h"
00008 #include "tao/ORB_Constants.h"
00009
00010 ACE_RCSID (ZIOP,
00011 ZIOP_Policy_i,
00012 "$Id: ZIOP_Policy_i.cpp 84803 2009-03-12 07:52:59Z msmit $")
00013
00014 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00015
00016 namespace TAO
00017 {
00018 CompressorIdLevelListPolicy::CompressorIdLevelListPolicy (
00019 const ::Compression::CompressorIdLevelList& val)
00020 : ::CORBA::Object ()
00021 , ::CORBA::Policy ()
00022 , ::ZIOP::CompressorIdLevelListPolicy ()
00023 , ::CORBA::LocalObject ()
00024 , value_ (val)
00025 {
00026 }
00027
00028 CompressorIdLevelListPolicy::CompressorIdLevelListPolicy (void)
00029 : ::CORBA::Object ()
00030 , ::CORBA::Policy ()
00031 , ::ZIOP::CompressorIdLevelListPolicy ()
00032 , ::CORBA::LocalObject ()
00033 , value_ (0)
00034 {
00035 }
00036
00037 CompressorIdLevelListPolicy::CompressorIdLevelListPolicy (const CompressorIdLevelListPolicy &rhs)
00038 : ::CORBA::Object ()
00039 , ::CORBA::Policy ()
00040 , ::ZIOP::CompressorIdLevelListPolicy ()
00041 , ::CORBA::LocalObject ()
00042 , value_ (rhs.value_)
00043 {
00044 }
00045
00046 CORBA::PolicyType
00047 CompressorIdLevelListPolicy::policy_type (void)
00048 {
00049
00050
00051 return ZIOP::COMPRESSOR_ID_LEVEL_LIST_POLICY_ID;
00052 }
00053
00054
00055 CompressorIdLevelListPolicy *
00056 CompressorIdLevelListPolicy::clone (void) const
00057 {
00058 CompressorIdLevelListPolicy *copy = 0;
00059 ACE_NEW_RETURN (copy,
00060 CompressorIdLevelListPolicy (*this),
00061 0);
00062 return copy;
00063 }
00064
00065 CORBA::Policy_ptr
00066 CompressorIdLevelListPolicy::copy (void)
00067 {
00068 CompressorIdLevelListPolicy* tmp = 0;
00069 ACE_NEW_THROW_EX (tmp, CompressorIdLevelListPolicy (*this),
00070 CORBA::NO_MEMORY (TAO::VMCID,
00071 CORBA::COMPLETED_NO));
00072
00073 return tmp;
00074 }
00075
00076 void
00077 CompressorIdLevelListPolicy::destroy (void)
00078 {
00079 }
00080
00081 ::Compression::CompressorIdLevelList *
00082 CompressorIdLevelListPolicy::compressor_ids (void)
00083 {
00084 return &this->value_;
00085 }
00086
00087 TAO_Cached_Policy_Type
00088 CompressorIdLevelListPolicy::_tao_cached_type (void) const
00089 {
00090 return TAO_CACHED_COMPRESSION_ID_LEVEL_LIST_POLICY;
00091 }
00092
00093 TAO_Policy_Scope
00094 CompressorIdLevelListPolicy::_tao_scope (void) const
00095 {
00096 return static_cast<TAO_Policy_Scope> (TAO_POLICY_DEFAULT_SCOPE |
00097 TAO_POLICY_CLIENT_EXPOSED);
00098 }
00099
00100 CORBA::Boolean
00101 CompressorIdLevelListPolicy::_tao_encode (TAO_OutputCDR &out_cdr)
00102 {
00103 return out_cdr << this->value_;
00104 }
00105
00106 CORBA::Boolean
00107 CompressorIdLevelListPolicy::_tao_decode (TAO_InputCDR &in_cdr)
00108 {
00109 return in_cdr >> this->value_;
00110 }
00111
00112 CompressionEnablingPolicy::CompressionEnablingPolicy (
00113 const ::CORBA::Boolean val)
00114 : ::CORBA::Object ()
00115 , ::CORBA::Policy ()
00116 , ::ZIOP::CompressionEnablingPolicy ()
00117 , ::CORBA::LocalObject ()
00118 , value_ (val)
00119 {
00120 }
00121
00122 CompressionEnablingPolicy::CompressionEnablingPolicy (void)
00123 : ::CORBA::Object ()
00124 , ::CORBA::Policy ()
00125 , ::ZIOP::CompressionEnablingPolicy ()
00126 , ::CORBA::LocalObject ()
00127 , value_ (false)
00128 {
00129 }
00130
00131 CompressionEnablingPolicy::CompressionEnablingPolicy (const CompressionEnablingPolicy &rhs)
00132 : ::CORBA::Object ()
00133 , ::CORBA::Policy ()
00134 , ::ZIOP::CompressionEnablingPolicy ()
00135 , ::CORBA::LocalObject ()
00136 , value_ (rhs.value_)
00137 {
00138 }
00139
00140 CORBA::PolicyType
00141 CompressionEnablingPolicy::policy_type (void)
00142 {
00143
00144
00145 return ZIOP::COMPRESSION_ENABLING_POLICY_ID;
00146 }
00147
00148
00149 CompressionEnablingPolicy *
00150 CompressionEnablingPolicy::clone (void) const
00151 {
00152 CompressionEnablingPolicy *copy = 0;
00153 ACE_NEW_RETURN (copy,
00154 CompressionEnablingPolicy (*this),
00155 0);
00156 return copy;
00157 }
00158
00159 CORBA::Policy_ptr
00160 CompressionEnablingPolicy::copy (void)
00161 {
00162
00163
00164
00165 CompressionEnablingPolicy* tmp = 0;
00166 ACE_NEW_THROW_EX (tmp, CompressionEnablingPolicy (*this),
00167 CORBA::NO_MEMORY (TAO::VMCID,
00168 CORBA::COMPLETED_NO));
00169
00170 return tmp;
00171 }
00172
00173 void
00174 CompressionEnablingPolicy::destroy (void)
00175 {
00176 }
00177
00178 ::CORBA::Boolean
00179 CompressionEnablingPolicy::compression_enabled (void)
00180 {
00181 return this->value_;
00182 }
00183
00184
00185 TAO_Cached_Policy_Type
00186 CompressionEnablingPolicy::_tao_cached_type (void) const
00187 {
00188 return TAO_CACHED_COMPRESSION_ENABLING_POLICY;
00189 }
00190
00191 TAO_Policy_Scope
00192 CompressionEnablingPolicy::_tao_scope (void) const
00193 {
00194 return static_cast<TAO_Policy_Scope> (TAO_POLICY_DEFAULT_SCOPE |
00195 TAO_POLICY_CLIENT_EXPOSED);
00196 }
00197
00198 CORBA::Boolean
00199 CompressionEnablingPolicy::_tao_encode (TAO_OutputCDR &out_cdr)
00200 {
00201 return out_cdr << ACE_OutputCDR::from_boolean (this->value_);
00202 }
00203
00204 CORBA::Boolean
00205 CompressionEnablingPolicy::_tao_decode (TAO_InputCDR &in_cdr)
00206 {
00207 return in_cdr >> ACE_InputCDR::to_boolean (this->value_);
00208 }
00209
00210 CompressionLowValuePolicy::CompressionLowValuePolicy (
00211 const ::CORBA::ULong val)
00212 : ::CORBA::Object ()
00213 , ::CORBA::Policy ()
00214 , ::ZIOP::CompressionLowValuePolicy ()
00215 , ::CORBA::LocalObject ()
00216 , value_ (val)
00217 {
00218 }
00219
00220 CompressionLowValuePolicy::CompressionLowValuePolicy (const CompressionLowValuePolicy &rhs)
00221 : ::CORBA::Object ()
00222 , ::CORBA::Policy ()
00223 , ::ZIOP::CompressionLowValuePolicy ()
00224 , ::CORBA::LocalObject ()
00225 , value_ (rhs.value_)
00226 {
00227 }
00228
00229 CORBA::PolicyType
00230 CompressionLowValuePolicy::policy_type (void)
00231 {
00232
00233
00234 return ZIOP::COMPRESSION_LOW_VALUE_POLICY_ID;
00235 }
00236
00237
00238 CompressionLowValuePolicy *
00239 CompressionLowValuePolicy::clone (void) const
00240 {
00241 CompressionLowValuePolicy *copy = 0;
00242 ACE_NEW_RETURN (copy,
00243 CompressionLowValuePolicy (*this),
00244 0);
00245 return copy;
00246 }
00247
00248 CORBA::Policy_ptr
00249 CompressionLowValuePolicy::copy (void)
00250 {
00251
00252
00253
00254 CompressionLowValuePolicy* tmp = 0;
00255 ACE_NEW_THROW_EX (tmp, CompressionLowValuePolicy (*this),
00256 CORBA::NO_MEMORY (TAO::VMCID,
00257 CORBA::COMPLETED_NO));
00258
00259 return tmp;
00260 }
00261
00262 void
00263 CompressionLowValuePolicy::destroy (void)
00264 {
00265 }
00266
00267 ::CORBA::ULong
00268 CompressionLowValuePolicy::low_value (void)
00269 {
00270 return this->value_;
00271 }
00272
00273
00274 TAO_Cached_Policy_Type
00275 CompressionLowValuePolicy::_tao_cached_type (void) const
00276 {
00277 return TAO_CACHED_COMPRESSION_LOW_VALUE_POLICY;
00278 }
00279
00280 CompressionMinRatioPolicy::CompressionMinRatioPolicy (
00281 const ::Compression::CompressionRatio val)
00282 : ::CORBA::Object ()
00283 , ::CORBA::Policy ()
00284 , ::ZIOP::CompressionMinRatioPolicy ()
00285 , ::CORBA::LocalObject ()
00286 , value_ (val)
00287 {
00288 }
00289
00290 CompressionMinRatioPolicy::CompressionMinRatioPolicy (const CompressionMinRatioPolicy &rhs)
00291 : ::CORBA::Object ()
00292 , ::CORBA::Policy ()
00293 , ::ZIOP::CompressionMinRatioPolicy ()
00294 , ::CORBA::LocalObject ()
00295 , value_ (rhs.value_)
00296 {
00297 }
00298
00299 CORBA::PolicyType
00300 CompressionMinRatioPolicy::policy_type (void)
00301 {
00302
00303
00304 return ZIOP::COMPRESSION_MIN_RATIO_POLICY_ID;
00305 }
00306
00307
00308 CompressionMinRatioPolicy *
00309 CompressionMinRatioPolicy::clone (void) const
00310 {
00311 CompressionMinRatioPolicy *copy = 0;
00312 ACE_NEW_RETURN (copy,
00313 CompressionMinRatioPolicy (*this),
00314 0);
00315 return copy;
00316 }
00317
00318 CORBA::Policy_ptr
00319 CompressionMinRatioPolicy::copy (void)
00320 {
00321
00322
00323
00324 CompressionMinRatioPolicy* tmp = 0;
00325 ACE_NEW_THROW_EX (tmp, CompressionMinRatioPolicy (*this),
00326 CORBA::NO_MEMORY (TAO::VMCID,
00327 CORBA::COMPLETED_NO));
00328
00329 return tmp;
00330 }
00331
00332 void
00333 CompressionMinRatioPolicy::destroy (void)
00334 {
00335 }
00336
00337 ::Compression::CompressionRatio
00338 CompressionMinRatioPolicy::ratio (void)
00339 {
00340 return this->value_;
00341 }
00342
00343
00344 TAO_Cached_Policy_Type
00345 CompressionMinRatioPolicy::_tao_cached_type (void) const
00346 {
00347 return TAO_CACHED_MIN_COMPRESSION_RATIO_POLICY;
00348 }
00349
00350 }
00351 TAO_END_VERSIONED_NAMESPACE_DECL
00352