company logo

PropertyHandle :: CopyInst - Copy transient instance

The function allows copying a transient instance into the the collection referenced by the property handle. Source and target may have different structure definitions. Properties are copied by property names. Type conversion is performed when necessary. After copying the attributes the function tries to locate the instance according to the sort key or the identifying key (if no order is defined). Otherwise the function tries to locate the instance in the base collection (if there is any). When the instance does already exist in the collection it will be overwritten according to the replace options. Otherwise the instance is added to the collection.

Return value:  Target instance ( void * )

Instances do have the type of the referenced property handle (collection type). The instance contains a pointer to a properly structured instance area.

You can use the !-operator or the GetData() function to check whether the instance refers to data or not.

Implementation details

::Instance PropertyHandle  :: CopyInst ( ::Instance srce_inst, smcb *srcesmcb, PIREPL replopt=REPL_none, COPY_Options copy_type=COPY_all )
  • srce_inst - - internal feature (not documented)
  • srcesmcb - Pointer to general structure definition

    The smcb is a more general way to define structure (DBStructDef). It contains information for the structure and its properties. The definition describes the structure of the instance passed to the function.

  • replopt - Replace option

    Replace options can be passed in order to control the behavior of copy functions.

    Default: REPL_none
  • copy_type - Copy type

    The copy type determines the way of copying instances. Depending on import, export or copy processes, the meaning differs slightly.

    Default: COPY_all