00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file TypeCode_Struct_Field.h 00006 * 00007 * $Id: TypeCode_Struct_Field.h 90386 2010-06-02 13:52:08Z vzykov $ 00008 * 00009 * Header file for @c TAO::TypeCode::Struct_Field type. 00010 * 00011 * @author Ossama Othman <ossama@dre.vanderbilt.edu> 00012 * @author Carlos O'Ryan 00013 */ 00014 //============================================================================= 00015 00016 #ifndef TAO_TYPECODE_STRUCT_FIELD_H 00017 #define TAO_TYPECODE_STRUCT_FIELD_H 00018 00019 #include /**/ "ace/pre.h" 00020 00021 #include "ace/config-all.h" 00022 00023 #include /**/ "tao/Versioned_Namespace.h" 00024 00025 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00026 # pragma once 00027 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00028 00029 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00030 00031 namespace CORBA 00032 { 00033 class TypeCode; 00034 typedef TypeCode* TypeCode_ptr; 00035 } 00036 00037 namespace TAO 00038 { 00039 namespace TypeCode 00040 { 00041 /** 00042 * @struct Struct_Field 00043 * 00044 * @brief Name/type pair for fields of an OMG IDL defined 00045 * structure or exception. 00046 * 00047 * A @c Struct_Field contains the corresponding name and pointer 00048 * to the @c CORBA::TypeCode for a given OMG IDL defined type. 00049 * For example, the fields in following OMG IDL structure: 00050 * 00051 * \code 00052 * struct Foo 00053 * { 00054 * long the_number; 00055 * string the_string; 00056 * }; 00057 * \endcode 00058 * 00059 * would be represented using the following statically instantiated 00060 * @c TAO::TypeCode::Struct_Field array: 00061 * 00062 * \code 00063 * TAO::TypeCode::Struct_Field<char const *> _tao_fields_Foo[] = 00064 * { 00065 * { "the_number", &CORBA::_tc_long }, 00066 * { "the_string", &CORBA::_tc_string }, 00067 * }; 00068 * \endcode 00069 * 00070 * The template parameter @a STRING_TYPE is either @c char 00071 * @c const @c * or @c CORBA::String_var. The latter is only used 00072 * when creating @c CORBA::tk_struct or @c CORBA::tk_except 00073 * @c TypeCodes dynamically, such as through the TypeCodeFactory. 00074 */ 00075 template <typename StringType, typename TypeCodeType> 00076 struct Struct_Field 00077 { 00078 /// The name of the field. 00079 StringType name; 00080 00081 /// The @c CORBA::TypeCode of the field. 00082 TypeCodeType type; 00083 00084 }; 00085 00086 } // End namespace TypeCode 00087 } // End namespace TAO 00088 00089 TAO_END_VERSIONED_NAMESPACE_DECL 00090 00091 #include /**/ "ace/post.h" 00092 00093 #endif /* TAO_TYPECODE_STRUCT_FIELD_H */