00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file CodecFactory_impl.h 00006 * 00007 * $Id: CodecFactory_impl.h 81429 2008-04-24 18:49:54Z johnnyw $ 00008 * 00009 * @author Ossama Othman <ossama@uci.edu> 00010 */ 00011 //============================================================================= 00012 00013 #ifndef TAO_CODEC_FACTORY_IMPL_H 00014 #define TAO_CODEC_FACTORY_IMPL_H 00015 00016 #include /**/ "ace/pre.h" 00017 00018 #include "tao/CodecFactory/IOP_Codec_includeC.h" 00019 00020 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00021 # pragma once 00022 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00023 00024 #include "tao/LocalObject.h" 00025 00026 // This is to remove "inherits via dominance" warnings from MSVC. 00027 // MSVC is being a little too paranoid. 00028 #if defined(_MSC_VER) 00029 #pragma warning(push) 00030 #pragma warning(disable:4250) 00031 #endif /* _MSC_VER */ 00032 00033 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00034 00035 class TAO_Codeset_Translator_Base; 00036 00037 /** 00038 * @class TAO_CodecFactory 00039 * 00040 * @brief Implementation of the IOP::CodecFactory interface. 00041 * 00042 * This class can be used to create Codec (coder/decoder) of a given 00043 * type, such as a CDR encapsulation Codec. 00044 */ 00045 class TAO_CodecFactory 00046 : public virtual IOP::CodecFactory, 00047 public virtual ::CORBA::LocalObject 00048 { 00049 public: 00050 00051 /// Constructor 00052 TAO_CodecFactory (TAO_ORB_Core * orb_core); 00053 00054 /// Create a Coder/Decoder for the given type of encoding. 00055 virtual IOP::Codec_ptr create_codec (const IOP::Encoding & enc); 00056 00057 /// Create a Coder/Decoder for the given type of encoding and codesets. 00058 virtual IOP::Codec_ptr create_codec_with_codesets (const IOP::Encoding_1_2 & enc); 00059 00060 private: 00061 /// Prevent copying through the copy constructor and the assignment 00062 /// operator. 00063 TAO_CodecFactory (const TAO_CodecFactory &); 00064 void operator= (const TAO_CodecFactory &); 00065 00066 IOP::Codec_ptr create_codec_i (CORBA::Octet major, 00067 CORBA::Octet minor, 00068 IOP::EncodingFormat encoding_format, 00069 TAO_Codeset_Translator_Base * char_trans, 00070 TAO_Codeset_Translator_Base * wchar_trans); 00071 private: 00072 00073 /// Pointer to the ORB Core. 00074 /** 00075 * Some Codec implementations may need access to the ORB Core with 00076 * which they are associated. 00077 */ 00078 TAO_ORB_Core * const orb_core_; 00079 00080 }; 00081 00082 TAO_END_VERSIONED_NAMESPACE_DECL 00083 00084 #if defined(_MSC_VER) 00085 #pragma warning(pop) 00086 #endif /* _MSC_VER */ 00087 00088 #include /**/ "ace/post.h" 00089 00090 #endif /* TAO_CODEC_FACTORY_IMPL_H */