TypeCodeFactory_Adapter.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    TypeCodeFactory_Adapter.h
00006  *
00007  *  $Id: TypeCodeFactory_Adapter.h 81663 2008-05-09 12:43:47Z johnnyw $
00008  *
00009  *  @author  Jeff Parsons <parsons@cs.wustl.edu>
00010  */
00011 //=============================================================================
00012 
00013 #ifndef TAO_TYPECODEFACTORY_ADAPTER_H
00014 #define TAO_TYPECODEFACTORY_ADAPTER_H
00015 
00016 #include /**/ "ace/pre.h"
00017 #include "ace/Service_Object.h"
00018 
00019 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00020 # pragma once
00021 #endif /* ACE_LACKS_PRAGMA_ONCE */
00022 
00023 #include "tao/CORBA_methods.h"
00024 #include "tao/Typecode_typesC.h"
00025 #include "tao/Pseudo_VarOut_T.h"
00026 
00027 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00028 template<class T> class ACE_Array_Base;
00029 ACE_END_VERSIONED_NAMESPACE_DECL
00030 
00031 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00032 
00033 namespace CORBA
00034 {
00035   class EnumMemberSeq;
00036   class StructMemberSeq;
00037   class UnionMemberSeq;
00038   class ValueMemberSeq;
00039 
00040   typedef TAO_Pseudo_Var_T<TypeCode> TypeCode_var;
00041   typedef TAO_Pseudo_Out_T<TypeCode> TypeCode_out;
00042 
00043   typedef CORBA::Short ValueModifier;
00044 }
00045 
00046 namespace TAO
00047 {
00048   namespace TypeCode
00049   {
00050     template<typename StringType, typename TypeCodeType> class Case;
00051     template<typename StringType, typename TypeCodeType> struct Struct_Field;
00052     template<typename StringType, typename TypeCodeType> struct Value_Field;
00053   }
00054 }
00055 
00056 
00057 /**
00058  * @class TAO_TypeCodeFactory_Adapter
00059  *
00060  * @brief TAO_TypeCodeFactory_Adapter.
00061  *
00062  * Class that adapts the CORBA::ORB create_*_tc functions
00063  * to use the TypeCodeFactory. This is a base class for
00064  * the actual implementation in the TypeCodeFactory_DLL library.
00065  */
00066 class TAO_Export TAO_TypeCodeFactory_Adapter : public ACE_Service_Object
00067 {
00068 public:
00069   virtual ~TAO_TypeCodeFactory_Adapter (void);
00070 
00071   virtual CORBA::TypeCode_ptr create_struct_tc (
00072       const char *id,
00073       const char *name,
00074       const CORBA::StructMemberSeq &members) = 0;
00075 
00076   virtual CORBA::TypeCode_ptr create_union_tc (
00077       const char *id,
00078       const char *name,
00079       CORBA::TypeCode_ptr discriminator_type,
00080       const CORBA::UnionMemberSeq &members) = 0;
00081 
00082   virtual CORBA::TypeCode_ptr create_enum_tc (
00083       const char *id,
00084       const char *name,
00085       const CORBA::EnumMemberSeq &members) = 0;
00086 
00087   virtual CORBA::TypeCode_ptr create_alias_tc (
00088       const char *id,
00089       const char *name,
00090       CORBA::TypeCode_ptr original_type) = 0;
00091 
00092   virtual CORBA::TypeCode_ptr create_exception_tc (
00093       const char *id,
00094       const char *name,
00095       const CORBA::StructMemberSeq &members) = 0;
00096 
00097   virtual CORBA::TypeCode_ptr create_interface_tc (
00098       const char *id,
00099       const char *name) = 0;
00100 
00101   virtual CORBA::TypeCode_ptr create_string_tc (
00102       CORBA::ULong bound) = 0;
00103 
00104   virtual CORBA::TypeCode_ptr create_wstring_tc (
00105       CORBA::ULong bound) = 0;
00106 
00107   virtual CORBA::TypeCode_ptr create_fixed_tc (
00108       CORBA::UShort digits,
00109       CORBA::UShort scale) = 0;
00110 
00111   virtual CORBA::TypeCode_ptr create_sequence_tc (
00112       CORBA::ULong bound,
00113       CORBA::TypeCode_ptr element_type) = 0;
00114 
00115   virtual CORBA::TypeCode_ptr create_array_tc (
00116       CORBA::ULong length,
00117       CORBA::TypeCode_ptr element_type) = 0;
00118 
00119   virtual CORBA::TypeCode_ptr create_value_tc (
00120       const char *id,
00121       const char *name,
00122       CORBA::ValueModifier type_modifier,
00123       CORBA::TypeCode_ptr concrete_base,
00124       const CORBA::ValueMemberSeq &members) = 0;
00125 
00126   virtual CORBA::TypeCode_ptr create_value_box_tc (
00127       const char *id,
00128       const char *name,
00129       CORBA::TypeCode_ptr boxed_type) = 0;
00130 
00131   virtual CORBA::TypeCode_ptr create_native_tc (
00132       const char *id,
00133       const char *name) = 0;
00134 
00135   virtual CORBA::TypeCode_ptr create_recursive_tc (const char *id) = 0;
00136 
00137   virtual CORBA::TypeCode_ptr create_abstract_interface_tc (
00138       const char *id,
00139       const char *name) = 0;
00140 
00141   virtual CORBA::TypeCode_ptr create_local_interface_tc (
00142       const char *id,
00143       const char *name) = 0;
00144 
00145   virtual CORBA::TypeCode_ptr create_component_tc (
00146       const char *id,
00147       const char *name) = 0;
00148 
00149   virtual CORBA::TypeCode_ptr create_home_tc (
00150       const char *id,
00151       const char *name) = 0;
00152 
00153   virtual CORBA::TypeCode_ptr create_event_tc (
00154       const char *id,
00155       const char *name,
00156       CORBA::ValueModifier type_modifier,
00157       CORBA::TypeCode_ptr concrete_base,
00158       const CORBA::ValueMemberSeq &members) = 0;
00159 
00160   // --
00161 
00162   /**
00163    * @name TAO-specific TypeCode factory methods.
00164    *
00165    * Factory methods that has no corresponding TypeCodeFactory IDL,
00166    * i.e. they are specific to TAO.
00167    */
00168   //@{
00169   /// Create an enumeration TypeCode.
00170   virtual CORBA::TypeCode_ptr create_enum_tc (
00171     char const * id,
00172     char const * name,
00173     ACE_Array_Base<CORBA::String_var> const & enumerators,
00174     CORBA::ULong ncases) = 0;
00175 
00176   /// Create a structure or exception TypeCode.
00177   virtual CORBA::TypeCode_ptr create_struct_except_tc (
00178     CORBA::TCKind,
00179     char const * id,
00180     char const * name,
00181     ACE_Array_Base<
00182       TAO::TypeCode::Struct_Field<CORBA::String_var,
00183                                   CORBA::TypeCode_var> > const & fields,
00184     CORBA::ULong nfields) = 0;
00185 
00186   /// Create a union TypeCode.
00187   virtual CORBA::TypeCode_ptr create_union_tc (
00188     char const * id,
00189     char const * name,
00190     CORBA::TypeCode_ptr discriminant_type,
00191     ACE_Array_Base<TAO::TypeCode::Case<CORBA::String_var,
00192                                        CORBA::TypeCode_var> > const & cases,
00193     CORBA::ULong ncases,
00194     CORBA::Long default_index,
00195     char const * default_case_name,
00196     CORBA::TypeCode_ptr default_case_type) = 0;
00197 
00198   /// Create a valuetype or eventtype TypeCode.
00199   virtual CORBA::TypeCode_ptr create_value_event_tc (
00200     CORBA::TCKind,
00201     char const * id,
00202     char const * name,
00203     CORBA::ValueModifier modifier,
00204     CORBA::TypeCode_ptr concrete_base,
00205     ACE_Array_Base<
00206       TAO::TypeCode::Value_Field<CORBA::String_var,
00207                                  CORBA::TypeCode_var> > const & fields,
00208     CORBA::ULong nfields) = 0;
00209   //@}
00210 };
00211 
00212 TAO_END_VERSIONED_NAMESPACE_DECL
00213 
00214 #include /**/ "ace/post.h"
00215 
00216 #endif /* TAO_TYPECODEFACTORY_ADAPTER_H */

Generated on Tue Feb 2 17:37:53 2010 for TAO by  doxygen 1.4.7