Any_Basic_Impl.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    Any_Basic_Impl.h
00006  *
00007  *  $Id: Any_Basic_Impl.h 76551 2007-01-24 13:42:44Z johnnyw $
00008  *
00009  *  @authors  Carlos O'Ryan and Jeff Parsons
00010  */
00011 //=============================================================================
00012 
00013 #ifndef TAO_ANY_BASIC_IMPL_H
00014 #define TAO_ANY_BASIC_IMPL_H
00015 
00016 #include /**/ "ace/pre.h"
00017 
00018 #include "tao/AnyTypeCode/Any_Impl.h"
00019 
00020 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00021 # pragma once
00022 #endif /* ACE_LACKS_PRAGMA_ONCE */
00023 
00024 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00025 
00026 namespace CORBA
00027 {
00028   class Any;
00029 }
00030 
00031 namespace TAO
00032 {
00033   /**
00034    * @class Any_Basic_Impl
00035    *
00036    * @brief Non-template class for all the basic types.
00037    *
00038    */
00039   class TAO_AnyTypeCode_Export Any_Basic_Impl : public Any_Impl
00040   {
00041   public:
00042     Any_Basic_Impl (CORBA::TypeCode_ptr,
00043                     void *value);
00044 
00045     virtual ~Any_Basic_Impl (void);
00046 
00047     static void insert (CORBA::Any &,
00048                         CORBA::TypeCode_ptr,
00049                         const void *);
00050     static CORBA::Boolean extract (const CORBA::Any &,
00051                                    CORBA::TypeCode_ptr,
00052                                    void *);
00053 
00054     virtual CORBA::Boolean marshal_value (TAO_OutputCDR &);
00055 
00056     CORBA::Boolean demarshal_value (TAO_InputCDR &);
00057     CORBA::Boolean demarshal_value (TAO_InputCDR &,
00058                                     CORBA::Long);
00059 
00060     virtual void _tao_decode (TAO_InputCDR &);
00061 
00062     static Any_Basic_Impl *create_empty (CORBA::TypeCode_ptr);
00063 
00064   private:
00065     static void assign_value (void *, Any_Basic_Impl *);
00066 
00067     static void assign_value (void *,
00068                               Any_Basic_Impl *,
00069                               CORBA::Long tck);
00070   private:
00071     CORBA::Long kind_;
00072     union
00073     {
00074       CORBA::Short s;
00075       CORBA::UShort us;
00076       CORBA::Long l;
00077       CORBA::ULong ul;
00078       CORBA::Float f;
00079       CORBA::Double d;
00080       CORBA::Boolean b;
00081       CORBA::Char c;
00082       CORBA::Octet o;
00083       CORBA::LongLong ll;
00084 #if !defined (ACE_LACKS_LONGLONG_T) && !defined (ACE_LACKS_UNSIGNEDLONGLONG_T)
00085       CORBA::ULongLong ull;
00086 #elif defined (ACE_LACKS_UNSIGNEDLONGLONG_T)
00087       // Platform has signed long long but not unsigned long long.
00088       // Use signed long long as the container.
00089       CORBA::LongLong ull;
00090 #endif
00091       CORBA::LongDouble ld;
00092       CORBA::WChar wc;
00093     }u_;
00094   };
00095 }
00096 
00097 TAO_END_VERSIONED_NAMESPACE_DECL
00098 
00099 #include /**/ "ace/post.h"
00100 
00101 #endif /* TAO_ANY_BASIC_IMPL_H */

Generated on Sun Jan 27 13:21:06 2008 for TAO_AnyTypeCode by doxygen 1.3.6