[omniORB] sequence<octet> type

renny.koshy at rubixinfotech.com renny.koshy at rubixinfotech.com
Tue May 4 14:46:32 BST 2004


Another good reference for these types of questions:

      Advanced CORBA Programming with C++
      by Henning & Vinoski
      Published by Addison Wesley
      ISBN: 0-201-37927-9

I don't know if there's a newer edition (mine is circa '99), but this is
how I learned CORBA, and after that it's a great reference book...

Renny Koshy
President & CEO

--------------------------------------------
RUBIX Information Technologies, Inc.
www.rubixinfotech.com


                                                                                                                                                     
                      "Clarke Brunt"                                                                                                                 
                      <clarke.brunt at yeomannavigatio        To:                                                                                       
                      n.co.uk>                              "Croonen Davy" <croonen.davy at pandora.be>, <omniorb-list at omniorb-support.com>             
                      Sent by:                             cc:                                                                                       
                      omniorb-list-bounces at omniorb-        Subject:  Re: [omniORB] sequence<octet> type                                              
                      support.com                                                                                                                    
                                                                                                                                                     
                                                                                                                                                     
                      05/04/2004 01:34 PM                                                                                                            
                                                                                                                                                     
                                                                                                                                                     




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


_______________________________________________
omniORB-list mailing list
omniORB-list at omniorb-support.com
http://www.omniorb-support.com/mailman/listinfo/omniorb-list








More information about the omniORB-list mailing list