Template Any class for IDL types with 2 modes of insertion. More...
#include <Any_Dual_Impl_T.h>


Public Member Functions | |
| Any_Dual_Impl_T (_tao_destructor destructor, CORBA::TypeCode_ptr, T *const) | |
| Any_Dual_Impl_T (_tao_destructor destructor, CORBA::TypeCode_ptr, const T &) | |
| Any_Dual_Impl_T (CORBA::TypeCode_ptr) | |
| virtual | ~Any_Dual_Impl_T (void) |
| virtual CORBA::Boolean | marshal_value (TAO_OutputCDR &) |
| CORBA::Boolean | demarshal_value (TAO_InputCDR &) |
| virtual void | _tao_decode (TAO_InputCDR &) |
| virtual const void * | value (void) const |
| virtual void | free_value (void) |
| template<> | |
| void | value (const CORBA::Exception &val) |
| template<> | |
| CORBA::Boolean | marshal_value (TAO_OutputCDR &cdr) |
| template<> | |
| CORBA::Boolean | demarshal_value (TAO_InputCDR &cdr) |
| template<> | |
| CORBA::Boolean | extract (const CORBA::Any &, _tao_destructor, CORBA::TypeCode_ptr, const CORBA::Exception *&) |
| template<> | |
| CORBA::Boolean | demarshal_value (TAO_InputCDR &cdr) |
| template<> | |
| CORBA::Boolean | demarshal_value (TAO_InputCDR &cdr) |
| template<> | |
| CORBA::Boolean | demarshal_value (TAO_InputCDR &cdr) |
Static Public Member Functions | |
| static void | insert (CORBA::Any &, _tao_destructor, CORBA::TypeCode_ptr, T *const) |
| static void | insert_copy (CORBA::Any &, _tao_destructor destructor, CORBA::TypeCode_ptr, const T &) |
| static CORBA::Boolean | extract (const CORBA::Any &, _tao_destructor, CORBA::TypeCode_ptr, const T *&) |
Protected Member Functions | |
| void | value (const T &) |
Protected Attributes | |
| T * | value_ |
Template Any class for IDL types with 2 modes of insertion.
Used for the IDL types that have copying and non-copying insertion, but which are not (de)marshaled as pointers - struct, union, sequence, and exception.
Definition at line 40 of file Any_Dual_Impl_T.h.
| TAO::Any_Dual_Impl_T< T >::Any_Dual_Impl_T | ( | _tao_destructor | destructor, | |
| CORBA::TypeCode_ptr | tc, | |||
| T * const | val | |||
| ) |
Definition at line 25 of file Any_Dual_Impl_T.cpp.
| TAO::Any_Dual_Impl_T< T >::Any_Dual_Impl_T | ( | _tao_destructor | destructor, | |
| CORBA::TypeCode_ptr | tc, | |||
| const T & | val | |||
| ) |
Definition at line 42 of file Any_Dual_Impl_T.cpp.
| TAO::Any_Dual_Impl_T< T >::Any_Dual_Impl_T | ( | CORBA::TypeCode_ptr | tc | ) |
Definition at line 52 of file Any_Dual_Impl_T.cpp.
: Any_Impl (0, tc) { }
| TAO::Any_Dual_Impl_T< T >::~Any_Dual_Impl_T | ( | void | ) | [virtual] |
Definition at line 59 of file Any_Dual_Impl_T.cpp.
{
}
| void TAO::Any_Dual_Impl_T< T >::_tao_decode | ( | TAO_InputCDR & | cdr | ) | [virtual] |
Reimplemented from TAO::Any_Impl.
Definition at line 203 of file Any_Dual_Impl_T.cpp.
{
if (! this->demarshal_value (cdr))
{
throw ::CORBA::MARSHAL ();
}
}
| CORBA::Boolean TAO::Any_Dual_Impl_T< CORBA::WrongTransaction >::demarshal_value | ( | TAO_InputCDR & | cdr | ) |
Definition at line 70 of file WrongTransactionA.cpp.
{
CORBA::String_var id;
if (!(cdr >> id.out ()))
{
return false;
}
try
{
this->value_->_tao_decode (cdr);
}
catch (const ::CORBA::Exception&)
{
return false;
}
return true;
}
| CORBA::Boolean TAO::Any_Dual_Impl_T< CORBA::InvalidPolicies >::demarshal_value | ( | TAO_InputCDR & | cdr | ) |
Definition at line 234 of file PolicyA.cpp.
{
CORBA::String_var id;
if (!(cdr >> id.out ()))
{
return false;
}
try
{
this->value_->_tao_decode (cdr);
}
catch (const ::CORBA::Exception&)
{
return false;
}
return true;
}
| CORBA::Boolean TAO::Any_Dual_Impl_T< T >::demarshal_value | ( | TAO_InputCDR & | cdr | ) |
Definition at line 11 of file Any_Dual_Impl_T.inl.
{
return (cdr >> *this->value_);
}
| CORBA::Boolean TAO::Any_Dual_Impl_T< CORBA::Exception >::demarshal_value | ( | TAO_InputCDR & | cdr | ) |
Definition at line 39 of file ExceptionA.cpp.
{
this->value_->_tao_encode (cdr);
return true;
}
catch (const ::CORBA::Exception&)
{
}
return false;
}
template<>
CORBA::Boolean
| CORBA::Boolean TAO::Any_Dual_Impl_T< CORBA::PolicyError >::demarshal_value | ( | TAO_InputCDR & | cdr | ) |
Definition at line 148 of file PolicyA.cpp.
{
CORBA::String_var id;
if (!(cdr >> id.out ()))
{
return false;
}
try
{
this->value_->_tao_decode (cdr);
}
catch (const ::CORBA::Exception&)
{
return false;
}
return true;
}
| CORBA::Boolean TAO::Any_Dual_Impl_T< T >::extract | ( | const CORBA::Any & | any, | |
| _tao_destructor | destructor, | |||
| CORBA::TypeCode_ptr | tc, | |||
| const T *& | _tao_elem | |||
| ) | [static] |
Definition at line 95 of file Any_Dual_Impl_T.cpp.
{
_tao_elem = 0;
try
{
CORBA::TypeCode_ptr any_tc = any._tao_get_typecode ();
CORBA::Boolean const _tao_equiv = any_tc->equivalent (tc);
if (_tao_equiv == false)
{
return false;
}
TAO::Any_Impl * const impl = any.impl ();
if (impl && !impl->encoded ())
{
TAO::Any_Dual_Impl_T<T> * const narrow_impl =
dynamic_cast <TAO::Any_Dual_Impl_T<T> *> (impl);
if (narrow_impl == 0)
{
return false;
}
_tao_elem = narrow_impl->value_;
return true;
}
T *empty_value = 0;
ACE_NEW_RETURN (empty_value,
T,
false);
TAO::Any_Dual_Impl_T<T> *replacement = 0;
ACE_NEW_RETURN (replacement,
TAO::Any_Dual_Impl_T<T> (destructor,
any_tc,
empty_value),
false);
auto_ptr<TAO::Any_Dual_Impl_T<T> > replacement_safety (replacement);
// We know this will work since the unencoded case is covered above.
TAO::Unknown_IDL_Type * const unk =
dynamic_cast<TAO::Unknown_IDL_Type *> (impl);
if (!unk)
return false;
// We don't want the rd_ptr of unk to move, in case it is
// shared by another Any. This copies the state, not the buffer.
TAO_InputCDR for_reading (unk->_tao_get_cdr ());
CORBA::Boolean const good_decode =
replacement->demarshal_value (for_reading);
if (good_decode)
{
_tao_elem = replacement->value_;
const_cast<CORBA::Any &> (any).replace (replacement);
replacement_safety.release ();
return true;
}
// Duplicated by Any_Impl base class constructor.
::CORBA::release (any_tc);
}
catch (const ::CORBA::Exception&)
{
}
return false;
}
| CORBA::Boolean TAO::Any_Dual_Impl_T< CORBA::Exception >::extract | ( | const CORBA::Any & | , | |
| _tao_destructor | , | |||
| CORBA::TypeCode_ptr | , | |||
| const CORBA::Exception *& | ||||
| ) |
Definition at line 60 of file ExceptionA.cpp.
{
}
return false;
}
| void TAO::Any_Dual_Impl_T< T >::free_value | ( | void | ) | [virtual] |
Reimplemented from TAO::Any_Impl.
Definition at line 189 of file Any_Dual_Impl_T.cpp.
{
if (this->value_destructor_ != 0)
{
(*this->value_destructor_) (this->value_);
this->value_destructor_ = 0;
}
::CORBA::release (this->type_);
this->value_ = 0;
}
| void TAO::Any_Dual_Impl_T< T >::insert | ( | CORBA::Any & | any, | |
| _tao_destructor | destructor, | |||
| CORBA::TypeCode_ptr | tc, | |||
| T * const | value | |||
| ) | [static] |
Definition at line 65 of file Any_Dual_Impl_T.cpp.
| void TAO::Any_Dual_Impl_T< T >::insert_copy | ( | CORBA::Any & | any, | |
| _tao_destructor | destructor, | |||
| CORBA::TypeCode_ptr | tc, | |||
| const T & | value | |||
| ) | [static] |
Definition at line 80 of file Any_Dual_Impl_T.cpp.
| CORBA::Boolean TAO::Any_Dual_Impl_T< CORBA::Exception >::marshal_value | ( | TAO_OutputCDR & | cdr | ) | [virtual] |
Implements TAO::Any_Impl.
Definition at line 22 of file ExceptionA.cpp.
{
template<>
void
Any_Dual_Impl_T<CORBA::Exception>::value (const CORBA::Exception & val)
{
this->value_ = val._tao_duplicate ();
}
template<>
CORBA::Boolean
| CORBA::Boolean TAO::Any_Dual_Impl_T< T >::marshal_value | ( | TAO_OutputCDR & | cdr | ) | [virtual] |
Implements TAO::Any_Impl.
Definition at line 175 of file Any_Dual_Impl_T.cpp.
{
return (cdr << *this->value_);
}
| const void * TAO::Any_Dual_Impl_T< T >::value | ( | void | ) | const [virtual] |
Definition at line 182 of file Any_Dual_Impl_T.cpp.
{
return this->value_;
}
| void TAO::Any_Dual_Impl_T< T >::value | ( | const T & | val | ) | [protected] |
Definition at line 35 of file Any_Dual_Impl_T.cpp.
{
ACE_NEW (this->value_,
T (val));
}
| void TAO::Any_Dual_Impl_T< CORBA::Exception >::value | ( | const CORBA::Exception & | val | ) |
Definition at line 15 of file ExceptionA.cpp.
: ExceptionA.cpp 90886 2010-06-28 09:18:39Z johnnyw $")
T* TAO::Any_Dual_Impl_T< T >::value_ [protected] |
Definition at line 75 of file Any_Dual_Impl_T.h.
1.7.0