Storage management

So far this chapter has described classes and data types that are common to the graphics classes. There are also some terms used in function names that are common to the CommonPoint application system that indicate a particular function's rule in storage management. These terms are provided here for your convenience while reading this manual. Please refer to the Taligent's Guide to Designing Programs for more information on programming conventions.

Functions that allocate and take responsibility for storage, or return pointers to instances, have special names and abide by the following guidelines:

Create: When you see "Create" in the name, the function makes and returns a new instance that the caller must delete.

Copy: When you see "Copy" in the name, the function copies an existing instance and the caller must delete that copy.

Adopt: When you see "Adopt" in the name, the function accepts an instance and is responsible for deleting it. Adopt functions that cannot have "Adopt" in their names (for example, constructors) prefix the name of the formal parameter with Adopt.

Orphan: When you see "Orphan" in the name, the function transfers responsibility for deleting an instance to the caller.

Get: When you see "Get" in the name, the function returns a pointer to an instance, and the caller is not responsible for deleting the instance.


[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker