Product Documentation
Cadence SKILL++ Object System Reference
Product Version IC23.1, June 2023

changeClass

changeClass( 
g_inst 
g_className 
[ g_initArgs ] 
) 
=> g_updatedInst

Description

Changes the class of the given instance (g_inst) to the specified class (g_className).

The function updateInstanceForDifferentClass() is called on the modified instance to allow applications to deal with new or lost slots.

Arguments

g_inst

An instance of standardObject.

g_className

The new class for the instance.

g_initArgs

Additional arguments to be passed to the updateInstanceForDifferentClass() function.

Value Returned

g_updatedInst

The updated instance.

Examples

(defclass A () ())
(defclass B (A) ((slot @initarg s)))
 x = (makeInstance 'A)
(changeClass x 'B ?s 1)
(classOf x)
    => class:B

Related Topics

Classes and Instances


Return to top
 ⠀
X