Next: , Previous: , Up: Referable Objects   [Index]


4.2.7.8 Non Recursive Data Replication

The object copying as performed by the copy method in the struct x1f4_nodetype_type data type definition does not work (well) for deep object structures, as it is recursive. Such structures may appear under objects holding references to other objects (in turn holding references...).

See struct x1f4_nodetype_type.

An alternative non recursive copy procedure may be offered by the data type implementation. The procedure is a two steps one: in the first step objects are created (empty) and in the second the references that they hold are set up.

A list of copied but not yet set up objects is maintained by the non recursive copy algorithm. The list is created by the regular copying entry point, the copy method. The dependent objects of data types observing the non recursive data replication protocol (identified by the X1f4_LX_PULL_ACCESS bit in the flags field of their struct x1f4_nodetype_type definition) and that would otherwise be copied via the copy method are instead only created via the post method in their struct x1f4_nodetype_type definitions.

See Common Data Type Flags.

The created but not yet set up objects are added to the list created at the start of copying procedure.

Once all (first level) dependent objects are created, the list is traversed and the created objects are set up. The references they should hold are added and the (next level) dependent objects are created (again empty) by reapplying the first step. The newly created objects are added to the list.

The second step is performed via the pull method in the struct x1f4_nodetype_type data type definition.

The list is a linked list one, constructed over struct x1f4_caselink_type items.

See struct x1f4_caselink_type.

The cyclic graphs copy concerns still apply.

See Data Replication.

See Data Copying.


Next: Consolidated Disposal, Previous: Data Replication, Up: Referable Objects   [Index]