Go to the documentation of this file.00001
00002
00003 #include "tao/AnyTypeCode/NVList_Adapter_Impl.h"
00004
00005 ACE_RCSID (AnyTypeCode,
00006 NVList_Adapter_Impl,
00007 "$Id: NVList_Adapter_Impl.cpp 88517 2010-01-13 08:54:34Z johnnyw $")
00008
00009 #include "tao/AnyTypeCode/NVList.h"
00010 #include "tao/SystemException.h"
00011 #include "ace/CORBA_macros.h"
00012
00013 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00014
00015 void
00016 TAO_NVList_Adapter_Impl::create_list (
00017 CORBA::Long count,
00018 CORBA::NVList_ptr &new_list)
00019 {
00020 ACE_ASSERT (CORBA::ULong (count) <= UINT_MAX);
00021
00022 ACE_NEW_THROW_EX (new_list,
00023 CORBA::NVList,
00024 CORBA::NO_MEMORY (
00025 CORBA::SystemException::_tao_minor_code (
00026 0,
00027 ENOMEM),
00028 CORBA::COMPLETED_NO));
00029
00030
00031 if (count != 0)
00032 {
00033 new_list->max_ = (CORBA::ULong) count;
00034
00035 for (CORBA::Long i = 0; i < count; ++i)
00036 {
00037 CORBA::NamedValue_ptr nv = 0;
00038 ACE_NEW_THROW_EX (nv,
00039 CORBA::NamedValue,
00040 CORBA::NO_MEMORY (
00041 CORBA::SystemException::_tao_minor_code (
00042 0,
00043 ENOMEM),
00044 CORBA::COMPLETED_NO));
00045
00046 new_list->values_.enqueue_tail (nv);
00047 }
00048 }
00049 }
00050
00051 void
00052 TAO_NVList_Adapter_Impl::create_named_value (CORBA::NamedValue_ptr &nv)
00053 {
00054 ACE_NEW_THROW_EX (nv,
00055 CORBA::NamedValue,
00056 CORBA::NO_MEMORY (
00057 CORBA::SystemException::_tao_minor_code (
00058 0,
00059 ENOMEM),
00060 CORBA::COMPLETED_NO));
00061 }
00062
00063 int
00064 TAO_NVList_Adapter_Impl::Initializer (void)
00065 {
00066 return ACE_Service_Config::process_directive (ace_svc_desc_TAO_NVList_Adapter_Impl);
00067 }
00068
00069 ACE_STATIC_SVC_DEFINE (TAO_NVList_Adapter_Impl,
00070 ACE_TEXT ("TAO_NVList_Adapter"),
00071 ACE_SVC_OBJ_T,
00072 &ACE_SVC_NAME (TAO_NVList_Adapter_Impl),
00073 ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ,
00074 0)
00075 ACE_FACTORY_DEFINE (TAO_AnyTypeCode, TAO_NVList_Adapter_Impl)
00076 TAO_END_VERSIONED_NAMESPACE_DECL