|
|
|
Copyright © 2003-2009 ZeroC, Inc. |
14.14 Serializable Objects
As discussed in Section 4.18, you can pass CLR serializable objects directly as operation parameters or as fields of another data type. For example:["clr:serializable:SomeNamespace.CLRClass"]
sequence<byte> CLRObj;
struct MyStruct {
int i;
CLRObj o;
};
interface Example {
void op(CLRObj o, MyStruct s);
};The generated code for MyStruct contains member i of type int and a member o of type SomeNamespace.CLRClass:Of course, your client and server code must have an implementation of CLRClass that sets the Serializable attribute:You can implement this class in any way you see fit—the Ice run time does not place any other requirements on the implementation. However, note that the CLR requires the class to reside in the same assembly for client and server.
|
|