From 035b285a76b1535952774ed784acde73ba7b2bfd Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Mon, 25 Dec 2023 21:18:33 +0000 Subject: [PATCH] API change to PVSupport, likely unused though --- documentation/RELEASE_NOTES.md | 10 ++++++++++ src/pv/controlSupport.h | 5 ++--- src/pv/pvSupport.h | 14 +++++++------- src/pv/scalarAlarmSupport.h | 2 +- 4 files changed, 20 insertions(+), 11 deletions(-) diff --git a/documentation/RELEASE_NOTES.md b/documentation/RELEASE_NOTES.md index e3cea46..9e5af4b 100644 --- a/documentation/RELEASE_NOTES.md +++ b/documentation/RELEASE_NOTES.md @@ -2,6 +2,16 @@ This document summarizes the changes to the module between releases. +## Release 4.7.2 (UNRELEASED) + +* The virtual `init()` method of `class PVSupport` has been made un-virtual, and the base-class + implementation always returns `false` as it should not be used. The `ControlSupport` and + `ScalarAlarmSupport` derived classes already provided their own implementations but needed + different method arguments, so a virtual base-class method couldn't be used anyway. + Those derived classes don't appear to be used internally at all, although they were being + used in Marty Kraimer's exampleCPP repository which is no longer maintained or recommended + for use anyway. + ## Release 4.7.1 (EPICS 7.0.8, Dec 2023) * Added data distributor plugin which can be used for distributing data between diff --git a/src/pv/controlSupport.h b/src/pv/controlSupport.h index 4438020..3c501dc 100644 --- a/src/pv/controlSupport.h +++ b/src/pv/controlSupport.h @@ -35,19 +35,18 @@ class epicsShareClass ControlSupport : */ virtual ~ControlSupport(); /** - * @brief Connects to contol fields. + * @brief Connects to control fields. * * @param pvValue The field to support. * @param pvSupport Support specific fields. * @return true for success and false for failure. */ - virtual bool init( + bool init( epics::pvData::PVFieldPtr const & pvValue, epics::pvData::PVFieldPtr const & pvSupport); /** * @brief Honors control fields. * - * * @return Returns true is any fields were modified; otherwise false. */ virtual bool process(); diff --git a/src/pv/pvSupport.h b/src/pv/pvSupport.h index fff10c6..df8b552 100644 --- a/src/pv/pvSupport.h +++ b/src/pv/pvSupport.h @@ -38,17 +38,17 @@ class epicsShareClass PVSupport */ virtual ~PVSupport(){} /** - * @brief Optional initialization method. + * @brief Required initialization method. * - * Called after PVRecord is created but before record is installed into PVDatabase. + * Implementation classes must define an init() method that must be + * explicitly called by PVRecord classes that use them to provide + * references to the specific fields to be supported. Different support + * will may different fields, so a virtual method cannot be defined in + * this base class to support them, hence this method always fails. * - * @param pvValue The field to support. - * @param pvSupport Support specific fields. * @return true for success and false for failure. */ - virtual bool init( - epics::pvData::PVFieldPtr const & pvValue, - epics::pvData::PVFieldPtr const & pvSupport) {return true;} + bool init() {return false;} /** * @brief Optional method for derived class. * diff --git a/src/pv/scalarAlarmSupport.h b/src/pv/scalarAlarmSupport.h index 4fe7e32..0c5f550 100644 --- a/src/pv/scalarAlarmSupport.h +++ b/src/pv/scalarAlarmSupport.h @@ -45,7 +45,7 @@ class epicsShareClass ScalarAlarmSupport : * @param pvSupport Support specific fields. * @return true for success and false for failure. */ - virtual bool init( + bool init( epics::pvData::PVFieldPtr const & pvValue, epics::pvData::PVStructurePtr const & pvAlarm, epics::pvData::PVFieldPtr const & pvSupport);