Value_TypeCode.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    Value_TypeCode.h
00006  *
00007  *  $Id: Value_TypeCode.h 77779 2007-03-23 11:48:02Z johnnyw $
00008  *
00009  *  Header file for a @c tk_value and @c tk_event
00010  *  @c CORBA::TypeCodes.
00011  *
00012  *  @author Ossama Othman <ossama@dre.vanderbilt.edu>
00013  */
00014 //=============================================================================
00015 
00016 #ifndef TAO_VALUE_TYPECODE_H
00017 #define TAO_VALUE_TYPECODE_H
00018 
00019 #include /**/ "ace/pre.h"
00020 
00021 #include "tao/AnyTypeCode/TypeCode.h"
00022 
00023 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00024 # pragma once
00025 #endif /* ACE_LACKS_PRAGMA_ONCE */
00026 
00027 #include "tao/AnyTypeCode/TypeCode_Base_Attributes.h"
00028 #include "tao/AnyTypeCode/ValueModifierC.h"
00029 #include "tao/AnyTypeCode/VisibilityC.h"
00030 
00031 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00032 
00033 namespace TAO
00034 {
00035   namespace TypeCode
00036   {
00037     template<typename StringType, typename TypeCodeType> struct Value_Field;
00038 
00039     /**
00040      * @class Value
00041      *
00042      * @brief @c CORBA::TypeCode implementation for an OMG IDL
00043      *        @c valuetype or @c event.
00044      *
00045      * This class implements a @c CORBA::TypeCode for an OMG IDL
00046      * @c valuetype or @c event.
00047      */
00048     template <typename StringType,
00049               typename TypeCodeType,
00050               class FieldArrayType,
00051               class RefCountPolicy>
00052     class Value
00053       : public CORBA::TypeCode,
00054         private RefCountPolicy
00055     {
00056     public:
00057 
00058       /// Constructor.
00059       Value (CORBA::TCKind kind,
00060              char const * id,
00061              char const * name,
00062              CORBA::ValueModifier modifier,
00063 #if defined (__BORLANDC__) && (__BORLANDC__ < 0x572)
00064              // Borland C++ currently can't handle a reference to
00065              // const pointer to const CORBA::TypeCode_ptr
00066              TypeCodeType concrete_base,
00067 #else
00068              TypeCodeType const & concrete_base,
00069 #endif
00070              FieldArrayType const & fields,
00071              CORBA::ULong nfields);
00072 
00073       /// Constructor used for recursive TypeCodes.
00074       Value (CORBA::TCKind kind,
00075               char const * id);
00076 
00077       /**
00078        * @name TAO-specific @c CORBA::TypeCode Methods
00079        *
00080        * Methods required by TAO's implementation of the
00081        * @c CORBA::TypeCode class.
00082        *
00083        * @see @c CORBA::TypeCode
00084        */
00085       //@{
00086       virtual bool tao_marshal (TAO_OutputCDR & cdr,
00087                                 CORBA::ULong offset) const;
00088       virtual void tao_duplicate (void);
00089       virtual void tao_release (void);
00090       //@}
00091 
00092     protected:
00093 
00094       /**
00095        * @name @c TAO CORBA::TypeCode Template Methods
00096        *
00097        * @c tk_value or @c tk_event @c CORBA::TypeCode -specific
00098        * template methods.
00099        *
00100        * @see @c CORBA::TypeCode
00101        */
00102       //@{
00103       virtual CORBA::Boolean equal_i (CORBA::TypeCode_ptr tc) const;
00104       virtual CORBA::Boolean equivalent_i (CORBA::TypeCode_ptr tc) const;
00105       virtual CORBA::TypeCode_ptr get_compact_typecode_i (void) const;
00106       virtual char const * id_i (void) const;
00107       virtual char const * name_i (void) const;
00108       virtual CORBA::ULong member_count_i (void) const;
00109       virtual char const * member_name_i (CORBA::ULong index) const;
00110       virtual CORBA::TypeCode_ptr member_type_i (CORBA::ULong index) const;
00111       virtual CORBA::Visibility member_visibility_i (CORBA::ULong index) const;
00112       virtual CORBA::ValueModifier type_modifier_i (void) const;
00113       virtual CORBA::TypeCode_ptr concrete_base_type_i (void) const;
00114       //@}
00115 
00116     protected:
00117 
00118       /**
00119        * @c Valuetype Attributes
00120        *
00121        * Attributes representing the structure of an OMG IDL
00122        * @c valuetype or @c event.
00123        *
00124        * @note These attributes are declared in the order in which
00125        *       they are marshaled into a CDR stream in order to
00126        *       increase cache hits by improving spatial locality.
00127        */
00128       //@{
00129 
00130       /// Base attributes containing repository ID and name of
00131       /// @c valuetype.
00132       Base_Attributes<StringType> base_attributes_;
00133 
00134       /// The @c ValueModifier of the @c valuetype of @c eventtype
00135       /// represented by this @c TypeCode.
00136       CORBA::ValueModifier type_modifier_;
00137 
00138       /// The @c TypeCode corresponding to the concrete base
00139       /// @c valuetype or @c eventtype.
00140       TypeCodeType concrete_base_;
00141 
00142       /// The number of fields in the OMG IDL value.
00143       CORBA::ULong nfields_;
00144 
00145       /// Array of @c TAO::TypeCode fields representing structure of the
00146       /// OMG IDL defined @c value.
00147       FieldArrayType fields_;
00148 
00149       //@}
00150 
00151     };
00152 
00153   }  // End namespace TypeCode
00154 }  // End namespace TAO
00155 
00156 TAO_END_VERSIONED_NAMESPACE_DECL
00157 
00158 #ifdef __ACE_INLINE__
00159 # include "tao/AnyTypeCode/Value_TypeCode.inl"
00160 #endif  /* __ACE_INLINE__ */
00161 
00162 #ifdef ACE_TEMPLATES_REQUIRE_SOURCE
00163 # include "tao/AnyTypeCode/Value_TypeCode.cpp"
00164 #endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
00165 
00166 #ifdef ACE_TEMPLATES_REQUIRE_PRAGMA
00167 # pragma implementation ("Value_TypeCode.cpp")
00168 #endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
00169 
00170 
00171 #include /**/ "ace/post.h"
00172 
00173 #endif /* TAO_VALUE_TYPECODE_H */

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