[omniORB] Using cdrMemoryStream?

amos at amos.mailshell.com amos at amos.mailshell.com
Thu Jul 21 12:23:13 BST 2005


Hello,

I'm trying to serialize an object created locally on the
server into a file. (the aim is to read that object later
from the file and send it to CORBA clients upon request
as a function's return value).

I tried the following ("op" is the object I want to
serialize):

operationslog::Operation op;
op._d(0);
operationslog::AddRealmOp addRealmOp;
addRealmOp.id = id;
addRealmOp.name = name;
op.addRealm(addRealmOp);
cdrMemoryStream stream;
	
op >>= stream;
cout << "addRealm: stream: buffer size: " << stream.bufSize() << endl;

But apparently this causes the operation to abort.
(Commenting this out causes the rest of the code, which doesn't
do CORBA-specific stuff, to succeed).
What am I doing wrong here?  As far as I can tell from
reading the cdrMemorySteam.cc source I think that I
try to use it correctly.

Could you please forward me to a sample code or documentation
of this class and how can it (or other parts of omniORB) used
to achieve my goal?

Thanks,

--Amos





More information about the omniORB-list mailing list