The current implementation has several considerations to be kept in mind. The main constraints include POAs: the CORBA module uses Portable Object Adapters (POAs) instead of Basic Object Adapters (BOAs.) BOAs are not supported.
The Boxed Values object is not supported.
| CORBA type | Method type |
|---|---|
| Boolean | Bool |
| char | String |
| wide char | String |
| string | String |
| wide string | String |
| octet | Int |
| short | Int |
| unsigned short | Int |
| long | Int |
| unsigned long | Int |
| long long | Int |
| unsigned long long | Int |
| float | Real |
| double | Real |
The OUT argument modifier can be used for every primitive type listed in the table above. However, for Struct and Union objects there is a limitation, they have to be instantiated before being passed as an output argument. Hence, for structures and unions, an example Method is the following:
structTest = CorbaTestsTestStruct() structOutOp paramTest returning structTest = aTestStruct
and
testUnion = CorbaTestsTestUnion()
testUnion.aBoolean = false
paramTest = CorbaTestsParamTest("ParamTest")
unionOutOp paramTest returning
testUnion = aTestUnion
Summarizing, just as arguments should be instantiated with IN and INOUT arguments, arguments should also be instantiated with OUT arguments.
Union objects are implemented by using helpers that permit marshaling and un-marshaling to and from the server side. Before a union is marshaled, any attribute of the union should be set. In other words,
testUnion = CorbaTestsTestUnion()
// the attribute is set before the union is used as
// an argument
testUnion.aBoolean = false
paramTest = CorbaTestsParamTest("ParamTest")
unionOutOp paramTest returning
testUnion = aTestUnion
This is required for all operations involving the use of unions. Furthermore, since unions also have default attributes, they can be used as any other attribute. For example:
union ShortUnion switch(short)
{
case0: string aString;
case1: wstring aWString;
default: short defaultShort;
};
Then, the default attribute is defaultShort and can be used as follows:
shortUnion = CorbaTestsShortUnion()
shortUnion.defaultShort = 1
unionTest = CorbaTestsUnionTest("ParamTest")
shortUnionTest unionTest using
aShortUnion = shortUnion
If no attribute is set and the union is used in a remote invocation, the execution framework will raise an exception indicating that any attribute should be set before the union is marshaled to the server side.
The structure implementation is similar to the Union implementation. All of the structure members should be initialized before use. This means that no attribute (member) can be Null when it is used with remote invocations. Should this happen, the server will respond with a marshal error.