8.7. Method Arguments and Results

This section describes the way arguments are handled by the RPC. Please refer to Section 10.13, “Property and Argument Types” for information about mapping between the IDL types and C++ in/out/inout types.

8.7.1. Pointers

It's illegal to use a strong pointer, or a structure containing a strong pointer, as an argument or the return type. Strong pointers always define a migration group (the group of objects that cannot be spread over more nodes), but the RPC can't be used to migrate more other objects.. Semantics of such calls would be hard to defined and probably non-obvious.

This means that you can't pass data structures consisting of multiple data objects, that from a migration groups implemented, as arguments of methods when using the RPC. You must use the standard migration instead. However, you can use arrays of objects and other data structures, implemented as properties, as method arguments.

[Note]Note

IDL compiler, factgen.pl, checks this.

8.7.2. Managed Objects

You can use a managed object as a method argument or a return type, as long as it is a value type (see Section 4.3.4, “ValueTypes”).

The IDL to C++ type mapping might indicate that the relevant objects are passed by reference. However, that's not completely true. They are passed by reference from the caller to the stubs and when calling the method of the callee object. However, they are copied and passed by value internally, especially over the network. Because of this the Massiv requires that the type of the actual argument (the object passed to the call) and the type of the formal argument (type specified in method declaration) must be the same.

Unfortunately, because references are used in the stub and method interfaces to save a few unnecessary copies, C++ compiler will not issue compile-time warning when you pass an object of a derived class instead of the correct one. The Massiv will check the types at run-time and throw Massiv::Core::Lib::RemoteCallFailedException if the types do not match.