Methods of storing and depackaging attributes of an object
First Claim
1. A method for sending an object, the object corresponding to a class, said class being part of an inheritance tree constituted by one or more classes, the method comprising:
- providing a storage method in the one or more classes;
defining a packet, including an address block, and a body;
setting an index parameter to an initial value;
recursively traversing the inheritance tree of the object by calling the respective storage method of any parent classes in the inheritance tree, incrementing the index parameter with each upward traversing step;
during the traversing, when one of the classes encountered has no ancestor or has no ancestor yet to be encountered;
determining a next free body address;
writing, into the address block at a location based on a current value of the index parameter, an indicator of the determined next free body address; and
writing a class identifier and any attributes of the one of the classes encountered into the body at the next free body address;
ending the traversing after all of the classes in the inheritance tree of the object have been encountered; and
sending the packet to send the object.
1 Assignment
0 Petitions
Accused Products
Abstract
A method of storing in a packet attributes associated with an object corresponding to a class that is part of an inheritance tree, each class in the inheritance tree including a storage method including an index parameter, includes the following steps: calling storage methods of parent classes, if any, incrementing the index parameter, placing a first free address in the packet into the packet at an address determined by the index parameter, and copying attributes of a current class into the packet from the first free address with an identifier of the current class. The storage method calls the storage method of the corresponding class with a null value of the index parameter.
-
Citations
4 Claims
-
1. A method for sending an object, the object corresponding to a class, said class being part of an inheritance tree constituted by one or more classes, the method comprising:
-
providing a storage method in the one or more classes;
defining a packet, including an address block, and a body;
setting an index parameter to an initial value;
recursively traversing the inheritance tree of the object by calling the respective storage method of any parent classes in the inheritance tree, incrementing the index parameter with each upward traversing step;
during the traversing, when one of the classes encountered has no ancestor or has no ancestor yet to be encountered;
determining a next free body address;
writing, into the address block at a location based on a current value of the index parameter, an indicator of the determined next free body address; and
writing a class identifier and any attributes of the one of the classes encountered into the body at the next free body address;
ending the traversing after all of the classes in the inheritance tree of the object have been encountered; and
sending the packet to send the object. - View Dependent Claims (2, 3, 4)
providing a header for the packet; and
storing in the header an identifier of a corresponding class of the object.
-
-
3. The method as claimed in claim 1, wherein the address block has a predetermined size.
-
4. A method of depacketing an object from a packet formed by a method as claimed in claim 1, comprising:
-
providing a builder method in the one or more classes;
depacketing the object by repeatedly performing, in order;
calling the builder method of any of parent classes identified in the packet, using the value of the index parameter;
for the current class, recovering a data address in the packet at an address based on the index parameter; and
for the current class, recovering from the packet values of attributes of the object at the data address.
-
Specification