Struct_TypeCode_Static.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    Struct_TypeCode_Static.h
00006  *
00007  *  $Id: Struct_TypeCode_Static.h 76551 2007-01-24 13:42:44Z johnnyw $
00008  *
00009  *  Header file for static @c tk_struct and @c tk_except
00010  *  @c CORBA::TypeCodes.
00011  *
00012  *  @author Ossama Othman <ossama@dre.vanderbilt.edu>
00013  *  @author Carlos O'Ryan
00014  */
00015 //=============================================================================
00016 
00017 #ifndef TAO_STRUCT_TYPECODE_STATIC_H
00018 #define TAO_STRUCT_TYPECODE_STATIC_H
00019 
00020 #include /**/ "ace/pre.h"
00021 
00022 #include "tao/AnyTypeCode/TypeCode.h"
00023 
00024 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00025 # pragma once
00026 #endif /* ACE_LACKS_PRAGMA_ONCE */
00027 
00028 #include "tao/AnyTypeCode/TypeCode_Base_Attributes.h"
00029 #include "tao/AnyTypeCode/Null_RefCount_Policy.h"
00030 
00031 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00032 
00033 namespace TAO
00034 {
00035   namespace TypeCode
00036   {
00037     template<typename StringType, typename TypeCodeType> struct Struct_Field;
00038     template <typename StringType,
00039               typename TypeCodeType,
00040               class FieldArrayType,
00041               class RefCountPolicy> class Struct;
00042 
00043 
00044     /**
00045      * @class Struct
00046      *
00047      * @brief @c CORBA::TypeCode implementation for an OMG IDL
00048      *        @c struct or @c exception.
00049      *
00050      * This class implements a @c CORBA::TypeCode for an OMG IDL
00051      * @c struct or @c exception.
00052      */
00053     template<>
00054     class TAO_AnyTypeCode_Export Struct<char const *,
00055                             CORBA::TypeCode_ptr const *,
00056                             Struct_Field<char const *,
00057                                          CORBA::TypeCode_ptr const *> const *,
00058                             TAO::Null_RefCount_Policy>
00059       : public CORBA::TypeCode,
00060         private TAO::Null_RefCount_Policy
00061     {
00062     public:
00063 
00064       /// Constructor.
00065       Struct (CORBA::TCKind kind,
00066               char const * id,
00067               char const * name,
00068               Struct_Field<char const *,
00069                            CORBA::TypeCode_ptr const *> const * fields,
00070               CORBA::ULong nfields);
00071 
00072       /**
00073        * @name TAO-specific @c CORBA::TypeCode Methods
00074        *
00075        * Methods required by TAO's implementation of the
00076        * @c CORBA::TypeCode class.
00077        *
00078        * @see @c CORBA::TypeCode
00079        */
00080       //@{
00081       virtual bool tao_marshal (TAO_OutputCDR & cdr,
00082                                 CORBA::ULong offset) const;
00083       virtual void tao_duplicate (void);
00084       virtual void tao_release (void);
00085       //@}
00086 
00087     protected:
00088 
00089       /**
00090        * @name @c TAO CORBA::TypeCode Template Methods
00091        *
00092        * @c tk_struct or @c tk_except @c CORBA::TypeCode -specific
00093        * template methods.
00094        *
00095        * @see @c CORBA::TypeCode
00096        */
00097       //@{
00098       virtual CORBA::Boolean equal_i (CORBA::TypeCode_ptr tc
00099                                       ) const;
00100       virtual CORBA::Boolean equivalent_i (CORBA::TypeCode_ptr tc
00101                                            ) const;
00102       virtual CORBA::TypeCode_ptr get_compact_typecode_i (
00103         void) const;
00104       virtual char const * id_i (void) const;
00105       virtual char const * name_i (void) const;
00106       virtual CORBA::ULong member_count_i (void) const;
00107       virtual char const * member_name_i (CORBA::ULong index
00108                                           ) const;
00109       virtual CORBA::TypeCode_ptr member_type_i (CORBA::ULong index
00110                                                  ) const;
00111       //@}
00112 
00113     private:
00114 
00115       /**
00116        * @c Struct Attributes
00117        *
00118        * Attributes representing the structure of an OMG IDL
00119        * @c struct or @c exception.
00120        *
00121        * @note These attributes are declared in the order in which
00122        *       they are marshaled into a CDR stream in order to
00123        *       increase cache hits by improving spatial locality.
00124        */
00125       //@{
00126 
00127       /// Base attributes containing repository ID and name of
00128       /// structure type.
00129       Base_Attributes<char const *> const base_attributes_;
00130 
00131       /// The number of fields in the OMG IDL structure.
00132       CORBA::ULong const nfields_;
00133 
00134       /// Array of @c TAO::TypeCode fields representing structure of the
00135       /// OMG IDL defined @c struct.
00136       Struct_Field<char const *,
00137                    CORBA::TypeCode_ptr const *> const * const fields_;
00138 
00139       //@}
00140 
00141     };
00142 
00143   }  // End namespace TypeCode
00144 }  // End namespace TAO
00145 
00146 TAO_END_VERSIONED_NAMESPACE_DECL
00147 
00148 #ifdef __ACE_INLINE__
00149 # include "tao/AnyTypeCode/Struct_TypeCode_Static.inl"
00150 #endif  /* __ACE_INLINE__ */
00151 
00152 #include /**/ "ace/post.h"
00153 
00154 #endif /* TAO_STRUCT_TYPECODE_H */

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