Daylight v4.9
Release Date: 1 February 2008

Name

dt_copy - make a copy of an object

Generic Prototype

dt_copy(dt_Handle) => dt_Handle

C Prototype

#include "dt_smiles.h"

dt_Handle dt_copy(dt_Handle object)

FORTRAN Prototype

include 'dt_f_smiles.inc'

integer*4 dt_f_copy(object)

integer*4 object

Description

Makes a copy of the given object. A copy of an object shares no structure with the original; modifying or destroying either object has no effect on the other.

A copy of an object is guaranteed to behave exactly like the original in every respect. For example, if you copy a molecule and then generate a stream of atoms for each copy, the order of atoms will be identical. Similarly, both copies of a sequence or stream will continue the enumeration at the same point. Thus, dt_next(3) on either the copy or the original will return the same item.

Not all objects can be copied. Objects which are constituent parts of other objects (eg. atoms, bonds and cycles) cannot be copied, although new atom or bond objects can be allocated and then their properties can be copied.

Other objects, such as servers, columns, THOR databases and other THOR objects (TDTs, datatrees, datafields, etc), represent objects outside of the Toolkit environment; copies of such an object would still represent the same external thing, thus violating the requirement that the object and its copy be completely independent.

Vector objects cannot be copied (each vbind must have a unique name).

Return Value

Returns the handle for the new copy or NULL_OB if the given object is the NULL_OB, or if an error is detected.

Related Topics

dt_base(3) dt_dealloc(3) dt_parent(3)