Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Codeset_Translator_Factory_T.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 // ===================================================================
00004 /**
00005  *  @file   Codeset_Translator_Factory_T.h
00006  *
00007  *  $Id: Codeset_Translator_Factory_T.h,v 1.1.8.1 2003/04/10 14:04:03 phil Exp $
00008  *
00009  *  @author   Phil Mesnier <mesnier_p@ociweb.com>
00010  */
00011 // =========================
00012 #ifndef TAO_CODESET_TRANSLATOR_FACTORY_T_H
00013 #define TAO_CODESET_TRANSLATOR_FACTORY_T_H
00014 
00015 #include "ace/pre.h"
00016 
00017 #include "tao/Codeset_Translator_Factory.h"
00018 
00019 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00020 # pragma once
00021 #endif /* ACE_LACKS_PRAGMA_ONCE */
00022 
00023 /**
00024  * @class TAO_Codeset_Translator_Factory_T
00025  *
00026  * @brief Template for translator factory classes.
00027  *
00028  * The template argument is the actual translator class. The factory creates an
00029  * instance of the translator during initialization. Other than that, the
00030  * template returns the actual values for the native and translated codeset
00031  * ids, and performs the translator assignment to the CDR objects as needed.
00032  */
00033 
00034 template<class NCS_TO_TCS>
00035 class TAO_Codeset_Translator_Factory_T
00036 : public TAO_Codeset_Translator_Factory
00037 {
00038 public:
00039 
00040   TAO_Codeset_Translator_Factory_T ();
00041   ~TAO_Codeset_Translator_Factory_T ();
00042 
00043   /// initialize the factory service object. Instantiates the translator.
00044   int init( int argc, ACE_TCHAR* argv[]);
00045 
00046   /// ncs returns the translator's native codeset ID.
00047   CONV_FRAME::CodeSetId ncs () const;
00048   /// tcs returns the translator's transmission codeset ID.
00049   CONV_FRAME::CodeSetId tcs () const;
00050 
00051   /// Assign the translator to the input CDR. The inherited assign_i is used
00052   /// to assign either a char or wchar translator, depending on the base type
00053   /// of NCS_TO_TCS. A null input CDR is permitted, in which case assign is a
00054   /// no-op.
00055   virtual void assign (TAO_InputCDR *) const;
00056   /// Assign the translator to the output CDR. The inherited assign_i is used
00057   /// to assign either a char or wchar translator, depending on the base type
00058   /// of NCS_TO_TCS. A null output CDR is permitted, in which case assign is a
00059   /// no-op.
00060   virtual void assign (TAO_OutputCDR *) const;
00061 
00062 private:
00063   NCS_TO_TCS *translator_;
00064 };
00065 
00066 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00067 # pragma once
00068 #endif /* ACE_LACKS_PRAGMA_ONCE */
00069 
00070 #if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
00071 #include "tao/Codeset_Translator_Factory_T.cpp"
00072 #endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
00073 
00074 #if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
00075 #pragma implementation ("Codeset_Translator_Factory_T.cpp")
00076 #endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
00077 
00078 #include "ace/post.h"
00079 #endif /* TAO_Codeset_Translator_Factory_T */

Generated on Mon Jun 16 13:48:05 2003 for TAO by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002