diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2008-07-22 11:34:18 +0000 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2008-07-22 11:34:18 +0000 |
commit | 402b3a1ec291d92dd436c0248c9bb0f3ce62c82b (patch) | |
tree | 3cacdd80884731dd236f6a4711f0337ea9b0d50e /TAO/tao/ZIOP/ZIOP_Policy_i.cpp | |
parent | ac6c3a80af06ab93c8a20023a2543da0c71100d0 (diff) | |
download | ATCD-402b3a1ec291d92dd436c0248c9bb0f3ce62c82b.tar.gz |
Tue Jul 22 11:31:28 UTC 2008 Johnny Willemsen <jwillemsen@remedy.nl>
Diffstat (limited to 'TAO/tao/ZIOP/ZIOP_Policy_i.cpp')
-rw-r--r-- | TAO/tao/ZIOP/ZIOP_Policy_i.cpp | 358 |
1 files changed, 358 insertions, 0 deletions
diff --git a/TAO/tao/ZIOP/ZIOP_Policy_i.cpp b/TAO/tao/ZIOP/ZIOP_Policy_i.cpp new file mode 100644 index 00000000000..05bef28edd1 --- /dev/null +++ b/TAO/tao/ZIOP/ZIOP_Policy_i.cpp @@ -0,0 +1,358 @@ +// $Id$ + +#include "tao/ZIOP/ZIOP_Policy_i.h" + +#include "tao/CDR.h" +#include "tao/Stub.h" +#include "tao/debug.h" +#include "tao/ORB_Constants.h" + +ACE_RCSID (ZIOP, + ZIOP_Policy_i, + "$Id$") + +TAO_BEGIN_VERSIONED_NAMESPACE_DECL + +namespace TAO +{ +CompressorIdLevelListPolicy::CompressorIdLevelListPolicy ( + const ::Compression::CompressorIdLevelList& val) + : ::CORBA::Object () + , ::CORBA::Policy () + , ::ZIOP::CompressorIdLevelListPolicy () + , ::CORBA::LocalObject () + , value_ (val) +{ +} + +CompressorIdLevelListPolicy::CompressorIdLevelListPolicy (void) + : ::CORBA::Object () + , ::CORBA::Policy () + , ::ZIOP::CompressorIdLevelListPolicy () + , ::CORBA::LocalObject () + , value_ (0) +{ +} + +CompressorIdLevelListPolicy::CompressorIdLevelListPolicy (const CompressorIdLevelListPolicy &rhs) + : ::CORBA::Object () + , ::CORBA::Policy () + , ::ZIOP::CompressorIdLevelListPolicy () + , ::CORBA::LocalObject () + , value_ (rhs.value_) +{ +} + +CORBA::PolicyType +CompressorIdLevelListPolicy::policy_type (void) +{ + // Future policy implementors: notice how this minimizes the + // footprint of the class. + return ZIOP::COMPRESSOR_ID_LEVEL_LIST_POLICY_ID; +} + + +CompressorIdLevelListPolicy * +CompressorIdLevelListPolicy::clone (void) const +{ + CompressorIdLevelListPolicy *copy = 0; + ACE_NEW_RETURN (copy, + CompressorIdLevelListPolicy (*this), + 0); + return copy; +} + +CORBA::Policy_ptr +CompressorIdLevelListPolicy::copy (void) +{ + CompressorIdLevelListPolicy* tmp = 0; + ACE_NEW_THROW_EX (tmp, CompressorIdLevelListPolicy (*this), + CORBA::NO_MEMORY (TAO::VMCID, + CORBA::COMPLETED_NO)); + + return tmp; +} + +void +CompressorIdLevelListPolicy::destroy (void) +{ +} + +::Compression::CompressorIdLevelList * +CompressorIdLevelListPolicy::compressor_ids (void) +{ + ::Compression::CompressorIdLevelList *tmp = 0; + ACE_NEW_THROW_EX (tmp, + ::Compression::CompressorIdLevelList (this->value_), + CORBA::NO_MEMORY (TAO::VMCID, + CORBA::COMPLETED_NO)); + + return tmp; +} + +TAO_Cached_Policy_Type +CompressorIdLevelListPolicy::_tao_cached_type (void) const +{ + return TAO_CACHED_COMPRESSION_ID_LEVEL_LIST_POLICY; +} + +TAO_Policy_Scope +CompressorIdLevelListPolicy::_tao_scope (void) const +{ + return static_cast<TAO_Policy_Scope> (TAO_POLICY_DEFAULT_SCOPE | + TAO_POLICY_CLIENT_EXPOSED); +} + +CORBA::Boolean +CompressorIdLevelListPolicy::_tao_encode (TAO_OutputCDR &out_cdr) +{ + return out_cdr << this->value_; +} + +CORBA::Boolean +CompressorIdLevelListPolicy::_tao_decode (TAO_InputCDR &in_cdr) +{ + return in_cdr >> this->value_; +} + +CompressionEnablingPolicy::CompressionEnablingPolicy ( + const ::CORBA::Boolean val) + : ::CORBA::Object () + , ::CORBA::Policy () + , ::ZIOP::CompressionEnablingPolicy () + , ::CORBA::LocalObject () + , value_ (val) +{ +} + +CompressionEnablingPolicy::CompressionEnablingPolicy (void) + : ::CORBA::Object () + , ::CORBA::Policy () + , ::ZIOP::CompressionEnablingPolicy () + , ::CORBA::LocalObject () + , value_ (false) +{ +} + +CompressionEnablingPolicy::CompressionEnablingPolicy (const CompressionEnablingPolicy &rhs) + : ::CORBA::Object () + , ::CORBA::Policy () + , ::ZIOP::CompressionEnablingPolicy () + , ::CORBA::LocalObject () + , value_ (rhs.value_) +{ +} + +CORBA::PolicyType +CompressionEnablingPolicy::policy_type (void) +{ + // Future policy implementors: notice how this minimizes the + // footprint of the class. + return ZIOP::COMPRESSION_ENABLING_POLICY_ID; +} + + +CompressionEnablingPolicy * +CompressionEnablingPolicy::clone (void) const +{ + CompressionEnablingPolicy *copy = 0; + ACE_NEW_RETURN (copy, + CompressionEnablingPolicy (*this), + 0); + return copy; +} + +CORBA::Policy_ptr +CompressionEnablingPolicy::copy (void) +{ + // Future policy implementors: notice how the following code is + // exception safe! + + CompressionEnablingPolicy* tmp = 0; + ACE_NEW_THROW_EX (tmp, CompressionEnablingPolicy (*this), + CORBA::NO_MEMORY (TAO::VMCID, + CORBA::COMPLETED_NO)); + + return tmp; +} + +void +CompressionEnablingPolicy::destroy (void) +{ +} + +::CORBA::Boolean +CompressionEnablingPolicy::compression_enabled (void) +{ + return this->value_; +} + + +TAO_Cached_Policy_Type +CompressionEnablingPolicy::_tao_cached_type (void) const +{ + return TAO_CACHED_COMPRESSION_ENABLING_POLICY; +} + +TAO_Policy_Scope +CompressionEnablingPolicy::_tao_scope (void) const +{ + return static_cast<TAO_Policy_Scope> (TAO_POLICY_DEFAULT_SCOPE | + TAO_POLICY_CLIENT_EXPOSED); +} + +CORBA::Boolean +CompressionEnablingPolicy::_tao_encode (TAO_OutputCDR &out_cdr) +{ + return out_cdr << ACE_OutputCDR::from_boolean (this->value_); +} + +CORBA::Boolean +CompressionEnablingPolicy::_tao_decode (TAO_InputCDR &in_cdr) +{ + return in_cdr >> ACE_InputCDR::to_boolean (this->value_); +} + +CompressionLowValuePolicy::CompressionLowValuePolicy ( + const ::CORBA::ULong val) + : ::CORBA::Object () + , ::CORBA::Policy () + , ::ZIOP::CompressionLowValuePolicy () + , ::CORBA::LocalObject () + , value_ (val) +{ +} + +CompressionLowValuePolicy::CompressionLowValuePolicy (const CompressionLowValuePolicy &rhs) + : ::CORBA::Object () + , ::CORBA::Policy () + , ::ZIOP::CompressionLowValuePolicy () + , ::CORBA::LocalObject () + , value_ (rhs.value_) +{ +} + +CORBA::PolicyType +CompressionLowValuePolicy::policy_type (void) +{ + // Future policy implementors: notice how this minimizes the + // footprint of the class. + return ZIOP::COMPRESSION_LOW_VALUE_POLICY_ID; +} + + +CompressionLowValuePolicy * +CompressionLowValuePolicy::clone (void) const +{ + CompressionLowValuePolicy *copy = 0; + ACE_NEW_RETURN (copy, + CompressionLowValuePolicy (*this), + 0); + return copy; +} + +CORBA::Policy_ptr +CompressionLowValuePolicy::copy (void) +{ + // Future policy implementors: notice how the following code is + // exception safe! + + CompressionLowValuePolicy* tmp = 0; + ACE_NEW_THROW_EX (tmp, CompressionLowValuePolicy (*this), + CORBA::NO_MEMORY (TAO::VMCID, + CORBA::COMPLETED_NO)); + + return tmp; +} + +void +CompressionLowValuePolicy::destroy (void) +{ +} + +::CORBA::ULong +CompressionLowValuePolicy::low_value (void) +{ + return this->value_; +} + + +TAO_Cached_Policy_Type +CompressionLowValuePolicy::_tao_cached_type (void) const +{ + return TAO_CACHED_COMPRESSION_LOW_VALUE_POLICY; +} + +CompressionMinRatioPolicy::CompressionMinRatioPolicy ( + const ::CORBA::ULong val) + : ::CORBA::Object () + , ::CORBA::Policy () + , ::ZIOP::CompressionMinRatioPolicy () + , ::CORBA::LocalObject () + , value_ (val) +{ +} + +CompressionMinRatioPolicy::CompressionMinRatioPolicy (const CompressionMinRatioPolicy &rhs) + : ::CORBA::Object () + , ::CORBA::Policy () + , ::ZIOP::CompressionMinRatioPolicy () + , ::CORBA::LocalObject () + , value_ (rhs.value_) +{ +} + +CORBA::PolicyType +CompressionMinRatioPolicy::policy_type (void) +{ + // Future policy implementors: notice how this minimizes the + // footprint of the class. + return ZIOP::COMPRESSION_LOW_VALUE_POLICY_ID; +} + + +CompressionMinRatioPolicy * +CompressionMinRatioPolicy::clone (void) const +{ + CompressionMinRatioPolicy *copy = 0; + ACE_NEW_RETURN (copy, + CompressionMinRatioPolicy (*this), + 0); + return copy; +} + +CORBA::Policy_ptr +CompressionMinRatioPolicy::copy (void) +{ + // Future policy implementors: notice how the following code is + // exception safe! + + CompressionMinRatioPolicy* tmp = 0; + ACE_NEW_THROW_EX (tmp, CompressionMinRatioPolicy (*this), + CORBA::NO_MEMORY (TAO::VMCID, + CORBA::COMPLETED_NO)); + + return tmp; +} + +void +CompressionMinRatioPolicy::destroy (void) +{ +} + +::CORBA::ULong +CompressionMinRatioPolicy::ratio (void) +{ + return this->value_; +} + + +TAO_Cached_Policy_Type +CompressionMinRatioPolicy::_tao_cached_type (void) const +{ + return TAO_CACHED_POLICY_UNCACHED; +} + +} +TAO_END_VERSIONED_NAMESPACE_DECL + |