[omniORB] sequence<octet> type
Clarke Brunt
clarke.brunt at yeomannavigation.co.uk
Tue May 4 19:34:31 BST 2004
From: Croonen Davy
>I'm trying to pass an image file from the client to the server. I know I
have to use the sequence<octet> type for storing the image file and then
transport to the server. But how do I put the image in the sequence<octet>
type??? I'm using C++ as program language.
>Could somebody give me maybe some code examples or tell me where I can find
some of these examples where they try to pass a file with the
sequence<octet> type.
I didn't see any reply to this on the list so far: You should get yourself a
copy of the CORBA C++ Language Mapping spec. from http://www.omg.org/ (or
wherever), and look at the section "Mapping for Sequence Types". I don't
think I can add much more to what it says there.
You should typedef your sequence<octet> in your IDL (so that it then has a
proper typename - whatever you call it in the typedef statement), then use
the various constuctors and operators described in the spec. to make
yourself an instance of such a type. There are constructors/operators which
will accept a chunk of memory full of your image (the argument is probably
docomented at 'T* data'). And similar for getting the data back out again at
the other end.
It's also probably worth you learning about _var types from the spec. as
well if you are not familiar with them (automatic memory handling).
Regards,
Clarke Brunt, Principle Software Engineer, Yeoman Navigation
More information about the omniORB-list
mailing list