Home Help Center

About self-referential class

levellevel Member ✭✭
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?

Comments

  • michimichi Member Michi HenningOrganization: Triodia TechnologiesProject: I have a passing interest in Ice :-) ✭✭✭
    Sorry, but I don't understand your question. Can you try to explain a bit more? Exactly what are you concerned about? Performance or something else?

    Thanks,

    Michi.
  • levellevel Member ✭✭
    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 .
  • michimichi Member Michi HenningOrganization: Triodia TechnologiesProject: I have a passing interest in Ice :-) ✭✭✭
    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.
  • levellevel Member ✭✭
    Well.
    That is,it is impossible that I want to know the translating percent ?

    How can I evaluate the time?
  • michimichi Member Michi HenningOrganization: Triodia TechnologiesProject: I have a passing interest in Ice :-) ✭✭✭
    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.
  • levellevel Member ✭✭
    When I transmit byte sequences ,I do split this sequences to many little part on purpose.Because I want to show the user this transmit rate of progress .
    Well then,how can I show the rate of transmit progress ,when I transmit a large graphs that is created with the self-referential class?
  • mesmes CaliforniaAdministrators, ZeroC Staff Mark SpruiellOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    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,
    - Mark
  • levellevel Member ✭✭
    Thanks for your respondence.
    Which version can include this superexcellent function?
    Waiting....:p
Sign In or Register to comment.