TAO::Any_Impl Class Reference

Base class for the Any template subclasses. More...

#include <Any_Impl.h>

Inheritance diagram for TAO::Any_Impl:

Inheritance graph
[legend]
Collaboration diagram for TAO::Any_Impl:

Collaboration graph
[legend]
List of all members.

Public Types

typedef void(* _tao_destructor )(void *)

Public Member Functions

CORBA::Boolean marshal (TAO_OutputCDR &)
virtual CORBA::Boolean marshal_value (TAO_OutputCDR &)=0
virtual void free_value (void)
CORBA::TypeCode_ptr type (void) const
CORBA::TypeCode_ptr _tao_get_typecode (void) const
void type (CORBA::TypeCode_ptr)
virtual int _tao_byte_order (void) const
virtual void _add_ref (void)
virtual void _remove_ref (void)
virtual void _tao_decode (TAO_InputCDR &)
virtual CORBA::Boolean to_object (CORBA::Object_ptr &) const
virtual CORBA::Boolean to_value (CORBA::ValueBase *&) const
virtual CORBA::Boolean to_abstract_base (CORBA::AbstractBase_ptr &) const
bool encoded (void) const

Static Public Member Functions

void _tao_any_string_destructor (void *)
 Used to release these CORBA basic types.

void _tao_any_wstring_destructor (void *)

Protected Member Functions

 Any_Impl (_tao_destructor, CORBA::TypeCode_ptr, bool encoded=false)
virtual ~Any_Impl (void)

Protected Attributes

TAO::Any_Impl::_tao_destructor value_destructor_
CORBA::TypeCode_ptr type_
bool encoded_

Private Attributes

ACE_Atomic_Op< TAO_SYNCH_MUTEX,
unsigned long > 
refcount_
 Reference counter.


Detailed Description

Base class for the Any template subclasses.

Contains common functionality and some pure virtual methods.

Definition at line 64 of file Any_Impl.h.


Member Typedef Documentation

typedef void(* TAO::Any_Impl::_tao_destructor)(void *)
 

Generated data types define a 'destructor' function that correctly destroys an object stored in an Any.

Definition at line 69 of file Any_Impl.h.

Referenced by Any_Impl().


Constructor & Destructor Documentation

TAO_BEGIN_VERSIONED_NAMESPACE_DECL TAO::Any_Impl::Any_Impl _tao_destructor  ,
CORBA::TypeCode_ptr  ,
bool  encoded = false
[protected]
 

Definition at line 19 of file Any_Impl.cpp.

References _tao_destructor.

00022   : value_destructor_ (destructor)
00023   , type_ (CORBA::TypeCode::_duplicate (tc))
00024   , encoded_ (encoded)
00025   , refcount_ (1)
00026 {
00027 }

TAO::Any_Impl::~Any_Impl void   )  [protected, virtual]
 

Definition at line 29 of file Any_Impl.cpp.

00030 {
00031 }


Member Function Documentation

void TAO::Any_Impl::_add_ref void   )  [virtual]
 

Definition at line 91 of file Any_Impl.cpp.

Referenced by CORBA::Any::Any(), and CORBA::Any::operator=().

00092 {
00093   ++this->refcount_;
00094 }

void TAO::Any_Impl::_remove_ref void   )  [virtual]
 

Definition at line 97 of file Any_Impl.cpp.

References free_value().

Referenced by CORBA::Any::operator=(), CORBA::Any::replace(), and CORBA::Any::~Any().

00098 {
00099   const CORBA::ULong new_count = --this->refcount_;
00100 
00101   if (new_count != 0)
00102     return;
00103 
00104   this->free_value ();
00105 
00106   delete this;
00107 }

void TAO::Any_Impl::_tao_any_string_destructor void *   )  [static]
 

Used to release these CORBA basic types.

Definition at line 77 of file Any_Impl.cpp.

References CORBA::string_free().

00078 {
00079   char *tmp = static_cast<char *> (x);
00080   CORBA::string_free (tmp);
00081 }

void TAO::Any_Impl::_tao_any_wstring_destructor void *   )  [static]
 

Definition at line 84 of file Any_Impl.cpp.

References CORBA::wstring_free().

00085 {
00086   CORBA::WChar *tmp = static_cast<CORBA::WChar *> (x);
00087   CORBA::wstring_free (tmp);
00088 }

int TAO::Any_Impl::_tao_byte_order void   )  const [virtual]
 

Reimplemented in TAO::Unknown_IDL_Type.

Definition at line 71 of file Any_Impl.cpp.

References TAO_ENCAP_BYTE_ORDER.

Referenced by CORBA::Any::_tao_byte_order().

00072 {
00073   return TAO_ENCAP_BYTE_ORDER;
00074 }

void TAO::Any_Impl::_tao_decode TAO_InputCDR  )  [virtual]
 

Reimplemented in TAO::Any_Array_Impl_T< T_slice, T_forany >, TAO::Any_Basic_Impl, TAO::Any_Basic_Impl_T< T >, TAO::Any_Dual_Impl_T< T >, TAO::Any_Impl_T< T >, TAO::Any_Special_Impl_T< T, from_T, to_T >, and TAO::Unknown_IDL_Type.

Definition at line 110 of file Any_Impl.cpp.

00112 {
00113   throw ::CORBA::NO_IMPLEMENT ();
00114 }

CORBA::TypeCode_ptr TAO::Any_Impl::_tao_get_typecode void   )  const
 

Definition at line 58 of file Any_Impl.cpp.

Referenced by CORBA::Any::_tao_get_typecode(), and CORBA::Any::type().

00059 {
00060   return this->type_;
00061 }

bool TAO::Any_Impl::encoded void   )  const
 

Definition at line 135 of file Any_Impl.cpp.

References encoded_.

Referenced by TAO_Marshal_Union::append(), TAO::Any_SystemException::extract(), TAO::Any_Special_Impl_T< T, from_T, to_T >::extract(), TAO::Any_Impl_T< T >::extract(), TAO::Any_Dual_Impl_T< T >::extract(), TAO::Any_Basic_Impl_T< T >::extract(), TAO::Any_Basic_Impl::extract(), TAO::Any_Array_Impl_T< T_slice, T_forany >::extract(), and TAO_Marshal_Union::skip().

00136 {
00137   return this->encoded_;
00138 }

void TAO::Any_Impl::free_value void   )  [virtual]
 

Reimplemented in TAO::Any_Array_Impl_T< T_slice, T_forany >, TAO::Any_Dual_Impl_T< T >, TAO::Any_Impl_T< T >, TAO::Any_Special_Impl_T< T, from_T, to_T >, TAO::Any_SystemException, and TAO::Unknown_IDL_Type.

Definition at line 45 of file Any_Impl.cpp.

Referenced by _remove_ref().

00046 {
00047   // We always have to do this.
00048   ::CORBA::release (this->type_);
00049 }

CORBA::Boolean TAO::Any_Impl::marshal TAO_OutputCDR  ) 
 

Definition at line 34 of file Any_Impl.cpp.

References marshal_value().

Referenced by operator<<().

00035 {
00036   if ((cdr << this->type_) == 0)
00037     {
00038       return false;
00039     }
00040 
00041   return this->marshal_value (cdr);
00042 }

virtual CORBA::Boolean TAO::Any_Impl::marshal_value TAO_OutputCDR  )  [pure virtual]
 

Implemented in TAO::Any_Array_Impl_T< T_slice, T_forany >, TAO::Any_Basic_Impl, TAO::Any_Basic_Impl_T< T >, TAO::Any_Dual_Impl_T< T >, TAO::Any_Impl_T< T >, TAO::Any_Special_Impl_T< T, from_T, to_T >, TAO::Any_SystemException, and TAO::Unknown_IDL_Type.

Referenced by TAO_Marshal_Union::append(), marshal(), and TAO_Marshal_Union::skip().

CORBA::Boolean TAO::Any_Impl::to_abstract_base CORBA::AbstractBase_ptr  )  const [virtual]
 

Reimplemented in TAO::Any_Impl_T< T >, and TAO::Unknown_IDL_Type.

Definition at line 129 of file Any_Impl.cpp.

Referenced by CORBA::Any::checked_to_abstract_base().

00130 {
00131   return false;
00132 }

CORBA::Boolean TAO::Any_Impl::to_object CORBA::Object_ptr  )  const [virtual]
 

Reimplemented in TAO::Any_Impl_T< T >, and TAO::Unknown_IDL_Type.

Definition at line 117 of file Any_Impl.cpp.

Referenced by CORBA::Any::checked_to_object().

00118 {
00119   return false;
00120 }

CORBA::Boolean TAO::Any_Impl::to_value CORBA::ValueBase *&   )  const [virtual]
 

Reimplemented in TAO::Any_Impl_T< T >, and TAO::Unknown_IDL_Type.

Definition at line 123 of file Any_Impl.cpp.

Referenced by CORBA::Any::checked_to_value().

00124 {
00125   return false;
00126 }

void TAO::Any_Impl::type CORBA::TypeCode_ptr   ) 
 

Definition at line 64 of file Any_Impl.cpp.

References CORBA::TypeCode::_duplicate().

00065 {
00066   ::CORBA::release (this->type_);
00067   this->type_ = CORBA::TypeCode::_duplicate (tc);
00068 }

CORBA::TypeCode_ptr TAO::Any_Impl::type void   )  const
 

Definition at line 52 of file Any_Impl.cpp.

References CORBA::TypeCode::_duplicate().

Referenced by CORBA::Any::_tao_set_typecode(), and CORBA::Any::type().

00053 {
00054   return CORBA::TypeCode::_duplicate (this->type_);
00055 }


Member Data Documentation

bool TAO::Any_Impl::encoded_ [protected]
 

Definition at line 105 of file Any_Impl.h.

Referenced by encoded().

ACE_Atomic_Op<TAO_SYNCH_MUTEX, unsigned long> TAO::Any_Impl::refcount_ [private]
 

Reference counter.

Definition at line 109 of file Any_Impl.h.

CORBA::TypeCode_ptr TAO::Any_Impl::type_ [protected]
 

Definition at line 104 of file Any_Impl.h.

TAO::Any_Impl::_tao_destructor TAO::Any_Impl::value_destructor_ [protected]
 

Definition at line 103 of file Any_Impl.h.


The documentation for this class was generated from the following files:
Generated on Sun Jan 27 13:22:05 2008 for TAO_AnyTypeCode by doxygen 1.3.6