Each device is initialised at creation time with default values. These default values can be defined (in order of precedence) either -
Each class has a template copy of a device which is initialised at runtime by the class_initialise method. It is used for initialising devices of this class. Analogous to the class pointer, aGPowerSupplyClass, the template device is called aGPowerSupply. It is defined and should only be accessible from the classes source code. It should be initialised in the class_initialise() to the predefined code defaults which can be overridden by the class defaults stored in the static database. This means the class_initialise() should access the database after it has initialised the default object. This object will be used to initialise all newly created objects of that class. In C this is achieved by a single structure assignment statement. The defaults in the template object can be overridden by the devices defaults stored in the database.