|
|
|
|
|
|
ACDK provides its own mapping to CORBA types,
which follows quite close to the Java definition.
For the basic types the same type mapping
will be used as Java.
Not supported are:
- Fixed
- Wchar
- Wstring
- Enum
- Any
IDL type string will be translated to ::acdk::lang::RString
The type Enum is currently not supported.
Use the int representative instead.
Arrays are not supported. Use sequence instead.
Sequences are encoded as ACDK arrays (typeArray).
For the basic value types you can use the corresponding
array classes (RintArray, RdoubleArray, RboolArray, etc.)
For string and constructed values you can also use the
array classes (RStringArrray, etc.)
//IDL
void foo(in sequence<string> vals, out sequence<long> indice);
|
will be in ACDK:
//ACDK
void foo(RStringArray vals, OUT(RintArray) indice);
|
//IDL
struct BunchOfValues
{
string label;
int index;
};
void foo(in BunchOfValues vals);
|
Structs will implemented as normal classes, which
should be transfered by value:
// ACDK
class BunchOfValues
: extends ::acdk::lang::Object,
implements ::acdk::io::Serializable
{
ACDK_WITH_METAINFO(BunchOfValues) // needed for serialisation
public:
/**
needed for create a new instance.
alternativally create_instance() should be defined.
*/
BunchOfValues()
: Object()
{
}
string label;
int index;
};
void foo(in BunchOfValues vals);
|
Are not supported yet.
Object References are implemented in org::omg::CORBA::Object
Value types are supported using ACDK's standard serialization
feature.
Value types (including the mapped struct) should be derived
from the ::acdk::io::Serializable interface.
To support attributes, accessor methods should be implemented:
interface Foo
{
attribute int ivalue;
readonly attribute string svalue;
};
|
will be mapped in ACDK:
class Foo
: implements ::org::omg::CORBA::portable::InvokeHandler
{
private:
int _ivalue;
RString _svalue;
public:
int _get_ivalue() { return _ivalue; }
void _set_ivalue(int ival) { _ivalue = ival; }
RString _get_svalue() { return _svalue; }
// no setter for svalue because readonly
};
|
// IDL
int foo(in int ini, out int outi, inout int inouti);
// acdk
int foo(IN(int) ini, OUT(int) outi, INOUT(int) inouti);
|
If no IN/OUT/INOUT is given automatically an in value will be
asumed.
IN - values are passed by value, normally basic types or
RObject's.
OUT and INOUT values are passed by reference.
void foo(IN(RString) istr, OUT(RString) ostr)
{
istr = "modified"; // has no effect for the caller
ostr = "modified";// has effect for the caller
}
|
|
|