V4 Design: Database Access Semantics

From EPICSWIKI
Revision as of 20:25, 25 May 2005 by MartyKraimer (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

EPICS: IOC database access

May 25 2005

Overview

This document gives a summary of actions IOC database access must implement and how it uses dbdClass definitions to implement the actions.


Not yet defined is how the following are created:

  • DbdStructList - The list of the description of each structure type.
  • DbdRecordList - The list of the description of each record type.
  • DbdLinkList - The list of the description of each DBD link definition
  • DbdDeviceList - The list of the description of each DBD device definition.

The following assumes that these lists have been created.


dbLoadRecords

To create and initialize a new record instance the following is done:

allocate a DbdRecordInstance
Search DbdRecordList to find DbdRecord (record type description)
Call DbdRecord.plifetime->allocate 
for each DbdStructField in DbdRecord.pfield
    switch DbdStructField.type
        case: epicsBooleanT, ..., epicsFloat64T
            initialize the field if DbdStructFieldAttribute.default is defined.
            break;
        case: epicsStructT
            initialize EpicsStruct.pstructDef
            Call EpicsStructDef.plifetime->allocate
            break;
        case: epicsStructT
            initialize EpicsStruct.pstructDef
            Call EpicsStructDef.plifetime->allocate
            break;
        default:
            do nothing. Let record support handle it