3 // ===================================================================
5 * @file Codeset_Translator_Factory_T.h
7 * @author Phil Mesnier <mesnier_p@ociweb.com>
9 // ===================================================================
11 #ifndef TAO_CODESET_TRANSLATOR_FACTORY_T_H
12 #define TAO_CODESET_TRANSLATOR_FACTORY_T_H
14 #include /**/ "ace/pre.h"
16 #include "tao/Codeset/Codeset_Translator_Factory.h"
18 #if !defined (ACE_LACKS_PRAGMA_ONCE)
20 #endif /* ACE_LACKS_PRAGMA_ONCE */
23 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
26 * @class TAO_Codeset_Translator_Factory_T
28 * @brief Template for translator factory classes.
30 * The template argument is the actual translator class. The factory creates an
31 * instance of the translator during initialization. Other than that, the
32 * template returns the actual values for the native and translated codeset
33 * ids, and performs the translator assignment to the CDR objects as needed.
36 template<class NCS_TO_TCS
>
37 class TAO_Codeset_Translator_Factory_T
38 : public TAO_Codeset_Translator_Factory
41 TAO_Codeset_Translator_Factory_T () = default;
42 virtual ~TAO_Codeset_Translator_Factory_T ();
44 /// initialize the factory service object. Instantiates the translator.
45 int init( int argc
, ACE_TCHAR
* argv
[]);
47 /// ncs returns the translator's native codeset ID.
48 CONV_FRAME::CodeSetId
ncs () const;
49 /// tcs returns the translator's transmission codeset ID.
50 CONV_FRAME::CodeSetId
tcs () const;
52 /// Assign the translator to the input CDR. The inherited assign_i is used
53 /// to assign either a char or wchar translator, depending on the base type
54 /// of NCS_TO_TCS. A null input CDR is permitted, in which case assign is a
56 virtual void assign (TAO_InputCDR
*) const;
57 /// Assign the translator to the output CDR. The inherited assign_i is used
58 /// to assign either a char or wchar translator, depending on the base type
59 /// of NCS_TO_TCS. A null output CDR is permitted, in which case assign is a
61 virtual void assign (TAO_OutputCDR
*) const;
64 NCS_TO_TCS
*translator_
{};
67 TAO_END_VERSIONED_NAMESPACE_DECL
69 #if !defined (ACE_LACKS_PRAGMA_ONCE)
71 #endif /* ACE_LACKS_PRAGMA_ONCE */
73 #include "tao/Codeset/Codeset_Translator_Factory_T.cpp"
75 #include /**/ "ace/post.h"
76 #endif /* TAO_Codeset_Translator_Factory_T */