00001 // -*- C++ -*- 00002 00003 // =================================================================== 00004 /** 00005 * @file Codeset_Translator_Factory.h 00006 * 00007 * $Id: Codeset_Translator_Factory.h 71473 2006-03-10 07:19:20Z jtc $ 00008 * 00009 * @author Phil Mesnier <mesnier_p@ociweb.com> 00010 */ 00011 // =================================================================== 00012 00013 #ifndef TAO_CODESET_TRANSLATOR_FACTORY_H 00014 #define TAO_CODESET_TRANSLATOR_FACTORY_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/CONV_FRAMEC.h" 00024 #include "tao/Codeset_Translator_Base.h" 00025 #include "tao/Codeset/codeset_export.h" 00026 00027 00028 ACE_BEGIN_VERSIONED_NAMESPACE_DECL 00029 class ACE_Char_Codeset_Translator; 00030 class ACE_WChar_Codeset_Translator; 00031 ACE_END_VERSIONED_NAMESPACE_DECL 00032 00033 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00034 00035 class TAO_InputCDR; 00036 class TAO_OutputCDR; 00037 00038 // **************************************************************** 00039 00040 /** 00041 * @class TAO_Codeset_Translator_Factory 00042 * 00043 * @brief Abstract base class for factories providing codeset translators 00044 * 00045 * The codeset translator factory is a loadable service object. It is used to 00046 * supply the actual translator used in converting between two codesets. The 00047 * intent of using a factory is to avoid requiring codeset translators to be 00048 * multiply inherited both from the translator base class and the service 00049 * object base. The translator factory is also responsible for assigning 00050 * translators to CDR streams. Since there is no common base class between 00051 * input and output CDRs, the assingment code must be duplicated. 00052 */ 00053 00054 class TAO_Codeset_Export TAO_Codeset_Translator_Factory : 00055 public TAO_Codeset_Translator_Base, 00056 public ACE_Service_Object 00057 { 00058 public: 00059 TAO_Codeset_Translator_Factory (); 00060 virtual ~TAO_Codeset_Translator_Factory (); 00061 virtual int init (int argc, ACE_TCHAR *argv[]); 00062 00063 protected: 00064 /// Assign the translator to the supplied input CDR. The template instance 00065 /// will have a translator that is based on either the Char or Wchar 00066 /// translator, so the compiler will select the appropriate call from 00067 /// assign(). 00068 void assign_i (TAO_InputCDR *, ACE_Char_Codeset_Translator* ) const; 00069 /// Assign the translator to the supplied input CDR. The template instance 00070 /// will have a translator that is based on either the Char or Wchar 00071 /// translator, so the compiler will select the appropriate call from 00072 /// assign(). 00073 void assign_i (TAO_InputCDR *, ACE_WChar_Codeset_Translator* ) const; 00074 /// Assign the translator to the supplied output CDR. The template instance 00075 /// will have a translator that is based on either the Char or Wchar 00076 /// translator, so the compiler will select the appropriate call from 00077 /// assign(). 00078 void assign_i (TAO_OutputCDR *, ACE_Char_Codeset_Translator* ) const; 00079 /// Assign the translator to the supplied output CDR. The template instance 00080 /// will have a translator that is based on either the Char or Wchar 00081 /// translator, so the compiler will select the appropriate call from 00082 /// assign(). 00083 void assign_i (TAO_OutputCDR *, ACE_WChar_Codeset_Translator* ) const; 00084 }; 00085 00086 TAO_END_VERSIONED_NAMESPACE_DECL 00087 00088 // Get the template includes last 00089 #include "tao/Codeset/Codeset_Translator_Factory_T.h" 00090 00091 #include /**/ "ace/post.h" 00092 #endif /* TAO_Codeset_Translator_Factory */