Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tao / BiDir_GIOP / BiDir_Policy_i.cpp
blobaa0fe3a97cc8d6201d1979fc97dc15635587b2ea
1 #include "tao/BiDir_GIOP/BiDir_Policy_i.h"
3 #include "tao/Stub.h"
4 #include "tao/debug.h"
5 #include "tao/ORB_Constants.h"
7 #include "ace/CORBA_macros.h"
9 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
11 TAO_BidirectionalPolicy::TAO_BidirectionalPolicy (
12 const BiDirPolicy::BidirectionalPolicyValue val)
13 : ::CORBA::Object ()
14 , ::CORBA::Policy ()
15 , ::BiDirPolicy::BidirectionalPolicy ()
16 , ::CORBA::LocalObject ()
17 , value_ (val)
21 TAO_BidirectionalPolicy::TAO_BidirectionalPolicy (const TAO_BidirectionalPolicy &rhs)
22 : ::CORBA::Object ()
23 , ::CORBA::Policy ()
24 , ::BiDirPolicy::BidirectionalPolicy ()
25 , ::CORBA::LocalObject ()
26 , value_ (rhs.value_)
30 CORBA::PolicyType
31 TAO_BidirectionalPolicy::policy_type ()
33 // Future policy implementors: notice how this minimizes the
34 // footprint of the class.
35 return BiDirPolicy::BIDIRECTIONAL_POLICY_TYPE;
39 TAO_BidirectionalPolicy *
40 TAO_BidirectionalPolicy::clone () const
42 TAO_BidirectionalPolicy *copy = nullptr;
43 ACE_NEW_RETURN (copy,
44 TAO_BidirectionalPolicy (*this),
45 nullptr);
46 return copy;
49 CORBA::Policy_ptr
50 TAO_BidirectionalPolicy::copy ()
52 // Future policy implementors: notice how the following code is
53 // exception safe!
54 TAO_BidirectionalPolicy* tmp = nullptr;
55 ACE_NEW_THROW_EX (tmp, TAO_BidirectionalPolicy (*this),
56 CORBA::NO_MEMORY (TAO::VMCID,
57 CORBA::COMPLETED_NO));
59 return tmp;
62 void
63 TAO_BidirectionalPolicy::destroy ()
67 BiDirPolicy::BidirectionalPolicyValue
68 TAO_BidirectionalPolicy::value ()
70 return this->value_;
74 TAO_Cached_Policy_Type
75 TAO_BidirectionalPolicy::_tao_cached_type () const
77 return TAO_CACHED_POLICY_BIDIRECTIONAL_GIOP;
80 TAO_END_VERSIONED_NAMESPACE_DECL