Advanced: Creating Customized OSIs : Customizing API Definitions : General API Definitions : Get-Set Function APIs

Get-Set Function APIs
 
Sample Definition
Get Function Declare(nameid, returntype, argType, argName)
$<returntype> get_$<nameid>_CB($<argType> $<argName>);
Forward declaration of the 'Get' function (placed in type_def.h)
Defines the forward declaration of the "Get" function for a Rational Statemate element, like a Data-Item or a Condition.
The API's definition is generated in the file type_def.h
For Data-Item named DI, of type Real:
double get_DI_CB( void);
Get Function Define(nameid, returntype, argType, argName, getElemCode)
"$<returntype>
get_$<nameid>_CB($<argType> $<argName>){
$<getElemCode>
}"
Definition of the 'Get' function (placed in glob_func.c)
Defines the definition of the "Get" function for a Rational Statemate element, like a Data-Item or a Condition.
This API's definition is generated in the file glob_func.c
For Data-Item named DI, of type Real:
Get Function Name(nameid)
Name of the 'Get' function, used for the Panel/Test-Driver Bindings (placed in glob_func.c)
Used when the name of the "Get" function is required.
For example, when using the Test-Driver instrumentation, and the "Get Value" option, this API is used to initialize the Test-Driver data.
For Data-Item named DI of type integer:
testDriver_addKey(3, "DI", INTEGER_DATA_ITEM_T, DI_CB, get_DI_CB);
Get Array Element Function Declare(nameid, returntype, argType, argName)
$<returntype> get_$<nameid>_CB($<argType> $<argName>);
Forward declaration of the 'Get' function (placed in type_def.h)
For elements of type array, this is used in the file type_def.h to generate the forward declaration of the "Get" function for the array's element.
For Data-Item named DI_ARR of type array of integers:
int get_DI_ARR_ArrElm_CB(int index);
Get Array Element Function Define(nameid, returntype, argType, argName, getElemCode)
"$<returntype>
get_$<nameid>_CB($<argType> $<argName>){
$<getElemCode>
}
Definition of the 'Get' function for array's element(placed in glob_func.c)
For elements of type array, this is used in the file glob_func.c to generate the definition of the "Get" function for the array's element.
For Data-Item named DI_ARR of type array of integers:
get_DI_ARR_CB_ArrElm(int index)
return(DI_ARR[index - DI_ARR_INDEX_SHIFT]);
Set Function Declare(nameid, returntype, argType, argName)
$<returntype> $<nameid>_CB($<argType> $<argName>);
Forward declaration of the 'Set' function (placed in type_def.h)
Defines the forward declaration of the "Set" function for a Rational Statemate element, like a Data-Item or a Condition.
The API's definition is generated in the file type_def.h
For Data-Item named DI, of type Real:
void DI_CB(doubel di_val);
Set Function Define(nameid, returntype, argType, argName, tstDrvInst, setElemCode)
"$<returntype>
$<nameid>_CB($<argType> $<argName>){
$<tstDrvInst>
$<setElemCode>
}
Definition of the 'Set' function (placed in glob_func.c)
Defines the definition of the "Set" function for a Rational Statemate element, like a Data-Item or a Condition.
This API's definition is generated in the file glob_func.c
For Data-Item named DI, of type Real:
Set Function Name(nameid)
Name of the 'Set' function, used for the Panel/Test-Driver Bindings (placed in glob_func.c)
Used when the name of the "Set" function is required.
For example, when using the Test-Driver instrumentation, this API is used to initialize the Test-Driver data.
For Data-Item named DI of type integer:
testDriver_addKey(3, "DI", INTEGER_DATA_ITEM_T, DI_CB, get_DI_CB);
Set Array Element Function Declare(nameid, returntype, argType, arrIndexArgType, arrIndexArgName, argName)
$<returntype> $<nameid>_CB($<argType> $<argName>, $<arrIndexArgType> $<arrIndexArgName>);
Forward declaration of the 'Set' function (placed in type_def.h)
For elements of type array, this is used in the file type_def.h to generate the forward declaration of the "Set" function for the array's element.
For Data-Item named DI_ARR of type array of integers:
void DI_ARR_CB_ArrElm(double di_val, int index);
Set Array Element Function Define(nameid, returntype, argType, argName, arrIndexArgType, arrIndexArgName, tstDrvInst, setElemCode)
"$<returntype>
$<nameid>_CB($<argType> $<argName>, $<arrIndexArgType> $<arrIndexArgName>){
$<tstDrvInst>
$<setElemCode>
}
Definition of the 'Set' function (placed in glob_func.c)
For elements of type array, this is used in the file glob_func.c to generate the definition of the "Set" function for the array's element.
For Data-Item named DI_ARR of type array of integers:
DI_ARR_CB_ArrElm(double di_val, int index){
DI_ARR[index - DI_ARR_INDEX_SHIFT] = di_val;