diff options
author | jai <jai@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2007-01-29 21:10:39 +0000 |
---|---|---|
committer | jai <jai@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2007-01-29 21:10:39 +0000 |
commit | e7b830ab561638ed25822054be80ce12e8801d38 (patch) | |
tree | a5b9aa16924c541fcb424ee9460b1ac7f5a89352 /modules/CIAO/ciao/Cookies.cpp | |
parent | 9b720f395833b3ce2f499463e5fed37a0da926f4 (diff) | |
download | ATCD-DiffServ-Merge.tar.gz |
branching/taggingDiffServ-Merge
Diffstat (limited to 'modules/CIAO/ciao/Cookies.cpp')
-rw-r--r-- | modules/CIAO/ciao/Cookies.cpp | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/modules/CIAO/ciao/Cookies.cpp b/modules/CIAO/ciao/Cookies.cpp new file mode 100644 index 00000000000..74d02a3cd18 --- /dev/null +++ b/modules/CIAO/ciao/Cookies.cpp @@ -0,0 +1,72 @@ +// $Id$ +#include "Cookies.h" + +#if !defined (__ACE_INLINE__) +#include "Cookies.inl" +#endif /* !defined INLINE */ + +ACE_RCSID (ciao, + Cookies, + "$Id$") + +namespace CIAO +{ + Map_Key_Cookie::Map_Key_Cookie (const ACE_Active_Map_Manager_Key &key) + { + this->cookieValue ().length (ACE_Active_Map_Manager_Key::size ()); + key.encode (this->cookieValue ().get_buffer (0)); + } + + Map_Key_Cookie::~Map_Key_Cookie (void) + { + } + + bool + Map_Key_Cookie::insert (ACE_Active_Map_Manager_Key &key) + { + this->cookieValue ().length (ACE_Active_Map_Manager_Key::size ()); + key.encode (this->cookieValue ().get_buffer (0)); + return true; + } + + bool + Map_Key_Cookie::extract (::Components::Cookie *ck, + ACE_Active_Map_Manager_Key &key) + { + Map_Key_Cookie *c = + dynamic_cast <Map_Key_Cookie *> (ck); + + if (c == 0) + return false; + + ::CORBA::OctetSeq *x = c->get_cookie (); + + if (x->length () != ACE_Active_Map_Manager_Key::size ()) + return false; + + key.decode (x->get_buffer ()); + + return true; + } + + ::CORBA::OctetSeq * + Map_Key_Cookie::get_cookie (void) + { + return &this->cookieValue (); + } + + //======================================================== + CORBA::ValueBase * + Map_Key_Cookie_init::create_for_unmarshal () + { + CORBA::ValueBase *ret_val = 0; + + ACE_NEW_THROW_EX (ret_val, + CIAO::Map_Key_Cookie, + CORBA::NO_MEMORY ()); + + return ret_val; + } + + +} |