Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tao / Object_Argument_T.cpp
blobe4a318e7db2bd289651cb779ad0975c25e93c0e8
1 #ifndef TAO_OBJECT_ARGUMENT_T_CPP
2 #define TAO_OBJECT_ARGUMENT_T_CPP
4 #include "tao/Object_Argument_T.h"
6 #if !defined (__ACE_INLINE__)
7 #include "tao/Object_Argument_T.inl"
8 #endif /* __ACE_INLINE__ */
10 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
12 template<typename S_ptr,
13 template <typename> class Insert_Policy>
14 CORBA::Boolean
15 TAO::In_Object_Argument_T<S_ptr,Insert_Policy>::marshal (TAO_OutputCDR &cdr)
17 return cdr << this->x_;
20 #if TAO_HAS_INTERCEPTORS == 1
22 template<typename S_ptr,
23 template <typename> class Insert_Policy>
24 void
25 TAO::In_Object_Argument_T<S_ptr,Insert_Policy>::interceptor_value (CORBA::Any *any) const
27 Insert_Policy<S_ptr>::any_insert (any, this->x_);
30 #endif /* TAO_HAS_INTERCEPTORS */
32 template<typename S_ptr>
33 void
34 TAO::In_Object_Argument_Cloner_T<S_ptr>::duplicate (S_ptr objref)
36 if (objref)
38 objref->_add_ref ();
42 template<typename S_ptr>
43 void
44 TAO::In_Object_Argument_Cloner_T<S_ptr>::release (S_ptr objref)
46 if (objref)
48 objref->_remove_ref ();
52 template<typename S_ptr,
53 template <typename> class Insert_Policy>
54 TAO::In_Object_Clonable_Argument_T<S_ptr,Insert_Policy>::~In_Object_Clonable_Argument_T ()
56 if (this->is_clone_)
58 In_Object_Argument_Cloner_T<S_ptr>::release (this->x_);
62 template<typename S_ptr,
63 template <typename> class Insert_Policy>
64 TAO::Argument*
65 TAO::In_Object_Clonable_Argument_T<S_ptr,Insert_Policy>::clone ()
67 In_Object_Argument_Cloner_T<S_ptr>::duplicate (this->x_);
69 In_Object_Clonable_Argument_T<S_ptr,Insert_Policy>* clone_arg
70 = new In_Object_Clonable_Argument_T<S_ptr,Insert_Policy> (this->x_);
71 clone_arg->is_clone_ = true;
72 return clone_arg;
75 // ===========================================================
77 template<typename S_ptr,
78 typename S_traits,
79 template <typename> class Insert_Policy>
80 CORBA::Boolean
81 TAO::Inout_Object_Argument_T<S_ptr,S_traits,Insert_Policy>::marshal (TAO_OutputCDR &cdr)
83 return cdr << this->x_;
86 template<typename S_ptr,
87 typename S_traits,
88 template <typename> class Insert_Policy>
89 CORBA::Boolean
90 TAO::Inout_Object_Argument_T<S_ptr,S_traits,Insert_Policy>::demarshal (TAO_InputCDR & cdr)
92 S_traits::release (this->x_);
93 return cdr >> this->x_;
96 #if TAO_HAS_INTERCEPTORS == 1
98 template<typename S_ptr,
99 typename S_traits,
100 template <typename> class Insert_Policy>
101 void
102 TAO::Inout_Object_Argument_T<S_ptr,S_traits,Insert_Policy>::interceptor_value (
103 CORBA::Any *any) const
105 Insert_Policy<S_ptr>::any_insert (any, this->x_);
108 #endif /* TAO_HAS_INTERCEPTORS */
110 // ==============================================================
112 template<typename S_ptr,
113 typename S_out,
114 template <typename> class Insert_Policy>
115 CORBA::Boolean
116 TAO::Out_Object_Argument_T<S_ptr,S_out,Insert_Policy>::demarshal (TAO_InputCDR & cdr)
118 return cdr >> this->x_;
121 #if TAO_HAS_INTERCEPTORS == 1
123 template<typename S_ptr,
124 typename S_out,
125 template <typename> class Insert_Policy>
126 void
127 TAO::Out_Object_Argument_T<S_ptr,S_out,Insert_Policy>::interceptor_value (
128 CORBA::Any *any) const
130 Insert_Policy<S_ptr>::any_insert (any, this->x_);
133 #endif /* TAO_HAS_INTERCEPTORS */
135 // ============================================================
137 template<typename S_ptr,
138 typename S_var,
139 template <typename> class Insert_Policy>
140 CORBA::Boolean
141 TAO::Ret_Object_Argument_T<S_ptr,S_var,Insert_Policy>::demarshal (TAO_InputCDR & cdr)
143 return cdr >> this->x_.out ();
146 #if TAO_HAS_INTERCEPTORS == 1
148 template<typename S_ptr,
149 typename S_var,
150 template <typename> class Insert_Policy>
151 void
152 TAO::Ret_Object_Argument_T<S_ptr,S_var,Insert_Policy>::interceptor_value (
153 CORBA::Any *any) const
155 Insert_Policy<S_ptr>::any_insert (any, this->x_.in ());
158 #endif /* TAO_HAS_INTERCEPTORS */
160 TAO_END_VERSIONED_NAMESPACE_DECL
162 #endif /* TAO_OBJECT_ARGUMENT_T_CPP */