[omniORB] Using CORBA for data transfer?

Bruce Fountain B_Fountain@motherwell.com.au
Tue, 12 Jun 2001 17:03:21 +0800


Matej Kenda [mailto:matej.kenda@hermes.si] wrote:
> One of the crucial parts of our application is data transfer 
> between two of
> our objects. Data consists of files, enriched with some 
> additional meta-data
> and is generated by the object A and written to disk as-is by object B
> (ftp-like). Data is packaged in data blocks, which size is defined at
> run-time.
> 
> The simplified IDL should look something like:
> 
> struct dataBlock {
>     long    size;
>     char    data   // how to make this variable? (like char 
> *data in C)
> };
> 
> interface B {
>     long writeBlock(inout dataBlock a_data);
> ...
> }

You would normally use a sequence, since you have variable-length blocks:

   // IDL
   typedef sequence<char> dataBlock;

You don't need a size parameter anymore because the sequence knows its
own length (this is pretty much equivalent to std::vector<char>).

If your data is actually binary you would probably use sequence<octet>
instead of sequence<char>. This should be sufficiently efficient for most
purposes, but applications like streaming video often push the limits of
the ORB implementation.

Bruce Fountain
b_fountain@motherwell.com.au