diff --git a/Makefile b/Makefile index 267ae44..70d34e5 100644 --- a/Makefile +++ b/Makefile @@ -1,25 +1,27 @@ -# Makefile for the EPICS V4 pvDatabase module - +#Makefile at top of application tree TOP = . include $(TOP)/configure/CONFIG +DIRS := $(DIRS) $(filter-out $(DIRS), configure) +DIRS := $(DIRS) $(filter-out $(DIRS), src) +DIRS := $(DIRS) $(filter-out $(DIRS), test) +DIRS := $(DIRS) $(filter-out $(DIRS), arrayPerformance) +DIRS := $(DIRS) $(filter-out $(DIRS), $(wildcard example*)) -DIRS := configure +EMBEDDED_TOPS := $(EMBEDDED_TOPS) $(filter-out $(EMBEDDED_TOPS), test) +EMBEDDED_TOPS := $(EMBEDDED_TOPS) $(filter-out $(EMBEDDED_TOPS), arrayPerformance) +EMBEDDED_TOPS := $(EMBEDDED_TOPS) $(filter-out $(EMBEDDED_TOPS), $(wildcard example*)) -DIRS += src -src_DEPEND_DIRS = configure +define DIR_template + $(1)_DEPEND_DIRS = configure +endef +$(foreach dir, $(filter-out configure,$(DIRS)),$(eval $(call DIR_template,$(dir)))) -EMBEDDED_TOPS := $(wildcard *Top) -EMBEDDED_TOPS += $(wildcard example*) - -DIRS += $(EMBEDDED_TOPS) - -define dir_DEP +define EMB_template $(1)_DEPEND_DIRS = src endef +$(foreach dir, $(EMBEDDED_TOPS),$(eval $(call EMB_template,$(dir)))) -$(foreach dir, $(EMBEDDED_TOPS), $(eval $(call dir_DEP,$(dir)))) - -exampleDatabase_DEPEND_DIRS += testTop -examplePowerSupply_DEPEND_DIRS += testTop +#exampleDatabase_DEPEND_DIRS += test +#examplePowerSupply_DEPEND_DIRS += test include $(TOP)/configure/RULES_TOP diff --git a/arrayPerfTop/Makefile b/arrayPerformance/Makefile similarity index 77% rename from arrayPerfTop/Makefile rename to arrayPerformance/Makefile index 0a9fd57..999631d 100644 --- a/arrayPerfTop/Makefile +++ b/arrayPerformance/Makefile @@ -1,8 +1,6 @@ -# Makefile at top of application tree - +#Makefile at top of application tree TOP = . include $(TOP)/configure/CONFIG - DIRS += configure DIRS += src diff --git a/arrayPerfTop/configure/CONFIG b/arrayPerformance/configure/CONFIG similarity index 100% rename from arrayPerfTop/configure/CONFIG rename to arrayPerformance/configure/CONFIG diff --git a/testTop/configure/CONFIG_SITE b/arrayPerformance/configure/CONFIG_SITE similarity index 53% rename from testTop/configure/CONFIG_SITE rename to arrayPerformance/configure/CONFIG_SITE index c8bb011..9e1ec9a 100644 --- a/testTop/configure/CONFIG_SITE +++ b/arrayPerformance/configure/CONFIG_SITE @@ -14,11 +14,26 @@ # Set CHECK_RELEASE to NO to disable checking completely. # Set CHECK_RELEASE to WARN to perform consistency checking but # continue building anyway if conflicts are found. -CHECK_RELEASE = YES +#CHECK_RELEASE = YES + +# Set this when you only want to compile this application +# for a subset of the cross-compiled target architectures +# that Base is built for. +#CROSS_COMPILER_TARGET_ARCHS = vxWorks-68040 # To install files into a location other than $(TOP) define # INSTALL_LOCATION here. #INSTALL_LOCATION= --include $(TOP)/../configure/CONFIG_SITE.local --include $(TOP)/../../CONFIG.local +# Set this when your IOC and the host use different paths +# to access the application. This will be needed to boot +# from a Microsoft FTP server or with some NFS mounts. +# You must rebuild in the iocBoot directory for this to +# take effect. +#IOCS_APPL_TOP = + +INSTALL_INCLUDE = $(INSTALL_LOCATION)/include/pv +USR_INCLUDES += -I $(INSTALL_LOCATION)/include + +-include $(TOP)/configure/CONFIG_SITE.local +-include $(TOP)/../CONFIG.local diff --git a/arrayPerfTop/configure/ExampleRELEASE.local b/arrayPerformance/configure/ExampleRELEASE.local similarity index 100% rename from arrayPerfTop/configure/ExampleRELEASE.local rename to arrayPerformance/configure/ExampleRELEASE.local diff --git a/arrayPerfTop/configure/Makefile b/arrayPerformance/configure/Makefile similarity index 100% rename from arrayPerfTop/configure/Makefile rename to arrayPerformance/configure/Makefile diff --git a/arrayPerfTop/configure/RELEASE b/arrayPerformance/configure/RELEASE similarity index 76% rename from arrayPerfTop/configure/RELEASE rename to arrayPerformance/configure/RELEASE index cb31b40..eca1885 100644 --- a/arrayPerfTop/configure/RELEASE +++ b/arrayPerformance/configure/RELEASE @@ -1,4 +1,4 @@ -# pvDatabaseCPP/arrayPerfTop RELEASE - Location of external support modules +# pvDatabaseCPP/arrayPerformance RELEASE - Location of external support modules # # IF YOU CHANGE this file or any file it includes you must # subsequently do a "gnumake rebuild" in the application's @@ -16,9 +16,8 @@ # EPICS V4 Developers: Do not edit the locations in this file! # -# Create a file RELEASE.local pointing to your PVASRV, PVACCESS, -# PVDATA, PVCOMMON and EPICS_BASE build directories, e.g. -# PVASRV = /path/to/epics/pvaSrvCPP +# Create a file RELEASE.local pointing to your places +# for the dependencies, e.g. # PVACCESS = /path/to/epics/pvAccessCPP # PVDATA = /path/to/epics/pvDataCPP # PVCOMMON = /path/to/epics/pvCommonCPP @@ -28,14 +27,14 @@ # use the following definitions: PVDATABASE = $(TOP)/.. - --include $(TOP)/../configure/RELEASE.local -include $(TOP)/../../RELEASE.local +-include $(TOP)/../configure/RELEASE.local # If you copied this example from pvDatabaseCPP to be built as a -# standalone TOP, adjust and use the following definitions: +# standalone TOP, define +# PVDATABASE = /path/to/epics/pvDatabaseCPP +# in the appropriate RELEASE[.local], +# and use the following definitions instead: -#PVDATABASE = /path/to/epics/pvDatabaseCPP - -#-include $(TOP)/configure/RELEASE.local #-include $(TOP)/../RELEASE.local +#-include $(TOP)/configure/RELEASE.local diff --git a/arrayPerfTop/configure/RULES b/arrayPerformance/configure/RULES similarity index 100% rename from arrayPerfTop/configure/RULES rename to arrayPerformance/configure/RULES diff --git a/arrayPerfTop/configure/RULES.ioc b/arrayPerformance/configure/RULES.ioc similarity index 100% rename from arrayPerfTop/configure/RULES.ioc rename to arrayPerformance/configure/RULES.ioc diff --git a/arrayPerfTop/configure/RULES_DIRS b/arrayPerformance/configure/RULES_DIRS similarity index 100% rename from arrayPerfTop/configure/RULES_DIRS rename to arrayPerformance/configure/RULES_DIRS diff --git a/arrayPerfTop/configure/RULES_TOP b/arrayPerformance/configure/RULES_TOP similarity index 100% rename from arrayPerfTop/configure/RULES_TOP rename to arrayPerformance/configure/RULES_TOP diff --git a/arrayPerfTop/src/Makefile b/arrayPerformance/src/Makefile similarity index 100% rename from arrayPerfTop/src/Makefile rename to arrayPerformance/src/Makefile diff --git a/arrayPerfTop/src/arrayPerformance.cpp b/arrayPerformance/src/arrayPerformance.cpp similarity index 100% rename from arrayPerfTop/src/arrayPerformance.cpp rename to arrayPerformance/src/arrayPerformance.cpp diff --git a/arrayPerfTop/src/arrayPerformance.h b/arrayPerformance/src/arrayPerformance.h similarity index 100% rename from arrayPerfTop/src/arrayPerformance.h rename to arrayPerformance/src/arrayPerformance.h diff --git a/arrayPerfTop/src/arrayPerformanceMain.cpp b/arrayPerformance/src/arrayPerformanceMain.cpp similarity index 100% rename from arrayPerfTop/src/arrayPerformanceMain.cpp rename to arrayPerformance/src/arrayPerformanceMain.cpp diff --git a/arrayPerfTop/src/longArrayGet.cpp b/arrayPerformance/src/longArrayGet.cpp similarity index 100% rename from arrayPerfTop/src/longArrayGet.cpp rename to arrayPerformance/src/longArrayGet.cpp diff --git a/arrayPerfTop/src/longArrayGet.h b/arrayPerformance/src/longArrayGet.h similarity index 100% rename from arrayPerfTop/src/longArrayGet.h rename to arrayPerformance/src/longArrayGet.h diff --git a/arrayPerfTop/src/longArrayGetMain.cpp b/arrayPerformance/src/longArrayGetMain.cpp similarity index 100% rename from arrayPerfTop/src/longArrayGetMain.cpp rename to arrayPerformance/src/longArrayGetMain.cpp diff --git a/arrayPerfTop/src/longArrayMonitor.cpp b/arrayPerformance/src/longArrayMonitor.cpp similarity index 100% rename from arrayPerfTop/src/longArrayMonitor.cpp rename to arrayPerformance/src/longArrayMonitor.cpp diff --git a/arrayPerfTop/src/longArrayMonitor.h b/arrayPerformance/src/longArrayMonitor.h similarity index 100% rename from arrayPerfTop/src/longArrayMonitor.h rename to arrayPerformance/src/longArrayMonitor.h diff --git a/arrayPerfTop/src/longArrayMonitorMain.cpp b/arrayPerformance/src/longArrayMonitorMain.cpp similarity index 100% rename from arrayPerfTop/src/longArrayMonitorMain.cpp rename to arrayPerformance/src/longArrayMonitorMain.cpp diff --git a/arrayPerfTop/src/longArrayPut.cpp b/arrayPerformance/src/longArrayPut.cpp similarity index 100% rename from arrayPerfTop/src/longArrayPut.cpp rename to arrayPerformance/src/longArrayPut.cpp diff --git a/arrayPerfTop/src/longArrayPut.h b/arrayPerformance/src/longArrayPut.h similarity index 100% rename from arrayPerfTop/src/longArrayPut.h rename to arrayPerformance/src/longArrayPut.h diff --git a/arrayPerfTop/src/longArrayPutMain.cpp b/arrayPerformance/src/longArrayPutMain.cpp similarity index 100% rename from arrayPerfTop/src/longArrayPutMain.cpp rename to arrayPerformance/src/longArrayPutMain.cpp diff --git a/arrayPerfTop/src/vectorPerformanceMain.cpp b/arrayPerformance/src/vectorPerformanceMain.cpp similarity index 100% rename from arrayPerfTop/src/vectorPerformanceMain.cpp rename to arrayPerformance/src/vectorPerformanceMain.cpp diff --git a/configure/CONFIG_SITE b/configure/CONFIG_SITE index 7be84ea..3d2a190 100644 --- a/configure/CONFIG_SITE +++ b/configure/CONFIG_SITE @@ -14,11 +14,15 @@ # Set CHECK_RELEASE to NO to disable checking completely. # Set CHECK_RELEASE to WARN to perform consistency checking but # continue building anyway if conflicts are found. -CHECK_RELEASE = YES +#CHECK_RELEASE = YES # To install files into a location other than $(TOP) define # INSTALL_LOCATION here. #INSTALL_LOCATION= +INSTALL_INCLUDE = $(INSTALL_LOCATION)/include/pv +USR_INCLUDES += -I $(INSTALL_LOCATION)/include + +-include $(TOP)/../CONFIG_SITE.local -include $(TOP)/configure/CONFIG_SITE.local --include $(TOP)/../CONFIG.local + diff --git a/configure/ExampleRELEASE.local b/configure/ExampleRELEASE.local index 7c02833..7e5e5d7 100644 --- a/configure/ExampleRELEASE.local +++ b/configure/ExampleRELEASE.local @@ -1,11 +1,8 @@ -# Sample RELEASE.local file -V4 = /home/install/epics/v4 - -PVASRV = $(V4)/pvaSrv -PVACCESS = $(V4)/pvAccessCPP -PVDATA = $(V4)/pvDataCPP -PVCOMMON = $(V4)/pvCommonCPP - -EPICS_BASE = /home/install/epics/base-3.14.12.3 +TEMPLATE_TOP=$(EPICS_BASE)/templates/makeBaseApp/top +EPICS_BASE=/home/install/epics/base +PVCOMMON=/home/hg/pvCommonCPP +PVDATA=/home/hg/pvDataCPP +PVACCESS=/home/hg/pvAccessCPP +PVASRV=/home/hg/pvaSrv diff --git a/configure/RELEASE b/configure/RELEASE index 77c76d7..9ec474f 100644 --- a/configure/RELEASE +++ b/configure/RELEASE @@ -24,5 +24,5 @@ # PVCOMMON = /path/to/epics/pvCommonCPP # EPICS_BASE = /path/to/epics/base --include $(TOP)/configure/RELEASE.local -include $(TOP)/../RELEASE.local +-include $(TOP)/configure/RELEASE.local diff --git a/exampleDatabase/configure/CONFIG_SITE b/exampleDatabase/configure/CONFIG_SITE index 65cfc97..a6c6281 100644 --- a/exampleDatabase/configure/CONFIG_SITE +++ b/exampleDatabase/configure/CONFIG_SITE @@ -20,5 +20,9 @@ CHECK_RELEASE = WARN # INSTALL_LOCATION here. #INSTALL_LOCATION= +INSTALL_INCLUDE = $(INSTALL_LOCATION)/include/pv +USR_INCLUDES += -I $(INSTALL_LOCATION)/include + -include $(TOP)/../configure/CONFIG_SITE.local -include $(TOP)/../../CONFIG_SITE.local +-include $(TOP)/../CONFIG.local diff --git a/exampleDatabase/configure/RELEASE b/exampleDatabase/configure/RELEASE index e9fe356..1bf1093 100644 --- a/exampleDatabase/configure/RELEASE +++ b/exampleDatabase/configure/RELEASE @@ -27,7 +27,7 @@ # If this example is built in a directory under pvDatabaseCPP, # use the following definitions: -PVDATABASETEST = $(TOP)/../testTop +PVDATABASETEST = $(TOP)/../test PVDATABASE = $(TOP)/.. -include $(TOP)/../configure/RELEASE.local diff --git a/exampleDatabase/ioc/src/Makefile b/exampleDatabase/ioc/src/Makefile index afa51e8..71626ac 100644 --- a/exampleDatabase/ioc/src/Makefile +++ b/exampleDatabase/ioc/src/Makefile @@ -3,23 +3,26 @@ TOP=../.. include $(TOP)/configure/CONFIG #---------------------------------------- # ADD MACRO DEFINITIONS AFTER THIS LINE +#============================= + +#================================================== +# Build an IOC support library +# DBD += exampleDatabase.dbd -exampleDatabase_DBD += base.dbd -exampleDatabase_DBD += PVAServerRegister.dbd -exampleDatabase_DBD += registerChannelProviderLocal.dbd -exampleDatabase_DBD += dbPv.dbd -exampleDatabase_DBD += powerSupplyRegister.dbd -exampleDatabase_DBD += exampleDatabaseRegister.dbd +#============================= +# build an ioc application PROD_IOC += exampleDatabase + # _registerRecordDeviceDriver.cpp will be created from .dbd exampleDatabase_SRCS += exampleDatabase_registerRecordDeviceDriver.cpp exampleDatabase_SRCS_DEFAULT += exampleDatabaseMain.cpp exampleDatabase_SRCS_vxWorks += -nil- + # The following adds support from base/src/vxWorks exampleDatabase_OBJS_vxWorks += $(EPICS_BASE_BIN)/vxComLibrary diff --git a/exampleDatabase/ioc/src/exampleDatabaseInclude.dbd b/exampleDatabase/ioc/src/exampleDatabaseInclude.dbd new file mode 100644 index 0000000..c9f4eff --- /dev/null +++ b/exampleDatabase/ioc/src/exampleDatabaseInclude.dbd @@ -0,0 +1,7 @@ +include "base.dbd" +include "PVAServerRegister.dbd" +include "registerChannelProviderLocal.dbd" +include "dbPv.dbd" +include "powerSupplyRegister.dbd" +registrar("exampleDatabaseRegister") +registrar("exampleMonitorPluginRegister") diff --git a/exampleDatabase/src/Makefile b/exampleDatabase/src/Makefile index 469bc98..ca8c946 100644 --- a/exampleDatabase/src/Makefile +++ b/exampleDatabase/src/Makefile @@ -4,17 +4,20 @@ include $(TOP)/configure/CONFIG #---------------------------------------- # ADD MACRO DEFINITIONS AFTER THIS LINE -DBD += exampleDatabaseRegister.dbd +DBD += exampleDatabase.dbd INC += exampleDatabase.h +INC += exampleMonitorPlugin.h LIBRARY += exampleDatabase exampleDatabase_SRCS += exampleDatabase.cpp +exampleDatabase_SRCS += exampleMonitorPlugin.cpp exampleDatabase_SRCS += exampleDatabaseRegister.cpp -exampleDatabase_LIBS += powerSupply +exampleDatabase_SRCS += exampleMonitorPluginRegister.cpp exampleDatabase_LIBS += pvDatabase exampleDatabase_LIBS += pvAccess exampleDatabase_LIBS += pvData +exampleDatabase_LIBS += Com exampleDatabase_LIBS += $(EPICS_BASE_IOC_LIBS) PROD_HOST += exampleDatabaseMain diff --git a/exampleDatabase/src/exampleDatabase.cpp b/exampleDatabase/src/exampleDatabase.cpp index 54d6b51..4535b35 100644 --- a/exampleDatabase/src/exampleDatabase.cpp +++ b/exampleDatabase/src/exampleDatabase.cpp @@ -26,8 +26,8 @@ #include #include -#include -#include +#include +#include using namespace std; using std::tr1::static_pointer_cast; diff --git a/exampleDatabase/src/exampleDatabaseRegister.dbd b/exampleDatabase/src/exampleDatabaseInclude.dbd similarity index 100% rename from exampleDatabase/src/exampleDatabaseRegister.dbd rename to exampleDatabase/src/exampleDatabaseInclude.dbd diff --git a/exampleDatabase/src/exampleDatabaseMain.cpp b/exampleDatabase/src/exampleDatabaseMain.cpp index 87e9dab..a3b3b8e 100644 --- a/exampleDatabase/src/exampleDatabaseMain.cpp +++ b/exampleDatabase/src/exampleDatabaseMain.cpp @@ -22,7 +22,8 @@ #include #include -#include +#include +#include using namespace std; using std::tr1::static_pointer_cast; @@ -36,6 +37,7 @@ int main(int argc,char *argv[]) PVDatabasePtr master = PVDatabase::getMaster(); ChannelProviderLocalPtr channelProvider = getChannelProviderLocal(); ExampleDatabase::create(); + ExampleMonitorPlugin::create(); ServerContext::shared_pointer ctx = startPVAServer(PVACCESS_ALL_PROVIDERS,0,true,true); cout << "exampleDatabase\n"; @@ -55,4 +57,3 @@ int main(int argc,char *argv[]) channelProvider->destroy(); return 0; } - diff --git a/exampleDatabase/src/exampleDatabaseRegister.cpp b/exampleDatabase/src/exampleDatabaseRegister.cpp index 3a857f1..3af94b6 100644 --- a/exampleDatabase/src/exampleDatabaseRegister.cpp +++ b/exampleDatabase/src/exampleDatabaseRegister.cpp @@ -33,7 +33,7 @@ #include -#include +#include using namespace epics::pvData; using namespace epics::pvAccess; diff --git a/exampleLink/Makefile b/exampleLink/Makefile index 81fbed6..14826ca 100644 --- a/exampleLink/Makefile +++ b/exampleLink/Makefile @@ -1,8 +1,6 @@ -# Makefile at top of application tree - +#Makefile at top of application tree TOP = . include $(TOP)/configure/CONFIG - DIRS += configure DIRS += src @@ -12,7 +10,6 @@ DIRS += ioc ioc_DEPEND_DIRS = src DIRS += iocBoot -iocBoot_DEPEND_DIRS = src include $(TOP)/configure/RULES_TOP diff --git a/exampleLink/configure/CONFIG_SITE b/exampleLink/configure/CONFIG_SITE index 65cfc97..9e1ec9a 100644 --- a/exampleLink/configure/CONFIG_SITE +++ b/exampleLink/configure/CONFIG_SITE @@ -14,11 +14,26 @@ # Set CHECK_RELEASE to NO to disable checking completely. # Set CHECK_RELEASE to WARN to perform consistency checking but # continue building anyway if conflicts are found. -CHECK_RELEASE = WARN +#CHECK_RELEASE = YES + +# Set this when you only want to compile this application +# for a subset of the cross-compiled target architectures +# that Base is built for. +#CROSS_COMPILER_TARGET_ARCHS = vxWorks-68040 # To install files into a location other than $(TOP) define # INSTALL_LOCATION here. #INSTALL_LOCATION= --include $(TOP)/../configure/CONFIG_SITE.local --include $(TOP)/../../CONFIG_SITE.local +# Set this when your IOC and the host use different paths +# to access the application. This will be needed to boot +# from a Microsoft FTP server or with some NFS mounts. +# You must rebuild in the iocBoot directory for this to +# take effect. +#IOCS_APPL_TOP = + +INSTALL_INCLUDE = $(INSTALL_LOCATION)/include/pv +USR_INCLUDES += -I $(INSTALL_LOCATION)/include + +-include $(TOP)/configure/CONFIG_SITE.local +-include $(TOP)/../CONFIG.local diff --git a/exampleLink/configure/RELEASE b/exampleLink/configure/RELEASE index afbbaed..18dd963 100644 --- a/exampleLink/configure/RELEASE +++ b/exampleLink/configure/RELEASE @@ -16,9 +16,8 @@ # EPICS V4 Developers: Do not edit the locations in this file! # -# Create a file RELEASE.local pointing to your PVASRV, PVACCESS, -# PVDATA, PVCOMMON and EPICS_BASE build directories, e.g. -# PVASRV = /path/to/epics/pvaSrvCPP +# Create a file RELEASE.local pointing to your places +# for the dependencies, e.g. # PVACCESS = /path/to/epics/pvAccessCPP # PVDATA = /path/to/epics/pvDataCPP # PVCOMMON = /path/to/epics/pvCommonCPP @@ -28,14 +27,14 @@ # use the following definitions: PVDATABASE = $(TOP)/.. - --include $(TOP)/../configure/RELEASE.local -include $(TOP)/../../RELEASE.local +-include $(TOP)/../configure/RELEASE.local # If you copied this example from pvDatabaseCPP to be built as a -# standalone TOP, adjust and use the following definitions: +# standalone TOP, define +# PVDATABASE = /path/to/epics/pvDatabaseCPP +# in the appropriate RELEASE[.local], +# and use the following definitions instead: -#PVDATABASE = /path/to/epics/pvDatabaseCPP - -#-include $(TOP)/configure/RELEASE.local #-include $(TOP)/../RELEASE.local +#-include $(TOP)/configure/RELEASE.local diff --git a/exampleLink/ioc/src/Makefile b/exampleLink/ioc/src/Makefile index a137f97..ceeef9f 100644 --- a/exampleLink/ioc/src/Makefile +++ b/exampleLink/ioc/src/Makefile @@ -3,22 +3,27 @@ TOP=../.. include $(TOP)/configure/CONFIG #---------------------------------------- # ADD MACRO DEFINITIONS AFTER THIS LINE +#============================= + +#================================================== +# Build an IOC support library +# + +#============================= +# build an ioc application + DBD += exampleLink.dbd -exampleLink_DBD += base.dbd -exampleLink_DBD += PVAServerRegister.dbd -exampleLink_DBD += PVAClientRegister.dbd -exampleLink_DBD += registerChannelProviderLocal.dbd -exampleLink_DBD += exampleLinkRegister.dbd - PROD_IOC += exampleLink + # _registerRecordDeviceDriver.cpp will be created from .dbd exampleLink_SRCS += exampleLink_registerRecordDeviceDriver.cpp exampleLink_SRCS_DEFAULT += exampleLinkMain.cpp exampleLink_SRCS_vxWorks += -nil- + # The following adds support from base/src/vxWorks exampleLink_OBJS_vxWorks += $(EPICS_BASE_BIN)/vxComLibrary @@ -27,6 +32,7 @@ exampleLink_LIBS += pvDatabase exampleLink_LIBS += pvaSrv exampleLink_LIBS += pvAccess exampleLink_LIBS += pvData +exampleLink_LIBS += Com exampleLink_LIBS += $(EPICS_BASE_IOC_LIBS) #=========================== diff --git a/exampleLink/ioc/src/exampleLinkInclude.dbd b/exampleLink/ioc/src/exampleLinkInclude.dbd new file mode 100644 index 0000000..7ca071a --- /dev/null +++ b/exampleLink/ioc/src/exampleLinkInclude.dbd @@ -0,0 +1,5 @@ +include "base.dbd" +include "PVAServerRegister.dbd" +include "PVAClientRegister.dbd" +include "registerChannelProviderLocal.dbd" +registrar("exampleLinkRegister") diff --git a/exampleLink/src/Makefile b/exampleLink/src/Makefile index 88abbab..0856c00 100644 --- a/exampleLink/src/Makefile +++ b/exampleLink/src/Makefile @@ -3,8 +3,13 @@ TOP=.. include $(TOP)/configure/CONFIG #---------------------------------------- # ADD MACRO DEFINITIONS AFTER THIS LINE +#============================= -DBD += exampleLinkRegister.dbd +#================================================== +# Build an IOC support library +# + +DBD += exampleLink.dbd INC += exampleLink.h diff --git a/exampleLink/src/exampleLink.cpp b/exampleLink/src/exampleLink.cpp index 7fb8f61..651c7ea 100644 --- a/exampleLink/src/exampleLink.cpp +++ b/exampleLink/src/exampleLink.cpp @@ -9,13 +9,10 @@ * @date 2013.08.02 */ +#include #include #include -#define epicsExportSharedSymbols -#include - - namespace epics { namespace pvDatabase { using namespace epics::pvData; using namespace epics::pvAccess; diff --git a/exampleLink/src/exampleLink.h b/exampleLink/src/exampleLink.h index 0497db0..5aca9fd 100644 --- a/exampleLink/src/exampleLink.h +++ b/exampleLink/src/exampleLink.h @@ -8,15 +8,11 @@ * @author mrk * @date 2013.08.02 */ -#ifndef EXAMPLELINK_H -#define EXAMPLELINK_H +#ifndef EXAMPLEPVADOUBLEARRAYGET_H +#define EXAMPLEPVADOUBLEARRAYGET_H -#ifdef epicsExportSharedSymbols -# define examplelinkEpicsExportSharedSymbols -# undef epicsExportSharedSymbols -#endif +#include -//#include #include #include #include @@ -26,14 +22,6 @@ #include #include - -#ifdef examplelinkEpicsExportSharedSymbols -# define epicsExportSharedSymbols -# undef examplelinkEpicsExportSharedSymbols -# include -#endif - - namespace epics { namespace pvDatabase { @@ -102,4 +90,4 @@ private: }} -#endif /* EXAMPLELINK_H */ +#endif /* EXAMPLEPVADOUBLEARRAYGET_H */ diff --git a/exampleLink/src/exampleLinkInclude.dbd b/exampleLink/src/exampleLinkInclude.dbd new file mode 100644 index 0000000..4149d0b --- /dev/null +++ b/exampleLink/src/exampleLinkInclude.dbd @@ -0,0 +1 @@ +registrar("exampleLinkRegister") diff --git a/exampleLink/src/exampleLinkRegister.cpp b/exampleLink/src/exampleLinkRegister.cpp index 2651554..b156cb8 100644 --- a/exampleLink/src/exampleLinkRegister.cpp +++ b/exampleLink/src/exampleLinkRegister.cpp @@ -27,16 +27,15 @@ #include #include +#include + #include #include #include #include #include #include - -#include - -#include +#include using namespace epics::pvData; using namespace epics::pvAccess; @@ -83,7 +82,4 @@ static void exampleLinkRegister(void) iocshRegister(&exampleLinkFuncDef, exampleLinkCallFunc); } } - -extern "C" { - epicsExportRegistrar(exampleLinkRegister); -} +epicsExportRegistrar(exampleLinkRegister); diff --git a/examplePowerSupply/configure/CONFIG_SITE b/examplePowerSupply/configure/CONFIG_SITE index 65cfc97..9e1ec9a 100644 --- a/examplePowerSupply/configure/CONFIG_SITE +++ b/examplePowerSupply/configure/CONFIG_SITE @@ -14,11 +14,26 @@ # Set CHECK_RELEASE to NO to disable checking completely. # Set CHECK_RELEASE to WARN to perform consistency checking but # continue building anyway if conflicts are found. -CHECK_RELEASE = WARN +#CHECK_RELEASE = YES + +# Set this when you only want to compile this application +# for a subset of the cross-compiled target architectures +# that Base is built for. +#CROSS_COMPILER_TARGET_ARCHS = vxWorks-68040 # To install files into a location other than $(TOP) define # INSTALL_LOCATION here. #INSTALL_LOCATION= --include $(TOP)/../configure/CONFIG_SITE.local --include $(TOP)/../../CONFIG_SITE.local +# Set this when your IOC and the host use different paths +# to access the application. This will be needed to boot +# from a Microsoft FTP server or with some NFS mounts. +# You must rebuild in the iocBoot directory for this to +# take effect. +#IOCS_APPL_TOP = + +INSTALL_INCLUDE = $(INSTALL_LOCATION)/include/pv +USR_INCLUDES += -I $(INSTALL_LOCATION)/include + +-include $(TOP)/configure/CONFIG_SITE.local +-include $(TOP)/../CONFIG.local diff --git a/examplePowerSupply/configure/RELEASE b/examplePowerSupply/configure/RELEASE index e9fe356..3b2f69f 100644 --- a/examplePowerSupply/configure/RELEASE +++ b/examplePowerSupply/configure/RELEASE @@ -16,9 +16,8 @@ # EPICS V4 Developers: Do not edit the locations in this file! # -# Create a file RELEASE.local pointing to your PVASRV, PVACCESS, -# PVDATA, PVCOMMON and EPICS_BASE build directories, e.g. -# PVASRV = /path/to/epics/pvaSrvCPP +# Create a file RELEASE.local pointing to your places +# for the dependencies, e.g. # PVACCESS = /path/to/epics/pvAccessCPP # PVDATA = /path/to/epics/pvDataCPP # PVCOMMON = /path/to/epics/pvCommonCPP @@ -27,17 +26,17 @@ # If this example is built in a directory under pvDatabaseCPP, # use the following definitions: -PVDATABASETEST = $(TOP)/../testTop PVDATABASE = $(TOP)/.. - --include $(TOP)/../configure/RELEASE.local +PVDATABASETEST = $(TOP)/../test -include $(TOP)/../../RELEASE.local +-include $(TOP)/../configure/RELEASE.local # If you copied this example from pvDatabaseCPP to be built as a -# standalone TOP, adjust and use the following definitions: - -#PVDATABASETEST = /path/to/epics/pvDatabaseCPP/testTop -#PVDATABASE = /path/to/epics/pvDatabaseCPP +# standalone TOP, define +# PVDATABASE = /path/to/epics/pvDatabaseCPP +# PVDATABASETEST = /path/to/epics/pvDatabaseCPP/test +# in the appropriate RELEASE[.local], +# and use the following definitions instead: #-include $(TOP)/../RELEASE.local #-include $(TOP)/configure/RELEASE.local diff --git a/examplePowerSupply/ioc/src/Makefile b/examplePowerSupply/ioc/src/Makefile index b9f1ff3..3254645 100644 --- a/examplePowerSupply/ioc/src/Makefile +++ b/examplePowerSupply/ioc/src/Makefile @@ -3,22 +3,26 @@ TOP=../.. include $(TOP)/configure/CONFIG #---------------------------------------- # ADD MACRO DEFINITIONS AFTER THIS LINE +#============================= + +#================================================== +# Build an IOC support library +# DBD += powerSupply.dbd -powerSupply_DBD += base.dbd -powerSupply_DBD += PVAServerRegister.dbd -powerSupply_DBD += registerChannelProviderLocal.dbd -powerSupply_DBD += dbPv.dbd -powerSupply_DBD += powerSupplyRegister.dbd +#============================= +# build an ioc application PROD_IOC += powerSupply + # _registerRecordDeviceDriver.cpp will be created from .dbd powerSupply_SRCS += powerSupply_registerRecordDeviceDriver.cpp powerSupply_SRCS_DEFAULT += powerSupplyMain.cpp powerSupply_SRCS_vxWorks += -nil- + # The following adds support from base/src/vxWorks powerSupply_OBJS_vxWorks += $(EPICS_BASE_BIN)/vxComLibrary diff --git a/examplePowerSupply/ioc/src/powerSupplyInclude.dbd b/examplePowerSupply/ioc/src/powerSupplyInclude.dbd new file mode 100644 index 0000000..02758f6 --- /dev/null +++ b/examplePowerSupply/ioc/src/powerSupplyInclude.dbd @@ -0,0 +1,5 @@ +include "base.dbd" +include "PVAServerRegister.dbd" +include "registerChannelProviderLocal.dbd" +include "dbPv.dbd" +include "powerSupplyRegister.dbd" diff --git a/examplePowerSupply/src/Makefile b/examplePowerSupply/src/Makefile index 1a9283f..ded3df1 100644 --- a/examplePowerSupply/src/Makefile +++ b/examplePowerSupply/src/Makefile @@ -3,14 +3,21 @@ TOP=.. include $(TOP)/configure/CONFIG #---------------------------------------- # ADD MACRO DEFINITIONS AFTER THIS LINE +#============================= + +#================================================== +# Build an IOC support library +# + PROD_HOST += powerSupplyMain powerSupplyMain_SRCS += powerSupplyMain.cpp -powerSupplyMain_LIBS += powerSupply + powerSupplyMain_LIBS += pvDatabase powerSupplyMain_LIBS += pvAccess powerSupplyMain_LIBS += pvData powerSupplyMain_LIBS += Com +powerSupplyMain_LIBS += powerSupply #=========================== diff --git a/examplePowerSupply/src/powerSupplyMain.cpp b/examplePowerSupply/src/powerSupplyMain.cpp index 212243d..c7de4c0 100644 --- a/examplePowerSupply/src/powerSupplyMain.cpp +++ b/examplePowerSupply/src/powerSupplyMain.cpp @@ -20,12 +20,11 @@ #include #include +#include #include #include #include -#include - using namespace std; using std::tr1::static_pointer_cast; using namespace epics::pvData; diff --git a/testTop/src/powerSupplyRegister.dbd b/examplePowerSupply/src/powerSupplyRegisterInclude.dbd similarity index 100% rename from testTop/src/powerSupplyRegister.dbd rename to examplePowerSupply/src/powerSupplyRegisterInclude.dbd diff --git a/exampleServer/Makefile b/exampleServer/Makefile index 81fbed6..14826ca 100644 --- a/exampleServer/Makefile +++ b/exampleServer/Makefile @@ -1,8 +1,6 @@ -# Makefile at top of application tree - +#Makefile at top of application tree TOP = . include $(TOP)/configure/CONFIG - DIRS += configure DIRS += src @@ -12,7 +10,6 @@ DIRS += ioc ioc_DEPEND_DIRS = src DIRS += iocBoot -iocBoot_DEPEND_DIRS = src include $(TOP)/configure/RULES_TOP diff --git a/exampleServer/configure/CONFIG_SITE b/exampleServer/configure/CONFIG_SITE index 65cfc97..9e1ec9a 100644 --- a/exampleServer/configure/CONFIG_SITE +++ b/exampleServer/configure/CONFIG_SITE @@ -14,11 +14,26 @@ # Set CHECK_RELEASE to NO to disable checking completely. # Set CHECK_RELEASE to WARN to perform consistency checking but # continue building anyway if conflicts are found. -CHECK_RELEASE = WARN +#CHECK_RELEASE = YES + +# Set this when you only want to compile this application +# for a subset of the cross-compiled target architectures +# that Base is built for. +#CROSS_COMPILER_TARGET_ARCHS = vxWorks-68040 # To install files into a location other than $(TOP) define # INSTALL_LOCATION here. #INSTALL_LOCATION= --include $(TOP)/../configure/CONFIG_SITE.local --include $(TOP)/../../CONFIG_SITE.local +# Set this when your IOC and the host use different paths +# to access the application. This will be needed to boot +# from a Microsoft FTP server or with some NFS mounts. +# You must rebuild in the iocBoot directory for this to +# take effect. +#IOCS_APPL_TOP = + +INSTALL_INCLUDE = $(INSTALL_LOCATION)/include/pv +USR_INCLUDES += -I $(INSTALL_LOCATION)/include + +-include $(TOP)/configure/CONFIG_SITE.local +-include $(TOP)/../CONFIG.local diff --git a/exampleServer/configure/RELEASE b/exampleServer/configure/RELEASE index afbbaed..18dd963 100644 --- a/exampleServer/configure/RELEASE +++ b/exampleServer/configure/RELEASE @@ -16,9 +16,8 @@ # EPICS V4 Developers: Do not edit the locations in this file! # -# Create a file RELEASE.local pointing to your PVASRV, PVACCESS, -# PVDATA, PVCOMMON and EPICS_BASE build directories, e.g. -# PVASRV = /path/to/epics/pvaSrvCPP +# Create a file RELEASE.local pointing to your places +# for the dependencies, e.g. # PVACCESS = /path/to/epics/pvAccessCPP # PVDATA = /path/to/epics/pvDataCPP # PVCOMMON = /path/to/epics/pvCommonCPP @@ -28,14 +27,14 @@ # use the following definitions: PVDATABASE = $(TOP)/.. - --include $(TOP)/../configure/RELEASE.local -include $(TOP)/../../RELEASE.local +-include $(TOP)/../configure/RELEASE.local # If you copied this example from pvDatabaseCPP to be built as a -# standalone TOP, adjust and use the following definitions: +# standalone TOP, define +# PVDATABASE = /path/to/epics/pvDatabaseCPP +# in the appropriate RELEASE[.local], +# and use the following definitions instead: -#PVDATABASE = /path/to/epics/pvDatabaseCPP - -#-include $(TOP)/configure/RELEASE.local #-include $(TOP)/../RELEASE.local +#-include $(TOP)/configure/RELEASE.local diff --git a/exampleServer/ioc/src/Makefile b/exampleServer/ioc/src/Makefile index 53f421d..ae94689 100644 --- a/exampleServer/ioc/src/Makefile +++ b/exampleServer/ioc/src/Makefile @@ -3,22 +3,26 @@ TOP=../.. include $(TOP)/configure/CONFIG #---------------------------------------- # ADD MACRO DEFINITIONS AFTER THIS LINE +#============================= + +#================================================== +# Build an IOC support library +# DBD += exampleServer.dbd -exampleServer_DBD += base.dbd -exampleServer_DBD += PVAServerRegister.dbd -exampleServer_DBD += registerChannelProviderLocal.dbd -exampleServer_DBD += dbPv.dbd -exampleServer_DBD += exampleServerRegister.dbd +#============================= +# build an ioc application PROD_IOC += exampleServer + # _registerRecordDeviceDriver.cpp will be created from .dbd exampleServer_SRCS += exampleServer_registerRecordDeviceDriver.cpp exampleServer_SRCS_DEFAULT += exampleServerMain.cpp exampleServer_SRCS_vxWorks += -nil- + # The following adds support from base/src/vxWorks exampleServer_OBJS_vxWorks += $(EPICS_BASE_BIN)/vxComLibrary diff --git a/exampleServer/ioc/src/exampleServerInclude.dbd b/exampleServer/ioc/src/exampleServerInclude.dbd new file mode 100644 index 0000000..2aa17f9 --- /dev/null +++ b/exampleServer/ioc/src/exampleServerInclude.dbd @@ -0,0 +1,5 @@ +include "base.dbd" +include "PVAServerRegister.dbd" +include "registerChannelProviderLocal.dbd" +include "dbPv.dbd" +include "exampleServer.dbd" diff --git a/exampleServer/src/Makefile b/exampleServer/src/Makefile index 63cf199..a0e18f1 100644 --- a/exampleServer/src/Makefile +++ b/exampleServer/src/Makefile @@ -3,8 +3,14 @@ TOP=.. include $(TOP)/configure/CONFIG #---------------------------------------- # ADD MACRO DEFINITIONS AFTER THIS LINE +#============================= -DBD += exampleServerRegister.dbd +#================================================== +# Build an IOC support library +# + + +DBD += exampleServer.dbd INC += exampleServer.h @@ -14,6 +20,7 @@ exampleServer_SRCS += exampleServerRegister.cpp exampleServer_LIBS += pvDatabase exampleServer_LIBS += pvAccess exampleServer_LIBS += pvData +exampleServer_LIBS += Com exampleServer_LIBS += $(EPICS_BASE_IOC_LIBS) PROD_HOST += exampleServerMain diff --git a/exampleServer/src/exampleServer.cpp b/exampleServer/src/exampleServer.cpp index f11a080..0ed388b 100644 --- a/exampleServer/src/exampleServer.cpp +++ b/exampleServer/src/exampleServer.cpp @@ -10,10 +10,7 @@ */ #include - -#define epicsExportSharedSymbols - -#include +#include namespace epics { namespace exampleServer { using namespace epics::pvData; diff --git a/exampleServer/src/exampleServer.h b/exampleServer/src/exampleServer.h index beb6241..95ea79c 100644 --- a/exampleServer/src/exampleServer.h +++ b/exampleServer/src/exampleServer.h @@ -8,26 +8,15 @@ * @author mrk * @date 2013.04.02 */ -#ifndef EXAMPLESERVER_H -#define EXAMPLESERVER_H - -#ifdef epicsExportSharedSymbols -# define exampleServerEpicsExportSharedSymbols -# undef epicsExportSharedSymbols -#endif +#ifndef EXAMPLECOUNTER_H +#define EXAMPLECOUNTER_H #include + #include #include #include -#ifdef exampleServerEpicsExportSharedSymbols -# define epicsExportSharedSymbols -# undef exampleServerEpicsExportSharedSymbols -# include -#endif - - namespace epics { namespace exampleServer { @@ -58,4 +47,4 @@ private: }} -#endif /* EXAMPLESERVER_H */ +#endif /* EXAMPLECOUNTER_H */ diff --git a/exampleServer/src/exampleServerInclude.dbd b/exampleServer/src/exampleServerInclude.dbd new file mode 100644 index 0000000..cb97782 --- /dev/null +++ b/exampleServer/src/exampleServerInclude.dbd @@ -0,0 +1 @@ +registrar("exampleServerRegister") diff --git a/exampleServer/src/exampleServerMain.cpp b/exampleServer/src/exampleServerMain.cpp index f9f3c5e..bfe2214 100644 --- a/exampleServer/src/exampleServerMain.cpp +++ b/exampleServer/src/exampleServerMain.cpp @@ -20,12 +20,11 @@ #include #include +#include #include #include #include -#include - using namespace std; using std::tr1::static_pointer_cast; using namespace epics::pvData; diff --git a/exampleServer/src/exampleServerRegister.cpp b/exampleServer/src/exampleServerRegister.cpp index 9c48f57..a20d62d 100644 --- a/exampleServer/src/exampleServerRegister.cpp +++ b/exampleServer/src/exampleServerRegister.cpp @@ -27,14 +27,13 @@ #include #include +#include + #include #include #include #include - -#include - -#include +#include using namespace epics::pvData; using namespace epics::pvAccess; @@ -65,7 +64,4 @@ static void exampleServerRegister(void) iocshRegister(&exampleServerFuncDef, exampleServerCallFunc); } } - -extern "C" { - epicsExportRegistrar(exampleServerRegister); -} +epicsExportRegistrar(exampleServerRegister); diff --git a/src/Makefile b/src/Makefile index 258add7..e86dc0b 100644 --- a/src/Makefile +++ b/src/Makefile @@ -3,9 +3,6 @@ TOP = .. include $(TOP)/configure/CONFIG -INSTALL_INCLUDE = $(INSTALL_LOCATION)/include/pv -USR_INCLUDES += -I$(INSTALL_LOCATION)/include - PVDATABASE_SRC = $(TOP)/src LIBRARY += pvDatabase diff --git a/src/pvAccess/Makefile b/src/pvAccess/Makefile index 88ee83a..f25c68d 100644 --- a/src/pvAccess/Makefile +++ b/src/pvAccess/Makefile @@ -3,13 +3,13 @@ SRC_DIRS += $(PVDATABASE_SRC)/pvAccess INC += channelProviderLocal.h -INC += pvCopy.h -INC += monitorAlgorithm.h +INC += pvCopyMonitor.h DBD += registerChannelProviderLocal.dbd LIBSRCS += channelProviderLocal.cpp -LIBSRCS += pvCopy.cpp -LIBSRCS += monitorFactory.cpp LIBSRCS += channelLocal.cpp +LIBSRCS += pvCopyMonitor.cpp +LIBSRCS += monitorFactory.cpp LIBSRCS += registerChannelProviderLocal.cpp + diff --git a/src/pvAccess/channelLocal.cpp b/src/pvAccess/channelLocal.cpp index 963ca0e..fa0404d 100644 --- a/src/pvAccess/channelLocal.cpp +++ b/src/pvAccess/channelLocal.cpp @@ -14,13 +14,10 @@ #include #include +#include #include #include -#define epicsExportSharedSymbols - -#include - namespace epics { namespace pvDatabase { using namespace epics::pvData; using namespace epics::pvAccess; @@ -30,6 +27,26 @@ using std::cout; using std::endl; static ConvertPtr convert = getConvert(); +static StructureConstPtr nullStructure; +static PVStructurePtr nullPVStructure; +static BitSetPtr nullBitSet; +static Status channelDestroyedStatus( + Status::Status::STATUSTYPE_ERROR, + "was destroyed" +); +static Status illegalOffsetStatus( + Status::Status::STATUSTYPE_ERROR, + "count must be >0" +); +static Status illegalCountStatus( + Status::Status::STATUSTYPE_ERROR, + "count must be >0" +); +static Status illegalStrideStatus( + Status::Status::STATUSTYPE_ERROR, + "stride must be >0" +); + class ChannelProcessLocal; typedef std::tr1::shared_ptr ChannelProcessLocalPtr; @@ -49,7 +66,7 @@ typedef std::tr1::shared_ptr ChannelArrayLocalPtr; static bool getProcess(PVStructurePtr pvRequest,bool processDefault) { PVFieldPtr pvField = pvRequest->getSubField("record._options.process"); - if(pvField.get()==NULL || pvField->getField()->getType()!=scalar) { + if(pvField==NULL || pvField->getField()->getType()!=scalar) { return processDefault; } ScalarConstPtr scalar = static_pointer_cast( @@ -82,8 +99,12 @@ public: ChannelProcessRequester::shared_pointer const & channelProcessRequester, PVStructurePtr const & pvRequest, PVRecordPtr const &pvRecord); - virtual void process(bool lastRequest); + virtual void process(); virtual void destroy(); + virtual std::tr1::shared_ptr getChannel() + {return channelLocal;} + virtual void cancel(){} + virtual void lastRequest() {} virtual void lock() {mutex.lock();} virtual void unlock() {mutex.unlock();} private: @@ -105,7 +126,6 @@ private: { } bool isDestroyed; - bool callProcess; ChannelLocalPtr channelLocal; ChannelProcessRequester::shared_pointer channelProcessRequester; PVRecordPtr pvRecord; @@ -167,13 +187,11 @@ void ChannelProcessLocal::destroy() channelLocal.reset(); } -void ChannelProcessLocal::process(bool lastRequest) + +void ChannelProcessLocal::process() { if(isDestroyed) { - Status status( - Status::STATUSTYPE_ERROR, - "was destroyed"); - channelProcessRequester->processDone(status); + channelProcessRequester->processDone(channelDestroyedStatus,getPtrSelf()); return; } if(pvRecord->getTraceLevel()>1) @@ -193,8 +211,7 @@ void ChannelProcessLocal::process(bool lastRequest) } pvRecord->unlock(); } - channelProcessRequester->processDone(Status::Ok); - if(lastRequest) destroy(); + channelProcessRequester->processDone(Status::Ok,getPtrSelf()); } class ChannelGetLocal : @@ -215,8 +232,12 @@ public: ChannelGetRequester::shared_pointer const & channelGetRequester, PVStructurePtr const & pvRequest, PVRecordPtr const &pvRecord); - virtual void get(bool lastRequest); + virtual void get(); virtual void destroy(); + virtual std::tr1::shared_ptr getChannel() + {return channelLocal;} + virtual void cancel(){} + virtual void lastRequest() {} virtual void lock() {mutex.lock();} virtual void unlock() {mutex.unlock();} private: @@ -263,21 +284,18 @@ ChannelGetLocalPtr ChannelGetLocal::create( PVRecordPtr const &pvRecord) { PVCopyPtr pvCopy = PVCopy::create( - pvRecord, + pvRecord->getPVRecordStructure()->getPVStructure(), pvRequest, ""); - if(pvCopy.get()==NULL) { + if(pvCopy==NULL) { Status status( - Status::STATUSTYPE_ERROR, + Status::Status::STATUSTYPE_ERROR, "invalid pvRequest"); ChannelGet::shared_pointer channelGet; - PVStructurePtr pvStructure; - BitSetPtr bitSet; channelGetRequester->channelGetConnect( status, channelGet, - pvStructure, - bitSet); + nullStructure); ChannelGetLocalPtr localGet; return localGet; } @@ -296,7 +314,8 @@ ChannelGetLocalPtr ChannelGetLocal::create( cout << "ChannelGetLocal::create"; cout << " recordName " << pvRecord->getRecordName() << endl; } - channelGetRequester->channelGetConnect(Status::Ok, get, pvStructure,bitSet); + channelGetRequester->channelGetConnect( + Status::Ok,get,pvStructure->getStructure()); return get; } @@ -316,13 +335,11 @@ void ChannelGetLocal::destroy() channelLocal.reset(); } -void ChannelGetLocal::get(bool lastRequest) +void ChannelGetLocal::get() { if(isDestroyed) { - Status status( - Status::STATUSTYPE_ERROR, - "was destroyed"); - channelGetRequester->getDone(status); + channelGetRequester->getDone( + channelDestroyedStatus,getPtrSelf(),nullPVStructure,nullBitSet); return; } bitSet->clear(); @@ -344,12 +361,15 @@ void ChannelGetLocal::get(bool lastRequest) bitSet->set(0); firstTime = false; } - channelGetRequester->getDone(Status::Ok); + channelGetRequester->getDone( + Status::Ok, + getPtrSelf(), + pvStructure, + bitSet); if(pvRecord->getTraceLevel()>1) { cout << "ChannelGetLocal::get" << endl; } - if(lastRequest) destroy(); } class ChannelPutLocal : @@ -370,9 +390,13 @@ public: ChannelPutRequester::shared_pointer const & channelPutRequester, PVStructurePtr const & pvRequest, PVRecordPtr const &pvRecord); - virtual void put(bool lastRequest); + virtual void put(PVStructurePtr const &pvStructure,BitSetPtr const &bitSet); virtual void get(); virtual void destroy(); + virtual std::tr1::shared_ptr getChannel() + {return channelLocal;} + virtual void cancel(){} + virtual void lastRequest() {} virtual void lock() {mutex.lock();} virtual void unlock() {mutex.unlock();} private: @@ -385,8 +409,6 @@ private: ChannelLocalPtr const &channelLocal, ChannelPutRequester::shared_pointer const & channelPutRequester, PVCopyPtr const &pvCopy, - PVStructurePtr const&pvStructure, - BitSetPtr const & bitSet, PVRecordPtr const &pvRecord) : isDestroyed(false), @@ -394,8 +416,6 @@ private: channelLocal(channelLocal), channelPutRequester(channelPutRequester), pvCopy(pvCopy), - pvStructure(pvStructure), - bitSet(bitSet), pvRecord(pvRecord) { } @@ -404,8 +424,6 @@ private: ChannelLocalPtr channelLocal; ChannelPutRequester::shared_pointer channelPutRequester; PVCopyPtr pvCopy; - PVStructurePtr pvStructure; - BitSetPtr bitSet; PVRecordPtr pvRecord; Mutex mutex; }; @@ -417,12 +435,12 @@ ChannelPutLocalPtr ChannelPutLocal::create( PVRecordPtr const &pvRecord) { PVCopyPtr pvCopy = PVCopy::create( - pvRecord, + pvRecord->getPVRecordStructure()->getPVStructure(), pvRequest, ""); - if(pvCopy.get()==NULL) { + if(pvCopy==NULL) { Status status( - Status::STATUSTYPE_ERROR, + Status::Status::STATUSTYPE_ERROR, "invalid pvRequest"); ChannelPut::shared_pointer channelPut; PVStructurePtr pvStructure; @@ -430,22 +448,18 @@ ChannelPutLocalPtr ChannelPutLocal::create( channelPutRequester->channelPutConnect( status, channelPut, - pvStructure, - bitSet); + nullStructure); ChannelPutLocalPtr localPut; return localPut; } - PVStructurePtr pvStructure = pvCopy->createPVStructure(); - BitSetPtr bitSet(new BitSet(pvStructure->getNumberFields())); ChannelPutLocalPtr put(new ChannelPutLocal( getProcess(pvRequest,true), channelLocal, channelPutRequester, pvCopy, - pvStructure, - bitSet, pvRecord)); - channelPutRequester->channelPutConnect(Status::Ok, put, pvStructure,bitSet); + channelPutRequester->channelPutConnect( + Status::Ok, put, pvCopy->getStructure()); if(pvRecord->getTraceLevel()>0) { cout << "ChannelPutLocal::create"; @@ -472,12 +486,12 @@ void ChannelPutLocal::destroy() void ChannelPutLocal::get() { if(isDestroyed) { - Status status( - Status::STATUSTYPE_ERROR, - "was destroyed"); - channelPutRequester->getDone(status); + channelPutRequester->getDone( + channelDestroyedStatus,getPtrSelf(),nullPVStructure,nullBitSet); return; } + PVStructurePtr pvStructure = pvCopy->createPVStructure(); + BitSetPtr bitSet(new BitSet(pvStructure->getNumberFields())); bitSet->clear(); bitSet->set(0); pvRecord->lock(); @@ -488,26 +502,25 @@ void ChannelPutLocal::get() throw; } pvRecord->unlock(); - channelPutRequester->getDone(Status::Ok); + channelPutRequester->getDone( + Status::Ok,getPtrSelf(),pvStructure,bitSet); if(pvRecord->getTraceLevel()>1) { cout << "ChannelPutLocal::get" << endl; } } -void ChannelPutLocal::put(bool lastRequest) +void ChannelPutLocal::put( + PVStructurePtr const &pvStructure,BitSetPtr const &bitSet) { if(isDestroyed) { - Status status( - Status::STATUSTYPE_ERROR, - "was destroyed"); - channelPutRequester->getDone(status); + channelPutRequester->putDone(channelDestroyedStatus,getPtrSelf()); return; } pvRecord->lock(); try { pvRecord->beginGroupPut(); - pvCopy->updateRecord(pvStructure, bitSet); + pvCopy->updateMaster(pvStructure, bitSet); if(callProcess) { pvRecord->process(); } @@ -517,12 +530,11 @@ void ChannelPutLocal::put(bool lastRequest) throw; } pvRecord->unlock(); - channelPutRequester->putDone(Status::Ok); + channelPutRequester->putDone(Status::Ok,getPtrSelf()); if(pvRecord->getTraceLevel()>1) { cout << "ChannelPutLocal::put" << endl; } - if(lastRequest) destroy(); } @@ -544,10 +556,16 @@ public: ChannelPutGetRequester::shared_pointer const & channelPutGetRequester, PVStructurePtr const & pvRequest, PVRecordPtr const &pvRecord); - virtual void putGet(bool lastRequest); + virtual void putGet( + PVStructurePtr const &pvPutStructure, + BitSetPtr const &putBitSet); virtual void getPut(); virtual void getGet(); virtual void destroy(); + virtual std::tr1::shared_ptr getChannel() + {return channelLocal;} + virtual void cancel(){} + virtual void lastRequest() {} virtual void lock() {mutex.lock();} virtual void unlock() {mutex.unlock();} private: @@ -561,9 +579,7 @@ private: ChannelPutGetRequester::shared_pointer const & channelPutGetRequester, PVCopyPtr const &pvPutCopy, PVCopyPtr const &pvGetCopy, - PVStructurePtr const&pvPutStructure, PVStructurePtr const&pvGetStructure, - BitSetPtr const & putBitSet, BitSetPtr const & getBitSet, PVRecordPtr const &pvRecord) : @@ -573,9 +589,7 @@ private: channelPutGetRequester(channelPutGetRequester), pvPutCopy(pvPutCopy), pvGetCopy(pvGetCopy), - pvPutStructure(pvPutStructure), pvGetStructure(pvGetStructure), - putBitSet(putBitSet), getBitSet(getBitSet), pvRecord(pvRecord) { @@ -586,9 +600,7 @@ private: ChannelPutGetRequester::shared_pointer channelPutGetRequester; PVCopyPtr pvPutCopy; PVCopyPtr pvGetCopy; - PVStructurePtr pvPutStructure; PVStructurePtr pvGetStructure; - BitSetPtr putBitSet; BitSetPtr getBitSet; PVRecordPtr pvRecord; Mutex mutex; @@ -601,50 +613,35 @@ ChannelPutGetLocalPtr ChannelPutGetLocal::create( PVRecordPtr const &pvRecord) { PVCopyPtr pvPutCopy = PVCopy::create( - pvRecord, + pvRecord->getPVRecordStructure()->getPVStructure(), pvRequest, "putField"); PVCopyPtr pvGetCopy = PVCopy::create( - pvRecord, + pvRecord->getPVRecordStructure()->getPVStructure(), pvRequest, "getField"); - if(pvPutCopy.get()==NULL || pvGetCopy.get()==NULL) { + if(pvPutCopy==NULL || pvGetCopy==NULL) { Status status( - Status::STATUSTYPE_ERROR, + Status::Status::STATUSTYPE_ERROR, "invalid pvRequest"); ChannelPutGet::shared_pointer channelPutGet; - PVStructurePtr pvStructure; - BitSetPtr bitSet; channelPutGetRequester->channelPutGetConnect( status, channelPutGet, - pvStructure, - pvStructure); + nullStructure, + nullStructure); ChannelPutGetLocalPtr localPutGet; return localPutGet; } - PVStructurePtr pvPutStructure = pvPutCopy->createPVStructure(); PVStructurePtr pvGetStructure = pvGetCopy->createPVStructure(); - BitSetPtr putBitSet(new BitSet(pvPutStructure->getNumberFields())); BitSetPtr getBitSet(new BitSet(pvGetStructure->getNumberFields())); - pvRecord->lock(); - try { - pvPutCopy->initCopy(pvPutStructure,putBitSet); - pvGetCopy->initCopy(pvGetStructure,getBitSet); - } catch(...) { - pvRecord->unlock(); - throw; - } - pvRecord->unlock(); ChannelPutGetLocalPtr putGet(new ChannelPutGetLocal( getProcess(pvRequest,true), channelLocal, channelPutGetRequester, pvPutCopy, pvGetCopy, - pvPutStructure, pvGetStructure, - putBitSet, getBitSet, pvRecord)); if(pvRecord->getTraceLevel()>0) @@ -653,7 +650,7 @@ ChannelPutGetLocalPtr ChannelPutGetLocal::create( cout << " recordName " << pvRecord->getRecordName() << endl; } channelPutGetRequester->channelPutGetConnect( - Status::Ok, putGet, pvPutStructure,pvGetStructure); + Status::Ok, putGet, pvPutCopy->getStructure(),pvGetCopy->getStructure()); return putGet; } @@ -673,22 +670,20 @@ void ChannelPutGetLocal::destroy() channelLocal.reset(); } -void ChannelPutGetLocal::putGet(bool lastRequest) +void ChannelPutGetLocal::putGet( + PVStructurePtr const &pvPutStructure,BitSetPtr const &putBitSet) { if(isDestroyed) { - Status status( - Status::STATUSTYPE_ERROR, - "was destroyed"); - channelPutGetRequester->putGetDone(status); + channelPutGetRequester->putGetDone( + channelDestroyedStatus,getPtrSelf(),nullPVStructure,nullBitSet); return; } - putBitSet->clear(); - putBitSet->set(0); pvRecord->lock(); try { pvRecord->beginGroupPut(); - pvPutCopy->updateRecord(pvPutStructure, putBitSet); + pvPutCopy->updateMaster(pvPutStructure, putBitSet); if(callProcess) pvRecord->process(); + getBitSet->clear(); pvGetCopy->updateCopySetBitSet(pvGetStructure, getBitSet); pvRecord->endGroupPut(); } catch(...) { @@ -696,36 +691,33 @@ void ChannelPutGetLocal::putGet(bool lastRequest) throw; } pvRecord->unlock(); - getBitSet->clear(); - getBitSet->set(0); - channelPutGetRequester->putGetDone(Status::Ok); + channelPutGetRequester->putGetDone( + Status::Ok,getPtrSelf(),pvGetStructure,getBitSet); if(pvRecord->getTraceLevel()>1) { cout << "ChannelPutGetLocal::putGet" << endl; } - if(lastRequest) destroy(); } void ChannelPutGetLocal::getPut() { if(isDestroyed) { - Status status( - Status::STATUSTYPE_ERROR, - "was destroyed"); - channelPutGetRequester->getPutDone(status); + channelPutGetRequester->getPutDone( + channelDestroyedStatus,getPtrSelf(),nullPVStructure,nullBitSet); return; } + PVStructurePtr pvPutStructure = pvPutCopy->createPVStructure(); + BitSetPtr putBitSet(new BitSet(pvPutStructure->getNumberFields())); pvRecord->lock(); try { - pvPutCopy->updateCopySetBitSet(pvPutStructure, putBitSet); + pvPutCopy->initCopy(pvPutStructure, putBitSet); } catch(...) { pvRecord->unlock(); throw; } pvRecord->unlock(); - putBitSet->clear(); - putBitSet->set(0); - channelPutGetRequester->getPutDone(Status::Ok); + channelPutGetRequester->getPutDone( + Status::Ok,getPtrSelf(),pvPutStructure,putBitSet); if(pvRecord->getTraceLevel()>1) { cout << "ChannelPutGetLocal::getPut" << endl; @@ -735,12 +727,11 @@ void ChannelPutGetLocal::getPut() void ChannelPutGetLocal::getGet() { if(isDestroyed) { - Status status( - Status::STATUSTYPE_ERROR, - "was destroyed"); - channelPutGetRequester->getGetDone(status); + channelPutGetRequester->getGetDone( + channelDestroyedStatus,getPtrSelf(),nullPVStructure,nullBitSet); return; } + getBitSet->clear(); pvRecord->lock(); try { pvGetCopy->updateCopySetBitSet(pvGetStructure, getBitSet); @@ -749,9 +740,8 @@ void ChannelPutGetLocal::getGet() throw; } pvRecord->unlock(); - getBitSet->clear(); - getBitSet->set(0); - channelPutGetRequester->getGetDone(Status::Ok); + channelPutGetRequester->getGetDone( + Status::Ok,getPtrSelf(),pvGetStructure,getBitSet); if(pvRecord->getTraceLevel()>1) { cout << "ChannelPutGetLocal::getGet" << endl; @@ -778,10 +768,17 @@ public: ChannelArrayRequester::shared_pointer const & channelArrayRequester, PVStructurePtr const & pvRequest, PVRecordPtr const &pvRecord); - virtual void getArray(bool lastRequest,int offset, int count); - virtual void putArray(bool lastRequest,int offset, int count); - virtual void setLength(bool lastRequest,int length, int capacity); + virtual void getArray(size_t offset, size_t count, size_t stride); + virtual void putArray( + PVArrayPtr const &putArray, + size_t offset, size_t count, size_t stride); + virtual void getLength(); + virtual void setLength(size_t length, size_t capacity); virtual void destroy(); + virtual std::tr1::shared_ptr getChannel() + {return channelLocal;} + virtual void cancel(){} + virtual void lastRequest() {} virtual void lock() {mutex.lock();} virtual void unlock() {mutex.unlock();} private: @@ -797,7 +794,6 @@ private: PVRecordPtr const &pvRecord) : isDestroyed(false), - callProcess(callProcess), channelLocal(channelLocal), channelArrayRequester(channelArrayRequester), pvArray(pvArray), @@ -806,7 +802,6 @@ private: { } bool isDestroyed; - bool callProcess; ChannelLocalPtr channelLocal; ChannelArrayRequester::shared_pointer channelArrayRequester; PVArrayPtr pvArray; @@ -825,10 +820,10 @@ ChannelArrayLocalPtr ChannelArrayLocal::create( PVFieldPtrArray const & pvFields = pvRequest->getPVFields(); if(pvFields.size()!=1) { Status status( - Status::STATUSTYPE_ERROR,"invalid pvRequest"); + Status::Status::STATUSTYPE_ERROR,"invalid pvRequest"); ChannelArrayLocalPtr channelArray; - PVScalarArrayPtr pvArray; - channelArrayRequester->channelArrayConnect(status,channelArray,pvArray); + ArrayConstPtr array; + channelArrayRequester->channelArrayConnect(status,channelArray,array); return channelArray; } PVFieldPtr pvField = pvFields[0]; @@ -845,19 +840,21 @@ ChannelArrayLocalPtr ChannelArrayLocal::create( pvField = pvRecord->getPVRecordStructure()->getPVStructure()->getSubField(fieldName); if(pvField==NULL) { Status status( - Status::STATUSTYPE_ERROR,fieldName +" not found"); + Status::Status::STATUSTYPE_ERROR,fieldName +" not found"); ChannelArrayLocalPtr channelArray; - PVScalarArrayPtr pvArray; - channelArrayRequester->channelArrayConnect(status,channelArray,pvArray); + ArrayConstPtr array; + channelArrayRequester->channelArrayConnect( + status,channelArray,array); return channelArray; } if(pvField->getField()->getType()!=scalarArray && pvField->getField()->getType()!=structureArray) { Status status( - Status::STATUSTYPE_ERROR,fieldName +" not array"); + Status::Status::STATUSTYPE_ERROR,fieldName +" not array"); ChannelArrayLocalPtr channelArray; - PVArrayPtr pvArray; - channelArrayRequester->channelArrayConnect(status,channelArray,pvArray); + ArrayConstPtr array; + channelArrayRequester->channelArrayConnect( + status,channelArray,array); return channelArray; } PVArrayPtr pvArray = static_pointer_cast(pvField); @@ -866,26 +863,47 @@ ChannelArrayLocalPtr ChannelArrayLocal::create( PVScalarArrayPtr xxx = static_pointer_cast(pvField); pvCopy = getPVDataCreate()->createPVScalarArray( xxx->getScalarArray()->getElementType()); - } else { + ChannelArrayLocalPtr array(new ChannelArrayLocal( + channelLocal, + channelArrayRequester, + pvArray, + pvCopy, + pvRecord)); + if(pvRecord->getTraceLevel()>0) + { + cout << "ChannelArrayLocal::create"; + cout << " recordName " << pvRecord->getRecordName() << endl; + } + channelArrayRequester->channelArrayConnect( + Status::Ok, array, pvCopy->getArray()); + return array; + } + if(pvField->getField()->getType()==structureArray) { PVStructureArrayPtr xxx = static_pointer_cast(pvField); pvCopy = getPVDataCreate()->createPVStructureArray( - xxx->getStructureArray()); + xxx->getStructureArray()->getStructure()); + ChannelArrayLocalPtr array(new ChannelArrayLocal( + channelLocal, + channelArrayRequester, + pvArray, + pvCopy, + pvRecord)); + if(pvRecord->getTraceLevel()>0) + { + cout << "ChannelArrayLocal::create"; + cout << " recordName " << pvRecord->getRecordName() << endl; + } + channelArrayRequester->channelArrayConnect( + Status::Ok, array, pvCopy->getArray()); + return array; } - ChannelArrayLocalPtr array(new ChannelArrayLocal( - channelLocal, - channelArrayRequester, - pvArray, - pvCopy, - pvRecord)); - if(pvRecord->getTraceLevel()>0) - { - cout << "ChannelArrayLocal::create"; - cout << " recordName " << pvRecord->getRecordName() << endl; - } - channelArrayRequester->channelArrayConnect( - Status::Ok, array, pvCopy); - return array; + Status status(Status::Status::STATUSTYPE_ERROR, + "Sorry only ScalarArray and Structure Array are supported"); + ChannelArrayLocalPtr channelArray; + ArrayConstPtr array; + channelArrayRequester->channelArrayConnect(status,channelArray,array); + return channelArray; } @@ -904,72 +922,120 @@ void ChannelArrayLocal::destroy() channelLocal.reset(); } -void ChannelArrayLocal::getArray(bool lastRequest,int offset, int count) +void ChannelArrayLocal::getArray(size_t offset, size_t count, size_t stride) { if(isDestroyed) { - Status status( - Status::STATUSTYPE_ERROR, - "was destroyed"); - channelArrayRequester->getArrayDone(status); + channelArrayRequester->getArrayDone(channelDestroyedStatus,getPtrSelf(),pvCopy); return; } if(pvRecord->getTraceLevel()>1) { cout << "ChannelArrayLocal::getArray" << endl; } + if(offset<0) { + channelArrayRequester->getArrayDone(illegalOffsetStatus,getPtrSelf(),pvCopy); + return; + } + if(stride<0) { + channelArrayRequester->getArrayDone(illegalStrideStatus,getPtrSelf(),pvCopy); + return; + } + const char *exceptionMessage = NULL; pvRecord->lock(); try { - if(count<0) count = pvArray->getLength(); - size_t capacity = pvArray->getCapacity(); - if(capacity!=0) { - pvCopy->setCapacity(capacity); - pvCopy->setLength(count); - copy(*pvArray.get(),offset,*pvCopy.get(),0,count); + bool ok = false; + while(true) { + size_t length = pvArray->getLength(); + if(length<=0) break; + if(count<=0) { + count = -offset + length/stride; + if(count>0) ok = true; + break; + } + size_t maxcount = -offset + length/stride; + if(count>maxcount) count = maxcount; + ok = true; + break; } - } catch(...) { - pvRecord->unlock(); - throw; + if(ok) { + pvCopy->setLength(count); + copy(pvArray,offset,stride,pvCopy,0,1,count); + } + } catch(std::exception e) { + exceptionMessage = e.what(); } pvRecord->unlock(); - channelArrayRequester->getArrayDone(Status::Ok); - if(lastRequest) destroy(); + Status status = Status::Ok; + if(exceptionMessage!=NULL) { + status = Status(Status::Status::STATUSTYPE_ERROR,exceptionMessage); + } + channelArrayRequester->getArrayDone(status,getPtrSelf(),pvCopy); } -void ChannelArrayLocal::putArray(bool lastRequest,int offset, int count) +void ChannelArrayLocal::putArray( + PVArrayPtr const & pvArray, size_t offset, size_t count, size_t stride) { if(isDestroyed) { - Status status( - Status::STATUSTYPE_ERROR, - "was destroyed"); - channelArrayRequester->putArrayDone(status); + channelArrayRequester->putArrayDone(channelDestroyedStatus,getPtrSelf()); return; } if(pvRecord->getTraceLevel()>1) { cout << "ChannelArrayLocal::putArray" << endl; } + if(offset<0) { + channelArrayRequester->putArrayDone(illegalOffsetStatus,getPtrSelf()); + return; + } + if(count<0) { + channelArrayRequester->putArrayDone(illegalCountStatus,getPtrSelf()); + return; + } + if(stride<0) { + channelArrayRequester->putArrayDone(illegalStrideStatus,getPtrSelf()); + return; + } + size_t newLength = offset + count*stride; + pvArray->setLength(newLength); + const char *exceptionMessage = NULL; pvRecord->lock(); try { - if(count<=0) count = pvCopy->getLength(); - if(pvArray->getCapacity()setCapacity(count); - if(pvArray->getLength()setLength(count); - copy(*pvCopy.get(),0,*pvArray.get(),offset,count); - } catch(...) { - pvRecord->unlock(); - throw; + copy(pvArray,0,1,this->pvArray,offset,stride,count); + } catch(std::exception e) { + exceptionMessage = e.what(); } pvRecord->unlock(); - channelArrayRequester->putArrayDone(Status::Ok); - if(lastRequest) destroy(); + Status status = Status::Ok; + if(exceptionMessage!=NULL) { + status = Status(Status::Status::STATUSTYPE_ERROR,exceptionMessage); + } + channelArrayRequester->putArrayDone(status,getPtrSelf()); } -void ChannelArrayLocal::setLength(bool lastRequest,int length, int capacity) +void ChannelArrayLocal::getLength() +{ + size_t length = 0; + size_t capacity = 0; + const char *exceptionMessage = NULL; + pvRecord->lock(); + try { + length = pvArray->getLength(); + capacity = pvArray->getCapacity(); + } catch(std::exception e) { + exceptionMessage = e.what(); + } + pvRecord->unlock(); + Status status = Status::Ok; + if(exceptionMessage!=NULL) { + status = Status(Status::Status::STATUSTYPE_ERROR,exceptionMessage); + } + channelArrayRequester->getLengthDone(status,getPtrSelf(),length,capacity); +} + +void ChannelArrayLocal::setLength(size_t length, size_t capacity) { if(isDestroyed) { - Status status( - Status::STATUSTYPE_ERROR, - "was destroyed"); - channelArrayRequester->setLengthDone(status); + channelArrayRequester->setLengthDone(channelDestroyedStatus,getPtrSelf()); return; } if(pvRecord->getTraceLevel()>1) @@ -980,16 +1046,16 @@ void ChannelArrayLocal::setLength(bool lastRequest,int length, int capacity) try { if(capacity>=0 && !pvArray->isCapacityMutable()) { Status status( - Status::STATUSTYPE_ERROR, + Status::Status::STATUSTYPE_ERROR, "capacityImnutable"); - channelArrayRequester->setLengthDone(status); + channelArrayRequester->setLengthDone(status,getPtrSelf()); pvRecord->unlock(); return; } - if(capacity>0) { + if(capacity>=0) { if(pvArray->getCapacity()!=capacity) pvArray->setCapacity(capacity); } - if(length>0) { + if(length>=0) { if(pvArray->getLength()!=length) pvArray->setLength(length); } } catch(...) { @@ -997,7 +1063,7 @@ void ChannelArrayLocal::setLength(bool lastRequest,int length, int capacity) throw; } pvRecord->unlock(); - channelArrayRequester->setLengthDone(Status::Ok); + channelArrayRequester->setLengthDone(Status::Ok,getPtrSelf()); } diff --git a/src/pvAccess/channelProviderLocal.h b/src/pvAccess/channelProviderLocal.h index 2c05b28..9629a01 100644 --- a/src/pvAccess/channelProviderLocal.h +++ b/src/pvAccess/channelProviderLocal.h @@ -10,14 +10,6 @@ */ #ifndef CHANNELPROVIDERLOCAL_H #define CHANNELPROVIDERLOCAL_H - - -#ifdef epicsExportSharedSymbols -# define channelProviderLocalEpicsExportSharedSymbols -# undef epicsExportSharedSymbols -#endif - - #include #include #include @@ -29,17 +21,11 @@ #include #include #include +#include +#include #include -#include - -#ifdef channelProviderLocalEpicsExportSharedSymbols -# define epicsExportSharedSymbols -# undef channelProviderLocalEpicsExportSharedSymbols -# include -#endif - #include -#include +#include namespace epics { namespace pvDatabase { @@ -69,15 +55,10 @@ public: PVRecordPtr const & pvRecord, epics::pvData::MonitorRequester::shared_pointer const & monitorRequester, epics::pvData::PVStructurePtr const & pvRequest); - void registerMonitorAlgorithmCreate( - MonitorAlgorithmCreatePtr const &monitorAlgorithmCreate); - MonitorAlgorithmCreatePtr getMonitorAlgorithmCreate( - epics::pvData::String algorithmName); private: MonitorFactory(); friend class MonitorLocal; friend MonitorFactoryPtr getMonitorFactory(); - std::multiset monitorAlgorithmCreateList; bool isDestroyed; epics::pvData::Mutex mutex; }; @@ -97,6 +78,8 @@ public: virtual epics::pvAccess::ChannelFind::shared_pointer channelFind( epics::pvData::String const &channelName, epics::pvAccess::ChannelFindRequester::shared_pointer const & channelFindRequester); + virtual epics::pvAccess::ChannelFind::shared_pointer channelList( + epics::pvAccess::ChannelListRequester::shared_pointer const & channelListRequester); virtual epics::pvAccess::Channel::shared_pointer createChannel( epics::pvData::String const &channelName, epics::pvAccess::ChannelRequester::shared_pointer const &channelRequester, diff --git a/src/pvAccess/pvCopyMonitor.h b/src/pvAccess/pvCopyMonitor.h index 37ed4e8..b3b4385 100644 --- a/src/pvAccess/pvCopyMonitor.h +++ b/src/pvAccess/pvCopyMonitor.h @@ -17,6 +17,7 @@ #include +#include #include #include #include diff --git a/testTop/Makefile b/test/Makefile similarity index 77% rename from testTop/Makefile rename to test/Makefile index 0a9fd57..999631d 100644 --- a/testTop/Makefile +++ b/test/Makefile @@ -1,8 +1,6 @@ -# Makefile at top of application tree - +#Makefile at top of application tree TOP = . include $(TOP)/configure/CONFIG - DIRS += configure DIRS += src diff --git a/testTop/configure/CONFIG b/test/configure/CONFIG similarity index 100% rename from testTop/configure/CONFIG rename to test/configure/CONFIG diff --git a/arrayPerfTop/configure/CONFIG_SITE b/test/configure/CONFIG_SITE similarity index 53% rename from arrayPerfTop/configure/CONFIG_SITE rename to test/configure/CONFIG_SITE index 65cfc97..9e1ec9a 100644 --- a/arrayPerfTop/configure/CONFIG_SITE +++ b/test/configure/CONFIG_SITE @@ -14,11 +14,26 @@ # Set CHECK_RELEASE to NO to disable checking completely. # Set CHECK_RELEASE to WARN to perform consistency checking but # continue building anyway if conflicts are found. -CHECK_RELEASE = WARN +#CHECK_RELEASE = YES + +# Set this when you only want to compile this application +# for a subset of the cross-compiled target architectures +# that Base is built for. +#CROSS_COMPILER_TARGET_ARCHS = vxWorks-68040 # To install files into a location other than $(TOP) define # INSTALL_LOCATION here. #INSTALL_LOCATION= --include $(TOP)/../configure/CONFIG_SITE.local --include $(TOP)/../../CONFIG_SITE.local +# Set this when your IOC and the host use different paths +# to access the application. This will be needed to boot +# from a Microsoft FTP server or with some NFS mounts. +# You must rebuild in the iocBoot directory for this to +# take effect. +#IOCS_APPL_TOP = + +INSTALL_INCLUDE = $(INSTALL_LOCATION)/include/pv +USR_INCLUDES += -I $(INSTALL_LOCATION)/include + +-include $(TOP)/configure/CONFIG_SITE.local +-include $(TOP)/../CONFIG.local diff --git a/testTop/configure/Makefile b/test/configure/Makefile similarity index 99% rename from testTop/configure/Makefile rename to test/configure/Makefile index aefe673..9254309 100644 --- a/testTop/configure/Makefile +++ b/test/configure/Makefile @@ -6,4 +6,3 @@ TARGETS = $(CONFIG_TARGETS) CONFIGS += $(subst ../,,$(wildcard $(CONFIG_INSTALLS))) include $(TOP)/configure/RULES - diff --git a/testTop/configure/RELEASE b/test/configure/RELEASE similarity index 76% rename from testTop/configure/RELEASE rename to test/configure/RELEASE index 9ee677d..392a719 100644 --- a/testTop/configure/RELEASE +++ b/test/configure/RELEASE @@ -1,4 +1,4 @@ -# pvDatabaseCPP/testTop RELEASE - Location of external support modules +# pvDatabaseCPP/test RELEASE - Location of external support modules # # IF YOU CHANGE this file or any file it includes you must # subsequently do a "gnumake rebuild" in the application's @@ -16,9 +16,8 @@ # EPICS V4 Developers: Do not edit the locations in this file! # -# Create a file RELEASE.local pointing to your PVASRV, PVACCESS, -# PVDATA, PVCOMMON and EPICS_BASE build directories, e.g. -# PVASRV = /path/to/epics/pvaSrvCPP +# Create a file RELEASE.local pointing to your places +# for the dependencies, e.g. # PVACCESS = /path/to/epics/pvAccessCPP # PVDATA = /path/to/epics/pvDataCPP # PVCOMMON = /path/to/epics/pvCommonCPP @@ -28,14 +27,14 @@ # use the following definitions: PVDATABASE = $(TOP)/.. - --include $(TOP)/../configure/RELEASE.local -include $(TOP)/../../RELEASE.local +-include $(TOP)/../configure/RELEASE.local # If you copied these tests from pvDatabaseCPP to be built as a -# standalone TOP, adjust and use the following definitions: +# standalone TOP, define +# PVDATABASE = /path/to/epics/pvDatabaseCPP +# in the appropriate RELEASE[.local], +# and use the following definitions instead: -#PVDATABASE = /path/to/epics/pvDatabaseCPP - -#-include $(TOP)/configure/RELEASE.local #-include $(TOP)/../RELEASE.local +#-include $(TOP)/configure/RELEASE.local diff --git a/testTop/configure/RULES b/test/configure/RULES similarity index 100% rename from testTop/configure/RULES rename to test/configure/RULES diff --git a/testTop/configure/RULES.ioc b/test/configure/RULES.ioc similarity index 100% rename from testTop/configure/RULES.ioc rename to test/configure/RULES.ioc diff --git a/testTop/configure/RULES_DIRS b/test/configure/RULES_DIRS similarity index 100% rename from testTop/configure/RULES_DIRS rename to test/configure/RULES_DIRS diff --git a/testTop/configure/RULES_TOP b/test/configure/RULES_TOP similarity index 100% rename from testTop/configure/RULES_TOP rename to test/configure/RULES_TOP diff --git a/testTop/src/Makefile b/test/src/Makefile similarity index 100% rename from testTop/src/Makefile rename to test/src/Makefile diff --git a/testTop/src/powerSupply.cpp b/test/src/powerSupply.cpp similarity index 99% rename from testTop/src/powerSupply.cpp rename to test/src/powerSupply.cpp index 09030a1..af3aab4 100644 --- a/testTop/src/powerSupply.cpp +++ b/test/src/powerSupply.cpp @@ -9,13 +9,10 @@ * @date 2013.04.02 */ +#include "powerSupply.h" #include #include -#define epicsExportSharedSymbols -#include "powerSupply.h" - - namespace epics { namespace pvDatabase { using namespace epics::pvData; diff --git a/testTop/src/powerSupply.h b/test/src/powerSupply.h similarity index 81% rename from testTop/src/powerSupply.h rename to test/src/powerSupply.h index 051c013..50d546c 100644 --- a/testTop/src/powerSupply.h +++ b/test/src/powerSupply.h @@ -11,32 +11,19 @@ #ifndef POWERSUPPLY_H #define POWERSUPPLY_H -//#include +#include -#ifdef epicsExportSharedSymbols -# define powersupplyEpicsExportSharedSymbols -# undef epicsExportSharedSymbols -#endif - -#include -#include #include +#include #include +#include #include - -#ifdef powersupplyEpicsExportSharedSymbols -# define epicsExportSharedSymbols -# undef powersupplyEpicsExportSharedSymbols -# include -#endif - - namespace epics { namespace pvDatabase { epicsShareExtern epics::pvData::PVStructurePtr createPowerSupply(); -class epicsShareClass PowerSupply; +class PowerSupply; typedef std::tr1::shared_ptr PowerSupplyPtr; class PowerSupply : diff --git a/testTop/src/powerSupplyRegister.cpp b/test/src/powerSupplyRegister.cpp similarity index 94% rename from testTop/src/powerSupplyRegister.cpp rename to test/src/powerSupplyRegister.cpp index 93d83b1..963f41b 100644 --- a/testTop/src/powerSupplyRegister.cpp +++ b/test/src/powerSupplyRegister.cpp @@ -27,14 +27,13 @@ #include #include +#include + #include #include #include #include - -#include - -#include +#include using namespace epics::pvData; using namespace epics::pvAccess; @@ -67,7 +66,4 @@ static void powerSupplyRegister(void) iocshRegister(&powerSupplyFuncDef, powerSupplyCallFunc); } } - -extern "C" { - epicsExportRegistrar(powerSupplyRegister); -} +epicsExportRegistrar(powerSupplyRegister); diff --git a/test/src/powerSupplyRegister.dbd b/test/src/powerSupplyRegister.dbd new file mode 100644 index 0000000..1444fc1 --- /dev/null +++ b/test/src/powerSupplyRegister.dbd @@ -0,0 +1 @@ +registrar("powerSupplyRegister") diff --git a/testTop/src/testExampleRecord.cpp b/test/src/testExampleRecord.cpp similarity index 98% rename from testTop/src/testExampleRecord.cpp rename to test/src/testExampleRecord.cpp index 8f28f04..ba21e3b 100644 --- a/testTop/src/testExampleRecord.cpp +++ b/test/src/testExampleRecord.cpp @@ -23,6 +23,7 @@ #include #include +#include #include #include @@ -30,10 +31,6 @@ #include #include "powerSupply.h" -#define epicsExportSharedSymbols -#include - - using namespace std; using std::tr1::static_pointer_cast; using namespace epics::pvData; diff --git a/testTop/src/testPVCopy.cpp b/test/src/testPVCopy.cpp similarity index 100% rename from testTop/src/testPVCopy.cpp rename to test/src/testPVCopy.cpp diff --git a/testTop/src/testPVRecord.cpp b/test/src/testPVRecord.cpp similarity index 100% rename from testTop/src/testPVRecord.cpp rename to test/src/testPVRecord.cpp