TypeCode_Struct_Field.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    TypeCode_Struct_Field.h
00006  *
00007  *  $Id: TypeCode_Struct_Field.h 69182 2005-11-03 17:38:46Z ossama $
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 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00024 # pragma once
00025 #endif /* ACE_LACKS_PRAGMA_ONCE */
00026 
00027 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00028 
00029 namespace CORBA
00030 {
00031   class TypeCode;
00032   typedef TypeCode* TypeCode_ptr;
00033 }
00034 
00035 namespace TAO
00036 {
00037   namespace TypeCode
00038   {
00039     /**
00040      * @struct Struct_Field
00041      *
00042      * @brief Name/type pair for fields of an OMG IDL defined
00043      *        structure or exception.
00044      *
00045      * A @c Struct_Field contains the corresponding name and pointer
00046      * to the @c CORBA::TypeCode for a given OMG IDL defined type.
00047      * For example, the fields in following OMG IDL structure:
00048      *
00049      * \code
00050      *   struct Foo
00051      *   {
00052      *     long   the_number;
00053      *     string the_string;
00054      *   };
00055      * \endcode
00056      *
00057      * would be represented using the following statically instantiated
00058      * @c TAO::TypeCode::Struct_Field array:
00059      *
00060      * \code
00061      *   TAO::TypeCode::Struct_Field<char const *> _tao_fields_Foo[] =
00062      *     {
00063      *       { "the_number", &CORBA::_tc_long },
00064      *       { "the_string", &CORBA::_tc_string },
00065      *     };
00066      * \endcode
00067      *
00068      * The template parameter @a STRING_TYPE is either @c char
00069      * @c const @c * or @c CORBA::String_var.  The latter is only used
00070      * when creating @c CORBA::tk_struct or @c CORBA::tk_except
00071      * @c TypeCodes dynamically, such as through the TypeCodeFactory.
00072      */
00073     template <typename StringType, typename TypeCodeType>
00074     struct Struct_Field
00075     {
00076       /// The name of the field.
00077       StringType name;
00078 
00079       /// The @c CORBA::TypeCode of the field.
00080       TypeCodeType type;
00081 
00082     };
00083 
00084   }  // End namespace TypeCode
00085 }  // End namespace TAO
00086 
00087 TAO_END_VERSIONED_NAMESPACE_DECL
00088 
00089 #include /**/ "ace/post.h"
00090 
00091 #endif /* TAO_TYPECODE_STRUCT_FIELD_H */

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