blob: 27d5d57ae16453efc5ddf3150dbdedb0d77147e0 (
plain)
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
|
#include "orbsvcs/Notify/PropertySeq.h"
#if ! defined (__ACE_INLINE__)
#include "orbsvcs/Notify/PropertySeq.inl"
#endif /* __ACE_INLINE__ */
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
TAO_Notify_PropertySeq::TAO_Notify_PropertySeq (void)
{
}
TAO_Notify_PropertySeq::~TAO_Notify_PropertySeq ()
{
}
int
TAO_Notify_PropertySeq::init (const CosNotification::PropertySeq& prop_seq)
{
ACE_CString name;
for (CORBA::ULong i = 0; i < prop_seq.length (); ++i)
{
name = prop_seq[i].name.in ();
if (this->property_map_.rebind (name, prop_seq[i].value) == -1)
return -1;
}
// Note call to rebind. This allows to call <init> to set updates.
return 0;
}
int
TAO_Notify_PropertySeq::populate (CosNotification::PropertySeq_var& prop_seq) const
{
PROPERTY_MAP::CONST_ITERATOR iterator (this->property_map_);
int index = prop_seq->length ();
prop_seq->length (static_cast<CORBA::ULong> (index + this->property_map_.current_size ()));
for (PROPERTY_MAP::ENTRY *entry = 0;
iterator.next (entry) != 0;
iterator.advance (), ++index)
{
(*prop_seq)[index].name = CORBA::string_dup (entry->ext_id_.c_str ());
(*prop_seq)[index].value = entry->int_id_;
}
return 0;
}
void
TAO_Notify_PropertySeq::add(const ACE_CString& name, const CORBA::Any& val)
{
int ret = this->property_map_.rebind (name, val);
ACE_ASSERT(ret >= 0);
ACE_UNUSED_ARG (ret); // because the assert disappears in release builds
}
TAO_END_VERSIONED_NAMESPACE_DECL
|