Zen API

- Home
- Topics
- Types
- Files

All Classes Files Functions Variables Typedefs Friends Macros Modules Pages

kStatus kObject_Clone | ( | kObject * | object,
|  | kObject | source,
|  | kAlloc | allocator
| ) |  |

Constructs a new object by copying an existing object, including any aggregated child elements.

If the source object is an object collection (e.g. kArrayList<kString>), any aggregated child objects are also cloned. In this case, the kObject_Dispose method can be used to free the cloned collection and its associated elements.

This method will fail if the source object (or an aggregated child element) does not support cloning.

To support cloning, derived classes should override the kObject_VInitClone method.

Parameters

  object | Receives the constructed object.
  source | Source object.
  allocator | Memory allocator (or kNULL for default).

Returns
  Operation status.

See also
  kObject_Dispose