USER’S MANUAL__________________________________________________________________
410 _________________________________________________________________ M211322EN-D
D.4.1 Function Pointers are the Key to
Customization
Each major mode is characterized by a set of function pointers or methods,
which define how certain critical operations are to be carried out. The main
RVP8 threads are governed by the following methods:
struct rvp8MainMajorMode { /* Customized processing routines */
privateData_t *privateData ;
exitMajorMode_f *exitMajorMode ;
initProcSection_f *initProcSection ;
exitProcSection_f *exitProcSection ;
rtCtrlCBF_f *rtCtrlCBF ;
iNominalTrigSequence_f *iNominalTrigSequence ;
iCustomTrigSequence_f *iCustomTrigSequence ;
customUserOpcode_f *customUserOpcode ;
cwpulseMatchedFilter_f *cwpulseMatchedFilter ;
iTxWaveformDesign_f *iTxWaveformDesign ;
rawPulseCorrections_f *rawPulseCorrections ;
rawPulseCorrections_f *targetSimulator ;
lConfigError_f *lConfigError ;
lFindNextCPI_f *lFindNextCPI ;
lCheckupCPI_f *lCheckupCPI ;
lAssignProcsInCPI_f *lAssignProcsInCPI ;
setupProcBins_f *setupProcBins ;
lAnalyzeBurstPhseq_f *lAnalyzeBurstPhseq ;
getAzElPosBtime_f *getAzElPosBtime ;
sampleLiveAzElPos_f *sampleLiveAzElPos ;
insertLiveAzElPos_f *insertLiveAzElPos ;
frontPanelDisplay_f *frontPanelDisplay ;
} ;
Users of object-oriented languages recognize this sort of structure as
allowing new objects to inherit existing properties of old objects, while still
permitting individual "personality" to enter as needed. Like the Linux
Kernel, the RVP8 is written in standard C, and uses function pointer
replacement to accomplish customization. Much of the RVP8 code
organization was patterned after the elegant and intricate implementation
of driver module replacement within Linux.
The initMajorMode() routine, which creates each major mode in the first
place, is not part of this list because it is separately invoked (see Section
D.4 Creating New Major Modes from Old Ones on page 402) in order to
first establish the list. Detailed descriptions of the various methods are
included, along with their definitions, in rvp8main.h and rvp8proc.h.
Here are a few fundamentals: