Resources | Resources |



IDL input parameter in C++

Memory for the argument is allocated by the caller. These arguments are mapped as const unless the type is an interface. Otherwise, the user of the interface will be unable to invoke any of its methods since they are not const functions. All user defined types (struct, union) are passed as pointers to the defined type.

Note: With the exception of interface pointers, no in pointer may be NULL.

The following is an in parameter example:

struct point
  short x;
  float y;

interface ITest
  // ...

interface IFoo
  long process(in short id, 
   in string name, 
   in point origin,
   in ITest test);

is mapped as (omitting the structure and ITest mapping):

struct IFoo
  virtual int process(short int id, 
   const char* name, 
   const point* origin, 
   ITest* test) = 0;