Removed complex C++ registration of subroutines,

replaced by function() statments in .dbd file.
This commit is contained in:
Andrew Johnson
2002-09-25 18:36:48 +00:00
parent 9481cf9649
commit 137b10f7a8
5 changed files with 20 additions and 48 deletions

View File

@@ -30,7 +30,7 @@ TEMPLATES += top/exampleApp/src/exampleInclude.dbd
TEMPLATES += top/exampleApp/src/sncExample.stt
TEMPLATES += top/exampleApp/src/xxxRecord.dbd
TEMPLATES += top/exampleApp/src/exampleMain.cpp
TEMPLATES += top/exampleApp/src/dbSubExample.cpp
TEMPLATES += top/exampleApp/src/dbSubExample.c
TEMPLATES += top/exampleBoot/Makefile
TEMPLATES += top/exampleBoot/nfsCommands@vxWorks

View File

@@ -35,7 +35,7 @@ PROD_IOC = example
example_SRCS += xxxRecord.c
example_SRCS += devXxxSoft.c
example_SRCS += dbSubExample.cpp
example_SRCS += dbSubExample.c
# <name>_registerRecordDeviceDriver.cpp will be created from <name>.dbd
example_SRCS += example_registerRecordDeviceDriver.cpp

View File

@@ -0,0 +1,16 @@
#include <stdio.h>
#include "subRecord.h"
typedef long (*processMethod)(subRecord *precord);
long mySubInit(subRecord *precord,processMethod process)
{
printf("%s mySubInit process %p\n",precord->name, (void*) process);
return(0);
}
long mySubProcess(subRecord *precord)
{
printf("%s mySubProcess\n",precord->name);
return(0);
}

View File

@@ -1,46 +0,0 @@
#include <stddef.h>
#include <stdlib.h>
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include <registryFunction.h>
#include <subRecord.h>
extern "C" {
typedef long (*processMethod)(subRecord *precord);
long mySubInit(subRecord *precord,processMethod process);
long mySubProcess(subRecord *precord);
void mySubRecordFunctionsRegister(void);
}
long mySubInit(subRecord *precord,processMethod process)
{
printf("%s mySubInit process %p\n",precord->name,process);
return(0);
}
long mySubProcess(subRecord *precord)
{
printf("%s mySubProcess\n",precord->name);
return(0);
}
void mySubRecordFunctionsRegister(void)
{
if(!registryFunctionAdd("mySubInit",(REGISTRYFUNCTION)mySubInit))
errlogPrintf("mySubRecordFunctionsRegister registryFunctionAdd failed\n");
if(!registryFunctionAdd("mySubProcess",(REGISTRYFUNCTION)mySubProcess))
errlogPrintf("mySubRecordFunctionsRegister registryFunctionAdd failed\n");
}
/*
* Register commands on application startup
*/
class mySubRegister {
public:
mySubRegister() { mySubRecordFunctionsRegister(); }
};
static mySubRegister mySubRegisterObj;

View File

@@ -1,3 +1,5 @@
include "base.dbd"
include "xxxRecord.dbd"
device(xxx,CONSTANT,devXxxSoft,"SoftChannel")
function("mySubInit")
function("mySubProcess")