TypeCode_Value_Field.h

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

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