1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
// @(#) $Id$
#include "tao/AnyTypeCode/NVList_Adapter_Impl.h"
ACE_RCSID (AnyTypeCode,
NVList_Adapter_Impl,
"$Id$")
#include "tao/AnyTypeCode/NVList.h"
#include "tao/SystemException.h"
void
TAO_NVList_Adapter_Impl::create_list (
CORBA::Long count,
CORBA::NVList_ptr &new_list
ACE_ENV_ARG_DECL)
{
ACE_ASSERT (CORBA::ULong (count) <= UINT_MAX);
// Create an empty list
ACE_NEW_THROW_EX (new_list,
CORBA::NVList,
CORBA::NO_MEMORY (
CORBA::SystemException::_tao_minor_code (
0,
ENOMEM),
CORBA::COMPLETED_NO));
ACE_CHECK;
// If count is greater than 0, create a list of NamedValues.
if (count != 0)
{
new_list->max_ = (CORBA::ULong) count;
for (CORBA::Long i = 0; i < count; ++i)
{
CORBA::NamedValue_ptr nv = 0;
ACE_NEW_THROW_EX (nv,
CORBA::NamedValue,
CORBA::NO_MEMORY (
CORBA::SystemException::_tao_minor_code (
0,
ENOMEM),
CORBA::COMPLETED_NO));
ACE_CHECK;
new_list->values_.enqueue_tail (nv);
}
}
}
void
TAO_NVList_Adapter_Impl::create_named_value (
CORBA::NamedValue_ptr &nv
ACE_ENV_ARG_DECL)
{
ACE_NEW_THROW_EX (nv,
CORBA::NamedValue,
CORBA::NO_MEMORY (
CORBA::SystemException::_tao_minor_code (
0,
ENOMEM),
CORBA::COMPLETED_NO));
}
|