2 #include "ace/Dynamic_Service.h"
3 #include "ace/Log_Msg.h"
4 #include "tao/Codeset/UTF8_Latin1_Factory.h"
6 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
8 ACE_STATIC_SVC_DEFINE (TAO_UTF8_Latin1_Factory
,
9 ACE_TEXT ("UTF8_Latin1_Factory"),
11 &ACE_SVC_NAME (TAO_UTF8_Latin1_Factory
),
12 ACE_Service_Type::DELETE_THIS
13 | ACE_Service_Type::DELETE_OBJ
,
15 ACE_FACTORY_DEFINE (TAO_Codeset
, TAO_UTF8_Latin1_Factory
)
18 TAO_UTF8_Latin1_Factory::~TAO_UTF8_Latin1_Factory ()
20 delete this->translator_
;
23 TAO_UTF8_Latin1_Factory::init (int argc
, ACE_TCHAR
*argv
[])
25 TAO_Codeset_Translator_Factory::init (argc
, argv
);
30 TAO_UTF8_Latin1_Factory::ncs () const
33 return this->translator_
->ncs();
37 TAO_UTF8_Latin1_Factory::tcs () const
40 return this->translator_
->tcs();
43 // Assign either a reference to the existing translator or a new translator
44 // for input CDR streams
46 TAO_UTF8_Latin1_Factory::assign (TAO_InputCDR
*cdr
) const
51 this->assign_i(cdr
,this->translator_
);
55 // Assign either a reference to the existing translator or a new translator
56 // for output CDR streams
58 TAO_UTF8_Latin1_Factory::assign (TAO_OutputCDR
*cdr
) const
63 this->assign_i(cdr
,this->translator_
);
68 TAO_UTF8_Latin1_Factory::create_translator () const
70 if (this->translator_
== 0)
72 TAO_UTF8_Latin1_Factory
* pthis
=
73 const_cast <TAO_UTF8_Latin1_Factory
*>(this);
74 ACE_NEW (pthis
->translator_
, TAO_UTF8_Latin1_Translator
);
75 if (this->translator_
== 0)
78 TAOLIB_ERROR ((LM_ERROR
,
79 ACE_TEXT ("(%P|%t) TAO_UTF8_Latin1_Factory cannot ")
80 ACE_TEXT("create TAO_UTF8_Latin1_Translator\n")
86 TAO_END_VERSIONED_NAMESPACE_DECL