Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tao / DynamicInterface / DII_Arguments.cpp
blob7ca4ea488b9e5445b3a4b168f5258a643a98a0b6
1 #include "tao/DynamicInterface/DII_Arguments.h"
2 #include "tao/AnyTypeCode/NVList.h"
3 #include "tao/AnyTypeCode/Any_Impl.h"
4 #include "tao/AnyTypeCode/DynamicC.h"
5 #include "tao/Exception.h"
6 #include "tao/CDR.h"
8 #if !defined (__ACE_INLINE__)
9 # include "tao/DynamicInterface/DII_Arguments.inl"
10 #endif /* ! __ACE_INLINE__ */
12 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
14 namespace TAO
16 CORBA::Boolean
17 NamedValue_Argument::demarshal (TAO_InputCDR &cdr)
19 try
21 if (this->x_ !=0 && this->x_->value ()->impl ())
23 this->x_->value ()->impl ()->_tao_decode (cdr);
26 catch (const ::CORBA::Exception&)
28 return false;
31 this->byte_order_ = cdr.byte_order ();
33 return true;
36 void
37 NamedValue_Argument::interceptor_value (CORBA::Any *any) const
39 (*any) <<= *this->x_->value ();
42 // ========================================================================
44 CORBA::Boolean
45 NVList_Argument::marshal (TAO_OutputCDR &cdr)
47 try
49 this->x_->_tao_encode (cdr, CORBA::ARG_IN | CORBA::ARG_INOUT);
51 catch (const ::CORBA::Exception&)
53 return false;
56 return true;
59 CORBA::Boolean
60 NVList_Argument::demarshal (TAO_InputCDR &cdr)
62 try
64 // Now, get all the "return", "out", and "inout" parameters
65 // from the response message body ... return parameter is
66 // first, the rest are in the order defined in the IDL spec
67 // (which is also the order that DII users are required to
68 // use).
70 this->x_->_tao_incoming_cdr (
71 cdr,
72 CORBA::ARG_OUT | CORBA::ARG_INOUT,
73 this->lazy_evaluation_);
75 catch (const ::CORBA::Exception&)
77 return false;
80 return true;
83 void
84 NVList_Argument::interceptor_paramlist (Dynamic::ParameterList *lst)
86 CORBA::ULong const len = this->x_->count ();
87 lst->length (len);
89 for (CORBA::ULong i = 0; i < len; ++i)
91 if (!this->x_->item (i)->value ())
92 return;
94 (*lst)[i].argument.replace (this->x_->item (i)->value ()->impl ());
96 switch (this->x_->item (i)->flags ())
98 case CORBA::ARG_IN:
100 (*lst)[i].mode = CORBA::PARAM_IN;
101 break;
103 case CORBA::ARG_INOUT:
105 (*lst)[i].mode = CORBA::PARAM_INOUT;
106 break;
108 case CORBA::ARG_OUT:
110 (*lst)[i].mode = CORBA::PARAM_OUT;
111 break;
113 default:
114 break;
120 TAO_END_VERSIONED_NAMESPACE_DECL