Alias_TypeCode.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    Alias_TypeCode.h
00006  *
00007  *  $Id: Alias_TypeCode.h 76551 2007-01-24 13:42:44Z johnnyw $
00008  *
00009  *  Header file for a @c tk_alias and @c tk_value_box
00010  *  @c CORBA::TypeCode.
00011  *
00012  *  @author Ossama Othman <ossama@dre.vanderbilt.edu>
00013  */
00014 //=============================================================================
00015 
00016 #ifndef TAO_ALIAS_TYPECODE_H
00017 #define TAO_ALIAS_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/TypeCodeFactory_Adapter.h"
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     /**
00037      * @class Alias
00038      *
00039      * @brief @c CORBA::TypeCode implementation for an OMG IDL
00040      *        @c typedef.
00041      *
00042      * This class implements a @c CORBA::TypeCode for an OMG IDL
00043      * @c typedef.
00044      */
00045     template <typename StringType,
00046               typename TypeCodeType,
00047               class RefCountPolicy>
00048     class Alias
00049       : public CORBA::TypeCode,
00050         private RefCountPolicy
00051     {
00052     public:
00053 
00054       /// Constructor.
00055       Alias (CORBA::TCKind kind,
00056              char const * id,
00057              char const * name,
00058 #if defined (__BORLANDC__) && (__BORLANDC__ < 0x572)
00059              // Borland C++ currently can't handle a reference to
00060              // const pointer to const CORBA::TypeCode_ptr
00061              TypeCodeType tc);
00062 #else
00063              TypeCodeType const & tc);
00064 #endif
00065 
00066       /**
00067        * @name TAO-specific @c CORBA::TypeCode Methods
00068        *
00069        * Methods required by TAO's implementation of the
00070        * @c CORBA::TypeCode class.
00071        *
00072        * @see @c CORBA::TypeCode
00073        */
00074       //@{
00075       virtual bool tao_marshal (TAO_OutputCDR & cdr,
00076                                 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_alias and @c tk_value_box @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::TypeCode_ptr content_type_i (void) const;
00098 
00099     private:
00100 
00101       /// Base attributes for this @c TypeCode containing the
00102       /// repository ID and name of the @c typedef.
00103       Base_Attributes<StringType> attributes_;
00104 
00105       /// The @c TypeCode corresponding to the original type upon
00106       /// which the IDL @c typedef was made.
00107       /**
00108        * A pointer to the @c CORBA::TypeCode_ptr rather than the
00109        * @c CORBA::TypeCode_ptr itself is stored since that address is
00110        * well-defined.  We may not know the value of the @c
00111        * CORBA::TypeCode_ptr when creating this @c Field statically at
00112        * compile-time, hence the indirection.
00113        *
00114        * @note This @c TypeCode is released upon destruction of this
00115        *       @c TypeCode::Alias.
00116        */
00117       TypeCodeType const content_type_;
00118 
00119     };
00120 
00121   }  // End namespace TypeCode
00122 }  // End namespace TAO
00123 
00124 TAO_END_VERSIONED_NAMESPACE_DECL
00125 
00126 
00127 #ifdef __ACE_INLINE__
00128 # include "tao/AnyTypeCode/Alias_TypeCode.inl"
00129 #endif  /* __ACE_INLINE__ */
00130 
00131 #ifdef ACE_TEMPLATES_REQUIRE_SOURCE
00132 # include "tao/AnyTypeCode/Alias_TypeCode.cpp"
00133 #endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
00134 
00135 #ifdef ACE_TEMPLATES_REQUIRE_PRAGMA
00136 # pragma implementation ("Alias_TypeCode.cpp")
00137 #endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
00138 
00139 #include /**/ "ace/post.h"
00140 
00141 #endif /* TAO_ALIAS_TYPECODE_H */

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