blob: 5266128cada2ab3ff57fed91c732b378caf95b56 (
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
62
|
#include "Cookies.h"
#if !defined (__ACE_INLINE__)
#include "Cookies.inl"
#endif /* !defined INLINE */
namespace CIAO
{
Cookie_Impl::Cookie_Impl (ptrdiff_t const &key)
{
this->cookieValue ().length (sizeof (ptrdiff_t));
ACE_OS::memcpy (this->cookieValue ().get_buffer (false),
&key,
sizeof (ptrdiff_t));
}
Cookie_Impl::~Cookie_Impl (void)
{
}
bool
Cookie_Impl::extract (Components::Cookie const * const ck,
ptrdiff_t &key)
{
Cookie_Impl const * const c =
dynamic_cast <Cookie_Impl const *> (ck);
if (c == 0)
{
return false;
}
CORBA::OctetSeq const &x = c->cookieValue ();
if (x.length () != sizeof (ptrdiff_t))
{
return false;
}
key = *reinterpret_cast<const ptrdiff_t*> (x.get_buffer ());
return true;
}
//========================================================
CORBA::ValueBase *
Cookie_Impl_init::create_for_unmarshal (void)
{
CORBA::ValueBase *ret_val = 0;
ACE_NEW_THROW_EX (ret_val,
CIAO::Cookie_Impl,
CORBA::NO_MEMORY ());
return ret_val;
}
Cookie_Impl_init::~Cookie_Impl_init (void)
{
}
}
|