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

Codeset_Translator_Factory.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 // ===================================================================
00004 /**
00005  *  @file   Codeset_Translator_Factory.h
00006  *
00007  *  $Id: Codeset_Translator_Factory.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_H
00013 #define TAO_CODESET_TRANSLATOR_FACTORY_H
00014 #include "ace/pre.h"
00015 #include "ace/Service_Object.h"
00016 
00017 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00018 # pragma once
00019 #endif /* ACE_LACKS_PRAGMA_ONCE */
00020 
00021 #include "tao/corbafwd.h"
00022 #include "tao/CONV_FRAMEC.h"
00023 
00024 class TAO_InputCDR;
00025 class TAO_OutputCDR;
00026 
00027 class ACE_Char_Codeset_Translator;
00028 class ACE_WChar_Codeset_Translator;
00029 
00030 
00031 // ****************************************************************
00032 
00033 /**
00034  * @class TAO_Codeset_Translator_Factory
00035  *
00036  * @brief Abstract base class for factories providing codeset translators
00037  *
00038  * The codeset translator factory is a loadable service object. It is used to
00039  * supply the actual translator used in converting between two codesets. The
00040  * intent of using a factory is to avoid requiring codeset translators to be
00041  * multiply inherited both from the translator base class and the service
00042  * object base. The translator factory is also responsible for assigning
00043  * translators to CDR streams. Since there is no common base class between
00044  * input and output CDRs, the assingment code must be duplicated.
00045  */
00046 
00047 class TAO_Export TAO_Codeset_Translator_Factory :
00048   public ACE_Service_Object
00049 {
00050 public:
00051   TAO_Codeset_Translator_Factory ();
00052   virtual ~TAO_Codeset_Translator_Factory ();
00053   virtual int init (int argc, ACE_TCHAR *argv[]);
00054 
00055   /// Get the native codeset ID from the factory. There is no reasonable
00056   /// default for this method, so it is left abstract.
00057   virtual CONV_FRAME::CodeSetId ncs () const = 0;
00058 
00059   /// Get the translated codeset ID from the factory. There is no reasonable
00060   /// default for this method, so it is left abstract.
00061   virtual CONV_FRAME::CodeSetId tcs () const = 0;
00062 
00063   /// Assign the translator to the supplied input CDR. This is left abstract
00064   /// since the factory base does not have a reference to the actual translator
00065   /// instance. The template instance provides this implementation.
00066   virtual void assign (TAO_InputCDR *) const = 0;
00067 
00068   /// Assign the translator to the supplied output CDR. This is left abstract
00069   /// since the factory base does not have a reference to the actual translator
00070   /// instance. The template instance provides this implementation.
00071   virtual void assign (TAO_OutputCDR *) const = 0;
00072 
00073 protected:
00074 
00075   /// Assign the translator to the supplied input CDR. The template instance
00076   /// will have a translator that is based on either the Char or Wchar
00077   /// translator, so the compiler will select the appropriate call from
00078   /// assign().
00079   void assign_i (TAO_InputCDR *, ACE_Char_Codeset_Translator* ) const;
00080   /// Assign the translator to the supplied input CDR. The template instance
00081   /// will have a translator that is based on either the Char or Wchar
00082   /// translator, so the compiler will select the appropriate call from
00083   /// assign().
00084   void assign_i (TAO_InputCDR *, ACE_WChar_Codeset_Translator* ) const;
00085   /// Assign the translator to the supplied output CDR. The template instance
00086   /// will have a translator that is based on either the Char or Wchar
00087   /// translator, so the compiler will select the appropriate call from
00088   /// assign().
00089   void assign_i (TAO_OutputCDR *, ACE_Char_Codeset_Translator* ) const;
00090   /// Assign the translator to the supplied output CDR. The template instance
00091   /// will have a translator that is based on either the Char or Wchar
00092   /// translator, so the compiler will select the appropriate call from
00093   /// assign().
00094   void assign_i (TAO_OutputCDR *, ACE_WChar_Codeset_Translator* ) const;
00095 };
00096 
00097 // Get the template includes last
00098 #include "tao/Codeset_Translator_Factory_T.h"
00099 
00100 #include "ace/post.h"
00101 #endif /* TAO_Codeset_Translator_Factory */

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