You are here: Home V2 Software Software More ... Memops Code Generation Strategy Documents Override switches

Override switches

Switches for turning on and off validity checking and other parts of the code. IMPLEMENTED Rasmus Fogh 2007

The override switches are,

inConstructor, isReading, and override.




Is an implementation switch, not under external control, that lives MemopsObject in and affects a single object.

During the execution of an object constructor, inConstructor turns off
checks for changeability and handcoded constraints for modifier functions, as well as modifier and delete notifiers. It also suppresses redundant permission handling for individual attributes while the parent object is being created.

Type and cardinality checking is left active. So are permission checks on other objects.



Is an implementation switch, not under external control, that lives in FileTopObject in and affects all objects that share that TopObject.

During the execution of an object constructor, isReading turns of
all permission checking and 'isModified' tracking for modifiers and constructors, and execution of special constructorCode. Note that notifiers are active, but deferred. IsReading also turns off the setting of serials, setting of parent-to-child links, and setting File implementation attributes like the topObjByGuid dictionary and some of the bookkeeping with repositories.

NOTE: objects created during isReading require a lot of aftercare, and the sue should be limited to bulk import of objects, like the reading of XML files.



Is an implementation switch under user control that lives in
MemospRoot and affects all known objects.

Override turns off all notifiers, all validity checking except type checking (this includes cardinality checking and key uniqueness checking), and the execution of special constructor code. Override does *not* turn off permission checking, parent/child links, or file implementation bookkeeping.

NOTE: the localkey attributes must be passed directly to the constructor even under override to avoid errors.



Works as for MemopsObjects, to the extent applicable


Has all the effects of MemopsObject : override. It allows you to create en
empty DataTypeObject and add the attributes afterwards - provided you unset it explicitly afterwards. The object will check False if override is on.

It is implemented as a frozen, mandatory attribute with default value False. In practice this menas that it can not be switched on once it is off (except by bypassing the API). 

Objects with override==True are invalid (if tested) and throw an error if you try to compare, hash, or stringify them. The override attribute is not treated as part of the object value, it is an internal state.