3 // ===================================================================
5 * @file Codeset_Translator_Factory.h
7 * @author Phil Mesnier <mesnier_p@ociweb.com>
9 // ===================================================================
11 #ifndef TAO_CODESET_TRANSLATOR_FACTORY_H
12 #define TAO_CODESET_TRANSLATOR_FACTORY_H
14 #include /**/ "ace/pre.h"
15 #include "ace/Service_Object.h"
17 #if !defined (ACE_LACKS_PRAGMA_ONCE)
19 #endif /* ACE_LACKS_PRAGMA_ONCE */
21 #include "tao/CONV_FRAMEC.h"
22 #include "tao/Codeset_Translator_Base.h"
23 #include "tao/Codeset/codeset_export.h"
26 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
27 class ACE_Char_Codeset_Translator
;
28 class ACE_WChar_Codeset_Translator
;
29 ACE_END_VERSIONED_NAMESPACE_DECL
31 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
36 // ****************************************************************
39 * @class TAO_Codeset_Translator_Factory
41 * @brief Abstract base class for factories providing codeset translators
43 * The codeset translator factory is a loadable service object. It is used to
44 * supply the actual translator used in converting between two codesets. The
45 * intent of using a factory is to avoid requiring codeset translators to be
46 * multiply inherited both from the translator base class and the service
47 * object base. The translator factory is also responsible for assigning
48 * translators to CDR streams. Since there is no common base class between
49 * input and output CDRs, the assingment code must be duplicated.
52 class TAO_Codeset_Export TAO_Codeset_Translator_Factory
:
53 public TAO_Codeset_Translator_Base
,
54 public ACE_Service_Object
57 TAO_Codeset_Translator_Factory () = default;
58 virtual ~TAO_Codeset_Translator_Factory () = default;
59 virtual int init (int argc
, ACE_TCHAR
*argv
[]);
62 /// Assign the translator to the supplied input CDR. The template instance
63 /// will have a translator that is based on either the Char or Wchar
64 /// translator, so the compiler will select the appropriate call from
66 void assign_i (TAO_InputCDR
*, ACE_Char_Codeset_Translator
*) const;
67 /// Assign the translator to the supplied input CDR. The template instance
68 /// will have a translator that is based on either the Char or Wchar
69 /// translator, so the compiler will select the appropriate call from
71 void assign_i (TAO_InputCDR
*, ACE_WChar_Codeset_Translator
*) const;
72 /// Assign the translator to the supplied output CDR. The template instance
73 /// will have a translator that is based on either the Char or Wchar
74 /// translator, so the compiler will select the appropriate call from
76 void assign_i (TAO_OutputCDR
*, ACE_Char_Codeset_Translator
*) const;
77 /// Assign the translator to the supplied output CDR. The template instance
78 /// will have a translator that is based on either the Char or Wchar
79 /// translator, so the compiler will select the appropriate call from
81 void assign_i (TAO_OutputCDR
*, ACE_WChar_Codeset_Translator
*) const;
84 TAO_END_VERSIONED_NAMESPACE_DECL
86 // Get the template includes last
87 #include "tao/Codeset/Codeset_Translator_Factory_T.h"
89 #include /**/ "ace/post.h"
90 #endif /* TAO_Codeset_Translator_Factory */