00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file String_TypeCode_Traits.h 00006 * 00007 * $Id: String_TypeCode_Traits.h 90386 2010-06-02 13:52:08Z vzykov $ 00008 * 00009 * Header file for bound 00010 * @c tk_string, 00011 * @c tk_wstring, 00012 * @c CORBA::TypeCode factories. 00013 * 00014 * @author Ossama Othman <ossama@dre.vanderbilt.edu> 00015 */ 00016 //============================================================================= 00017 00018 #ifndef TAO_STRING_TYPECODE_TRAITS_H 00019 #define TAO_STRING_TYPECODE_TRAITS_H 00020 00021 #include /**/ "ace/pre.h" 00022 00023 00024 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00025 # pragma once 00026 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00027 00028 #include "tao/AnyTypeCode/String_TypeCode.h" 00029 #include "tao/AnyTypeCode/True_RefCount_Policy.h" 00030 #include "tao/AnyTypeCode/Any.h" 00031 00032 00033 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00034 00035 namespace TAO 00036 { 00037 namespace TypeCodeFactory 00038 { 00039 template <typename T> struct String_Traits; 00040 00041 template<> 00042 struct String_Traits<CORBA::Any::from_string> 00043 { 00044 static CORBA::TypeCode_ptr create_typecode (CORBA::TCKind kind, 00045 CORBA::ULong bound) 00046 { 00047 typedef TAO::TypeCode::String<TAO::True_RefCount_Policy> typecode_type; 00048 00049 CORBA::TypeCode_ptr tc = CORBA::TypeCode_ptr (); 00050 ACE_NEW_RETURN (tc, 00051 typecode_type (kind, bound), 00052 tc); 00053 00054 return tc; 00055 } 00056 }; 00057 00058 template <> 00059 struct String_Traits<CORBA::Any::from_wstring> 00060 { 00061 static CORBA::TypeCode_ptr create_typecode (CORBA::TCKind kind, 00062 CORBA::ULong bound) 00063 { 00064 typedef TAO::TypeCode::String<TAO::True_RefCount_Policy> typecode_type; 00065 00066 CORBA::TypeCode_ptr tc = CORBA::TypeCode_ptr (); 00067 ACE_NEW_RETURN (tc, 00068 typecode_type (kind, bound), 00069 tc); 00070 00071 return tc; 00072 } 00073 }; 00074 00075 } // End namespace TypeCodeFactory 00076 } // End namespace TAO 00077 00078 TAO_END_VERSIONED_NAMESPACE_DECL 00079 00080 #include /**/ "ace/post.h" 00081 00082 #endif /* TAO_STRING_TYPECODE_TRAITS_H */