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