corbaidlomniorb

CORBA: Is there a way to specify a default value for an operation argument in IDL?


I have a simple CORBA interface with a simple operation as shown in this IDL extract:

interface MtInterface
{
    void myOperation(in string id);
}

I need to add a boolean argument to myOperation. So all I do is change my IDL to:

interface MtInterface
{
    void myOperation(in string id, in boolean flag);
}

Now this is all well and good, except that this interface is used in quite a lot of places and I would like to avoid having to modify all the calls by giving a default value of false to flag, so my first try looks like:

interface MtInterface
{
    void myOperation(in string id, in boolean flag = false);
}

but this makes omniORB bark with Syntax error in operation parameters.

So to repeat the question in the title: Is there a way to specify a default value for an operation argument in general in my IDL? And in this particular case, how would I specify a default value of false for flag?

Thanks for your help!


Solution

  • No. IDL doesn't support default arguments, probably because some of the target languages don't support that feature.