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