Archived
This forum has been archived. Please start a new discussion on GitHub.
About self-referential class
level
in Help Center
Classes can be self-referential. For example:
class Link
{
SomeType value;
Link next;
};
Once the Link Object is very large and I pass this object to another PC,How can I know the percent that have already translated?
class Link
{
SomeType value;
Link next;
};
Once the Link Object is very large and I pass this object to another PC,How can I know the percent that have already translated?
0
Comments
-
Originally posted by level
The self-referential class can create many objects in one lists?
When I pass this object from one pc to another pc,How can I know the time that finish .
If you have classes that can point at other classes, and you send one of the class instances in the graph as a parameter, all class instances that are reachable from the initial class instance are sent as well (that is, the entire graph is marshaled across).
You know that the marshaling has finished when the operation is invoked in the server (because the run time will not start an operation in the server until all the data for the invocation is available).
Cheers,
Michi.0 -
Originally posted by level
Well.
That is,it is impossible that I want to know the translating percent ?
How can I evaluate the time?
Ah, you want to know how fast various graphs marshal? That's not hard to do: take the throughput demo and modify it to transmit class graphs instead of byte sequences. Then you can benchmark any graph you like.
Cheers,
Michi.0 -
The only way to do that would be to manually marshal your object graph into a sequence of bytes and send it in pieces, as you described. You would have to use an internal Ice class (IceInternal::BasicStream) in order to create the byte sequence. There are examples of this in the Freeze sources (specifically, see the code generated for a Freeze map).
Of course, the disadvantage of this solution (in addition to the use of an internal Ice API) is that your Slice definitions become more obscure and less type-safe.
Note that we are planning to add a public API for doing this in a future release.
Take care,
- Mark0
