Merge pull request #2301 from sonndinh/remove-dup-reactor-functions
[ACE_TAO.git] / TAO / orbsvcs / tests / EC_Custom_Marshal / ECM_Data.cpp
blob3a946c12854191fc7d1f10518d350b6f70910c55
1 #include "ECM_Data.h"
2 #include "tao/CDR.h"
5 CORBA::Boolean
6 operator<< (TAO_OutputCDR& cdr, ECM_Data& x)
8 // We are a little careless about error checking in this routine,
9 // because one the CDR gets the error bit on it is never disabled.
10 CORBA::ULong count = x.inventory.current_size ();
11 if (cdr << x.description.in ()
12 && cdr << count )
14 for (ECM_Data::Inventory::ITERATOR i = x.inventory.begin ();
15 i != x.inventory.end () && cdr.good_bit ();
16 ++i)
18 const ECM_Data::Inventory::ENTRY& v = *i;
19 cdr << v.ext_id_;
20 cdr << v.int_id_;
23 return cdr.good_bit ();
26 CORBA::Boolean
27 operator>> (TAO_InputCDR& cdr, ECM_Data& x)
29 // We are a little careless about error checking in this routine,
30 // because one the CDR gets the error bit on it is never disabled.
31 CORBA::ULong count;
32 if (cdr >> x.description.out ()
33 && cdr >> count)
35 // ACE_DEBUG ((LM_DEBUG, "Decoding <%d> elements\n", count));
37 for (CORBA::ULong i = 0; i < count && cdr.good_bit (); ++i)
39 CORBA::ULong ext_id;
40 CORBA::Double int_id;
41 cdr >> ext_id;
42 cdr >> int_id;
43 if (cdr.good_bit ())
44 x.inventory.bind (ext_id, int_id);
46 // ACE_DEBUG ((LM_DEBUG, "Boung <%d,%f>\n", ext_id, int_id));
49 return cdr.good_bit ();