Merge pull request #2216 from jwillemsen/jwi-cxxversionchecks
[ACE_TAO.git] / TAO / tao / Codeset / Codeset_Translator_Factory_T.h
blobc46d028914cac52a97bb5be1e331865f7f3f2ff7
1 // -*- C++ -*-
3 // ===================================================================
4 /**
5 * @file Codeset_Translator_Factory_T.h
7 * @author Phil Mesnier <mesnier_p@ociweb.com>
8 */
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)
19 # pragma once
20 #endif /* ACE_LACKS_PRAGMA_ONCE */
23 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
25 /**
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
40 public:
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
55 /// no-op.
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
60 /// no-op.
61 virtual void assign (TAO_OutputCDR *) const;
63 private:
64 NCS_TO_TCS *translator_ {};
67 TAO_END_VERSIONED_NAMESPACE_DECL
69 #if !defined (ACE_LACKS_PRAGMA_ONCE)
70 # 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 */