EPICS Base  7.0.7.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Public Attributes | List of all members
typed_dset Struct Reference

#include <devSup.h>

Public Attributes

long number
 
long(* report )(int lvl)
 
long(* init )(int after)
 
long(* init_record )(struct dbCommon *prec)
 
long(* get_ioint_info )(int detach, struct dbCommon *prec, IOSCANPVT *pscan)
 

Detailed Description

Type safe version of 'struct dset'

Recommended usage:

In Makefile:

USR_CPPFLAGS += -DUSE_TYPED_RSET -DUSE_TYPED_DSET

In C source file:

#include <devSup.h>
#include <dbScan.h> // For IOCSCANPVT
...
#include <epicsExport.h> // defines epicsExportSharedSymbols
...
static long init_record(dbCommon *prec);
static long get_iointr_info(int detach, dbCommon *prec, IOCSCANPVT* pscan);
static long longin_read(longinRecord *prec);
longindset devLiDevName = {
{
5, // 4 from dset + 1 from longinRecord
NULL,
NULL,
&get_iointr_info
},
&longin_read
};
epicsExportAddress(dset, devLiDevName);

Definition at line 65 of file devSup.h.

Member Data Documentation

long typed_dset::number

Number of function pointers which follow. The value depends on the recordtype, but must be >=4

Definition at line 68 of file devSup.h.

long(* typed_dset::report)(int lvl)

Called from dbior()

Definition at line 70 of file devSup.h.

long(* typed_dset::init)(int after)

Called twice during iocInit(). First with after = 0 before init_record() or array field allocation. Again with after = 1 after init_record() has finished.

Definition at line 75 of file devSup.h.

long(* typed_dset::init_record)(struct dbCommon *prec)

Called once per record instance

Definition at line 77 of file devSup.h.

long(* typed_dset::get_ioint_info)(int detach, struct dbCommon *prec, IOSCANPVT *pscan)

Called when SCAN="I/O Intr" on startup, or after SCAN is changed.

Caller must assign the third argument (IOCSCANPVT*). eg.

struct mpvt {
IOSCANPVT drvlist;
};
...
// init_record() routine calls
scanIoInit(&pvt->drvlist);
...
static long get_ioint_info(int detach, struct dbCommon *prec, IOCSCANPVT* pscan) {
if(prec->dpvt)
pscan = &((mypvt*)prec->dpvt)->drvlist;

When a particular record instance can/will only used a single scan list, the detach argument can be ignored.

If this is not the case, then the following should be noted.

  • get_ioint_info() is called with detach = 0 to fetch the scan list to which this record will be added.
  • get_ioint_info() is called later with detach = 1 to fetch the scan list from which this record should be removed.
  • Calls will be balanced, so a call with detach = 0 will be followed by one with detach = 1.
Note
get_ioint_info() will be called during IOC shutdown if the dsxt::del_record() extended callback is defined. (from 3.15.0.1)

Definition at line 108 of file devSup.h.


The documentation for this struct was generated from the following file: