From 727153e96587597b3b3236d48644d258fd7bdb5b Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Mon, 26 Nov 2018 09:43:11 -0800 Subject: [PATCH] deprecate BoundedString, BoundedScalarArray, and FixedScalarArray https://github.com/epics-base/pvDataCPP/issues/52 --- configure/CONFIG_SITE | 2 ++ documentation/release_notes.dox | 2 ++ src/pv/pvIntrospect.h | 19 +++++++++++++------ 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/configure/CONFIG_SITE b/configure/CONFIG_SITE index 83393b9..22e4fd6 100644 --- a/configure/CONFIG_SITE +++ b/configure/CONFIG_SITE @@ -20,6 +20,8 @@ CHECK_RELEASE = YES # INSTALL_LOCATION here. #INSTALL_LOCATION= +USR_CPPFLAGS += -DPVD_INTERNAL + -include $(TOP)/../CONFIG_SITE.local -include $(TOP)/configure/CONFIG_SITE.local diff --git a/documentation/release_notes.dox b/documentation/release_notes.dox index 71ba1f6..6254615 100644 --- a/documentation/release_notes.dox +++ b/documentation/release_notes.dox @@ -6,6 +6,8 @@ Release 7.1.0 (UNRELEASED) ========================== - Deprecations + - BoundedString, BoundedScalarArray, and FixedScalarArray will be removed unless they are fixed. + See https://github.com/epics-base/pvDataCPP/issues/52 for discussion. - pv/localStaticLock.h - pv/pvCopy.h (see epics::pvData::PVRequestMapper) - Removals diff --git a/src/pv/pvIntrospect.h b/src/pv/pvIntrospect.h index 9ce2302..ffdb652 100644 --- a/src/pv/pvIntrospect.h +++ b/src/pv/pvIntrospect.h @@ -23,6 +23,13 @@ #include +#if !defined(PVD_INTERNAL) && __GNUC__ > 2 +# define PVD_DEPRECATED(msg) __attribute__((deprecated(msg))) +#else +# define PVD_DEPRECATED(msg) +#endif +#define PVD_DEPRECATED_52 PVD_DEPRECATED("https://github.com/epics-base/pvDataCPP/issues/52") + /* C++11 keywords @code struct Base { @@ -972,7 +979,7 @@ public: * @param maxLength a string maximum length. * @return this instance of a @c FieldBuilder. */ - FieldBuilderPtr addBoundedString(std::string const & name, std::size_t maxLength); + FieldBuilderPtr addBoundedString(std::string const & name, std::size_t maxLength) PVD_DEPRECATED_52; /** * Add a @c Field (e.g. @c Structure, @c Union). @@ -997,7 +1004,7 @@ public: * @param size Array fixed size. * @return this instance of a @c FieldBuilder. */ - FieldBuilderPtr addFixedArray(std::string const & name, ScalarType scalarType, std::size_t size); + FieldBuilderPtr addFixedArray(std::string const & name, ScalarType scalarType, std::size_t size) PVD_DEPRECATED_52; /** * Add bounded-size array of @c Scalar elements. @@ -1006,7 +1013,7 @@ public: * @param bound Array maximum capacity (size). * @return this instance of a @c FieldBuilder. */ - FieldBuilderPtr addBoundedArray(std::string const & name, ScalarType scalarType, std::size_t bound); + FieldBuilderPtr addBoundedArray(std::string const & name, ScalarType scalarType, std::size_t bound) PVD_DEPRECATED_52; /** * Add array of @c Field elements. @@ -1146,7 +1153,7 @@ public: * @return a @c BoundedString interface for the newly created object. * @throws IllegalArgumentException if maxLength == 0. */ - BoundedStringConstPtr createBoundedString(std::size_t maxLength) const; + BoundedStringConstPtr createBoundedString(std::size_t maxLength) const PVD_DEPRECATED_52; /** * Create an @c Array field, variable size array. * @param elementType The @c ScalarType for array elements @@ -1159,14 +1166,14 @@ public: * @param size Fixed array size. * @return An @c Array Interface for the newly created object. */ - ScalarArrayConstPtr createFixedScalarArray(ScalarType elementType, std::size_t size) const; + ScalarArrayConstPtr createFixedScalarArray(ScalarType elementType, std::size_t size) const PVD_DEPRECATED_52; /** * Create an @c Array field, bounded size array. * @param elementType The @c ScalarType for array elements * @param bound Array maximum capacity. * @return An @c Array Interface for the newly created object. */ - ScalarArrayConstPtr createBoundedScalarArray(ScalarType elementType, std::size_t bound) const; + ScalarArrayConstPtr createBoundedScalarArray(ScalarType elementType, std::size_t bound) const PVD_DEPRECATED_52; /** * Create an @c Array field that is has element type @c Structure * @param structure The @c Structure for each array element.