=default for generated implementation copy ctor
[ACE_TAO.git] / TAO / tao / Codeset / UTF8_Latin1_Factory.cpp
blobbc4070431a3437502ab25ac4074f592e973f19d4
1 #include "tao/debug.h"
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"),
10 ACE_SVC_OBJ_T,
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_;
22 int
23 TAO_UTF8_Latin1_Factory::init (int argc, ACE_TCHAR *argv[])
25 TAO_Codeset_Translator_Factory::init (argc, argv);
26 return 0;
29 CONV_FRAME::CodeSetId
30 TAO_UTF8_Latin1_Factory::ncs () const
32 create_translator();
33 return this->translator_->ncs();
36 CONV_FRAME::CodeSetId
37 TAO_UTF8_Latin1_Factory::tcs () const
39 create_translator();
40 return this->translator_->tcs();
43 // Assign either a reference to the existing translator or a new translator
44 // for input CDR streams
45 void
46 TAO_UTF8_Latin1_Factory::assign (TAO_InputCDR *cdr) const
48 if (cdr)
50 create_translator();
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
57 void
58 TAO_UTF8_Latin1_Factory::assign (TAO_OutputCDR *cdr) const
60 if (cdr)
62 create_translator();
63 this->assign_i(cdr,this->translator_);
67 void
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)
77 if (TAO_debug_level)
78 TAOLIB_ERROR ((LM_ERROR,
79 ACE_TEXT ("(%P|%t) TAO_UTF8_Latin1_Factory cannot ")
80 ACE_TEXT("create TAO_UTF8_Latin1_Translator\n")
81 ));
86 TAO_END_VERSIONED_NAMESPACE_DECL