KCMS CMM Developer's Guide

Protected Derivatives

Differences in physical profile formats is hidden by abstracting the physical pieces of all profile parts into a standard set of objects that represent them. This can be a problem when a new profile format contains a new part that cannot be represented by any of the objects. It is neither a transformation nor an attribute.

If the new derivation can support the existing objects, you can use a new derivation with getObject(). If you need a new object type, see if the derivation supports the new object. Any new profile format that supports this new object is derived from that new format derivative instead of the base class.

If you use the KcsChunkSet class appropriately in your new derivative, implemention is minimal. The base class allows the minimum derivative to only override the save() method by having the derivative assign chunks with hard-coded offsets for the pieces of a profile during save(). Then load() automatically loads the pieces from the hard-coded offsets by using the chunk set mechanism. If, however, your derivative's pieces are split into smaller pieces, you must override load() to gather the smaller pieces into the original objects.

Base Class Support

The base class supports the caching objects and transformation map saving. It contains the KcsXform * array, an KcsAttribute * and supports the getObject() and setObject() overloads. Most derivative profile formats implement these virtuals: initEmptyFormat(), isSupported(), load(), and save().

A derivative can define and use the base class data elements protected during load(), and the base class passes them to you.

Retrievable Objects

To find out if a part of an instance is supported, the derivative needs to support the pure virtual method isSupported(KcsLoadHint). This method returns KCS_SUCCESS for only its loadable parts and, if the request is not supported. It takes a loadhint that indicates what can be returned from all getObject() overloads; this includes whether the forward xform is supported as well as any new parts.

An unsupported object is represented by a NULL in one of the object pointers (attributes or xforms) and it returns KCS_PFMT_NO_DATA_SUPPORT_4_REQUEST.