[omniORB] two dimensional arrays

Duncan Grisby dgrisby@uk.research.att.com
Fri, 01 Mar 2002 16:26:54 +0000


On Wednesday 27 February, jshannon wrote:

> All is fine; however, when I try to use a C++ client, I can't seem to at the 
> values.  I have tried several approaches, and can get none to work.  The 
> compiler says that that the return type from:
> 
> theWalls = hc->broker->updateWalls("parameters");
> 
> Is a 'divp::IvpBroker::Walls_slice *'  Why not a '**'???

It's a Walls_slice* since that's what the C++ mapping requires.

> Is all the data structure really there?

Yes.

> Should I cast or do I need to get the array one dimension at a time(which 
> kills my performance)?

You just access the array members in the usual way. theWalls[0] is the
first element, theWalls[1] is the second, and so on.

You must free the result when you have finished with it:

  Walls_free(theWalls);

Alternatively, make theWalls a Walls_var:

  {
    Walls_var theWalls;
    theWalls = hc->broker->updateWalls("parameters");
  }
  // Array freed when theWalls goes out of scope.

Cheers,

Duncan.

-- 
 -- Duncan Grisby  \  Research Engineer  --
  -- AT&T Laboratories Cambridge          --
   -- http://www.uk.research.att.com/~dpg1 --