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


4.2.7.7 Data Replication

Copying objects holding references to other objects requires apt references management. The type of copy assumed is the deep copy. The method copies the dependent data - the objects referred by the object being copied. Descending through hierarchies of objects requires that the references of the same object are identified and copied accordingly, and thus data is copied only once and the copied topologies are preserved.

The reference tracking logic of the libaime type system is to be observed by the registered data copy methods, the copy methods in struct x1f4_nodetype_type data type definitions.

See struct x1f4_nodetype_type.

The logic is defined for data types allowing references to be hold. No logic is defined for other data types.

Data copy methods are supplied a reference tracking context, a pointer to a pointer map that maps the copied data for the made copy.

See Reference Tracker.

If the context is not created, the copy method needs to create it. In such event it also needs to destroy the context once the data copy completes.

See x1f4_init_lxfset.

See x1f4_fini_lxfset.

The copy method is required to map the object being copied for the copy being made with the reference tracking context before it starts copying the data the object refers.

For every object referred by the object being copied, the copy method will examine its type. If the type associates a struct x1f4_nodetype_type definition and if the definition has a non null copy field, the copy method will correct its logic for reference copying.

If the type of the referred object defines a reference registration routine (if the X1f4_LX_LINK_ACCESS bit is included with flags field of the struct x1f4_nodetype_type definition) and if the referred object has already been copied once (as determined upon examination of the reference tracking context) the already made copy will be relinked via the reference registration routine and no other action will be taken.

See Common Data Type Flags.

See x1f4_find_lxfset.

Otherwise the copy method will proceed to make a copy of the referred object, via the copy method specific to its respective data type, supplying the called method with the reference tracking context.

Once the copy of the referred object is ready, the copy method will map the referred object for its newly made copy with the reference tracking context, yet only if the type of the referred object defines a reference registration routine (if the X1f4_LX_LINK_ACCESS bit is included with flags field of the struct x1f4_nodetype_type definition) and only if the copy logic of the referred object type does not register made copies with the reference tracking context itself (if the X1f4_LX_AUTO_RECORD bit is not included with flags field of the struct x1f4_nodetype_type definition).

See x1f4_post_lxfset.

The struct x1f4_nodetype_type definition to which the copy method pertains is to include itself the X1f4_LX_AUTO_RECORD bit with its flags field, for it does register the copies it makes.


Next: Non Recursive Data Replication, Previous: Cycle Dismantling, Up: Referable Objects   [Index]