Struct_TypeCode.h

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

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