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

updateInstanceForRedefinedClass

updateInstanceForRedefinedClass( 
g_obj 
l_addedSlots 
l_deletedSlots 
l_dplList 
) 
=> t

Description

A generic function, which is called to update all instances of a class, when a class redefinition occurs.

The primary method of updateInstanceForRedefinedClass checks the validity of initargs and throws an error if the provided initarg is not declared. It then initializes slots with values according to the initargs, and initializes the newly added-slots with values according to their initform forms.

When a class is redefined and an instance is being updated, a property-list is created that captures the slot names and values of all the discarded slots with values in the original instance. The structure of the instance is transformed so that it conforms to the current class definition.

The arguments of updateInstanceForRedefinedClass are the transformed instance, a list of slots added to the instance, a list of slots deleted from the instance, and the property list containing the slot names and values of slots that were discarded. This list of discarded slots contains slots that were local in the old class and are shared in the new class.

Arguments

g_obj

Instance of the class being redefined.

l_addedSlots

A list of slots added to the class.

l_deletedSlots

A list of slots deleted from the class.

l_dplList

A list of slots that were discarded, with their values.

Value Returned

t

Always returns t

Examples

Define a method for the class myClass (to be applied to all instances of myClass if it is redefined):

(defmethod updateInstanceForRedefinedClass ((obj myClass) added deleted
dplList @rest initargs)
;;callNextMethod for obj and pass ?arg "myArg" value for slot arg
(apply callNextMethod obj added deleted dplList ?arg "myArg" initargs)

Related Topics

Generic Functions and Methods


Return to top
 ⠀
X