00001 // -*- C++ -*- 00002 // 00003 // DynAnyFactory.h,v 1.12 2006/03/10 07:19:07 jtc Exp 00004 00005 //============================================================================= 00006 /** 00007 * @file DynAnyFactory.h 00008 * 00009 * DynAnyFactory.h,v 1.12 2006/03/10 07:19:07 jtc Exp 00010 * 00011 * @author Carlos O'Ryan <coryan@uci.edu> 00012 */ 00013 //============================================================================= 00014 00015 00016 #ifndef TAO_DYNANYFACTORY_H 00017 #define TAO_DYNANYFACTORY_H 00018 #include /**/ "ace/pre.h" 00019 00020 #include "tao/DynamicAny/DynamicAny.h" 00021 00022 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00023 # pragma once 00024 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00025 00026 #include "tao/LocalObject.h" 00027 00028 #if defined (_MSC_VER) 00029 # pragma warning(push) 00030 # pragma warning (disable:4250) 00031 #endif /* _MSC_VER */ 00032 00033 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00034 00035 /** 00036 * @class TAO_DynAnyFactory 00037 * 00038 * Implements the DynamicAnyFactory interface and provides several 00039 * utility functions shared by all the Dynamic Any components. 00040 */ 00041 class TAO_DynamicAny_Export TAO_DynAnyFactory 00042 : public virtual DynamicAny::DynAnyFactory, 00043 public virtual TAO_Local_RefCounted_Object 00044 { 00045 public: 00046 /// Constructor. 00047 TAO_DynAnyFactory (void); 00048 00049 /// Obtain the kind of object, after all aliasing has been removed. 00050 static CORBA::TCKind unalias (CORBA::TypeCode_ptr tc 00051 ACE_ENV_ARG_DECL); 00052 00053 /// Same as above, but returns type code instead of TCKind. Caller 00054 /// must release the return value. 00055 static CORBA::TypeCode_ptr strip_alias (CORBA::TypeCode_ptr tc 00056 ACE_ENV_ARG_DECL); 00057 00058 /// Create the correct type of DynAny object for <any>. 00059 static DynamicAny::DynAny_ptr 00060 make_dyn_any (const CORBA::Any &any 00061 ACE_ENV_ARG_DECL); 00062 00063 /// Create the correct type of DynAny object for <tc> 00064 static DynamicAny::DynAny_ptr 00065 make_dyn_any (CORBA::TypeCode_ptr tc 00066 ACE_ENV_ARG_DECL); 00067 00068 // = The DynamicAnyFactory methods. 00069 virtual DynamicAny::DynAny_ptr create_dyn_any ( 00070 const CORBA::Any & value 00071 ACE_ENV_ARG_DECL_WITH_DEFAULTS) 00072 00073 ACE_THROW_SPEC (( 00074 CORBA::SystemException, 00075 DynamicAny::DynAnyFactory::InconsistentTypeCode 00076 )); 00077 00078 virtual DynamicAny::DynAny_ptr create_dyn_any_from_type_code ( 00079 CORBA::TypeCode_ptr type 00080 ACE_ENV_ARG_DECL_WITH_DEFAULTS) 00081 00082 ACE_THROW_SPEC (( 00083 CORBA::SystemException, 00084 DynamicAny::DynAnyFactory::InconsistentTypeCode 00085 )); 00086 00087 private: 00088 // Not allowed. 00089 TAO_DynAnyFactory (const TAO_DynAnyFactory &src); 00090 TAO_DynAnyFactory &operator= (const TAO_DynAnyFactory &src); 00091 }; 00092 00093 TAO_END_VERSIONED_NAMESPACE_DECL 00094 00095 #if defined(_MSC_VER) 00096 # pragma warning(pop) 00097 #endif /* _MSC_VER */ 00098 00099 #include /**/ "ace/post.h" 00100 #endif /* TAO_DYNANYFACTORY_H */