1
struct Car {
  string model;
  boolean reserved;
};

interface gestion{
  Car consult(in string model);
};

I want to make the consult method return an array of Cars, do I need to create another struct and put a car array in it?

Johnny Willemsen
  • 2,942
  • 1
  • 14
  • 16

1 Answers1

1

You can define the array in IDL as following

typedef Car CarArray[5];

But, this is a fixed size array. If you want to create a variable size array, it is better to use a sequence like

typedef sequence <Car> CarSequence;

And than change the consult method to

CarArray consult(in string model);

or

CarSequence consult(in string model);
Johnny Willemsen
  • 2,942
  • 1
  • 14
  • 16