String_TypeCode_Traits.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    String_TypeCode_Traits.h
00006  *
00007  *  $Id: String_TypeCode_Traits.h 77409 2007-02-26 23:48:49Z ossama $
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 
00031 
00032 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00033 
00034 namespace TAO
00035 {
00036   namespace TypeCodeFactory
00037   {
00038     template <typename T> struct String_Traits;
00039 
00040     template<>
00041     struct String_Traits<CORBA::Any::from_string>
00042     {
00043       static CORBA::TypeCode_ptr create_typecode (CORBA::TCKind kind,
00044                                                   CORBA::ULong bound)
00045       {
00046         typedef TAO::TypeCode::String<TAO::True_RefCount_Policy> typecode_type;
00047 
00048         CORBA::TypeCode_ptr tc = CORBA::TypeCode_ptr ();
00049         ACE_NEW_RETURN (tc,
00050                         typecode_type (kind, bound),
00051                         tc);
00052 
00053         return tc;
00054       }
00055     };
00056 
00057     template <>
00058     struct String_Traits<CORBA::Any::from_wstring>
00059     {
00060       static CORBA::TypeCode_ptr create_typecode (CORBA::TCKind kind,
00061                                                   CORBA::ULong bound)
00062       {
00063         typedef TAO::TypeCode::String<TAO::True_RefCount_Policy> typecode_type;
00064 
00065         CORBA::TypeCode_ptr tc = CORBA::TypeCode_ptr ();
00066         ACE_NEW_RETURN (tc,
00067                         typecode_type (kind, bound),
00068                         tc);
00069 
00070         return tc;
00071       }
00072     };
00073 
00074   }  // End namespace TypeCodeFactory
00075 }  // End namespace TAO
00076 
00077 TAO_END_VERSIONED_NAMESPACE_DECL
00078 
00079 #include /**/ "ace/post.h"
00080 
00081 #endif /* TAO_STRING_TYPECODE_TRAITS_H */

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