Interface to define a message protocol

Consider the following $interface used to define a message protocol:


@import "Ceda/cxRmi/Rmi.h"     // required

$interface+ rmi Ix
{
    void Sum([in]int32 a,[in]int32 b,[out]int32& c);   // c = a+b
    void PrintInt([in]int32 x);                        // Print the value of x
};

Note the keyword 'rmi' which causes xcpp to generate stub/skeleton code for the interface. The interface should not subtype IObject. Each parameter must support serialisation to an Archive or from an InputArchive.

Each function parameter is prefixed with one of the following:

Sum() has out-parameters and therefore is referred to as a two-way function.

PrintInt() has no out-parameters and therefore is referred to as a one-way function. This means there will be no response message (not even an acknowledge) paired with the request message.

No object identifiers in the protocol

Unlike many conventional OO middleware systems the protocol doesn't allow for sending some kind of object identifier as part of every message to indentify the recipient. Instead all messages are bound to a single receiver object that is specified at the time the RmiCallee is first created. Furthermore all messages that can be received are defined a-priori in a single interface definition.