|
a question about Classes as Unions
Hi,
I define some classes as below:
/////////////////////////////////////////////////////
enum VARTYPE { VTNULL, VTBOOL, VTBYTE, VTSHORT, VTINT, VTLONG, VTFLOAT, VTDOUBLE, VTSTRING, VTBLOB, VTSTRINGBLOB };
class Variant{
string toString();
int fromString(string s);
VARTYPE getType();
};
class VariantBoolean extends Variant { bool value; };
class VariantByte extends Variant { byte value; };
class ComplexObj{
int i;
Variant value;
};
interface MyOp{
int submit(ComplexObj obj);
};
//////////////////////////////////////////////////////////////////
In the client side, member "value" of ComplexObj object is instantiated as VariantBooleanI object.
After client invoke submit() of MyOp, the server throws an exception as below:
//////////////////////////////////////////////////////////////////
infoprocmgt: warning: dispatch exception: g:\def.
cpp:1521: Ice::NoObjectFactoryException:
protocol error: no suitable object factory found for `Variant'
identity: MyOp.submit
facet:
operation: submit
//////////////////////////////////////////////////////
do Ice support the semantics?
Thanks in advance.
FengXB
__________________
Fengxb
|