Chapter 12. ODB.Classes

Table of Contents
Overview
API Reference

Overview

Functional Description

This package maintains a list of all classes (packages) which are derived from the persistent type ODB.Persistent.Object if the package has registered it self.

The following information is available per class; - Pointer to the so called factory

- All attribute names of a class.

If the application shall support persistence, the following pieces of code has to be added some where during the initialization.

Class_ID := Classes.Register_Factory( Object'Tag, Factory'Access );

Classes.Attribute( Class_ID, "D_Name", D_Name ); Classes.Attribute( Class_ID, "D_Used", D_Used ); Classes.Attribute( Class_ID, "D_Elements", D_Elements );

This example registers the funtion Factory with Object'tag and adds the attributes D_Name, D_Used and D_Elements.

The factor function creates an instance of the class for which is the function has been registered.

Restrictions

In order to serialize/deserialize the object data, for each attribute of a persistent object a name has to be defined. This is done by means of the Attribute functions (for a typlica example refer to ODB.Collection).