diff --git a/Migration.md b/Migration.md index 8b121ade8..94b3e71b9 100644 --- a/Migration.md +++ b/Migration.md @@ -13,6 +13,9 @@ release will remove the deprecated code. be used instead, which properly handles submeshes having no material index applied to them. +1. All the plugin APIs are deprecated, use the gz-plugin library instead. See + the [migration guide](https://github.com/ignitionrobotics/ign-plugin/blob/ign-plugin1/MIGRATION.md). + ### Additions 1. **geospatial** component that loads heightmap images and DEMs diff --git a/include/ignition/common/Plugin.hh b/include/ignition/common/Plugin.hh index c89fb67ca..270e2e62b 100644 --- a/include/ignition/common/Plugin.hh +++ b/include/ignition/common/Plugin.hh @@ -153,7 +153,7 @@ namespace ignition /// \brief Default constructor. This is kept private to ensure that /// Plugins are always managed by a PluginPtr object. - private: Plugin(); + private: IGN_DEPRECATED(5) Plugin(); /// \brief Type-agnostic retriever for interfaces private: void *PrivateGetInterface( diff --git a/include/ignition/common/PluginInfo.hh b/include/ignition/common/PluginInfo.hh index 4ae4941b6..adddf4a72 100644 --- a/include/ignition/common/PluginInfo.hh +++ b/include/ignition/common/PluginInfo.hh @@ -22,6 +22,7 @@ #include #include #include +#include namespace ignition { @@ -35,7 +36,7 @@ namespace ignition /// \brief Holds info required to construct a plugin - struct PluginInfo + struct IGN_DEPRECATED(5) PluginInfo { /// \brief The name of the plugin std::string name; diff --git a/include/ignition/common/PluginLoader.hh b/include/ignition/common/PluginLoader.hh index c4d1c507c..59ff5e3b2 100644 --- a/include/ignition/common/PluginLoader.hh +++ b/include/ignition/common/PluginLoader.hh @@ -40,7 +40,7 @@ namespace ignition class IGNITION_COMMON_VISIBLE PluginLoader { /// \brief Constructor - public: PluginLoader(); + public: IGN_DEPRECATED(5) PluginLoader(); /// \brief Destructor public: ~PluginLoader(); diff --git a/include/ignition/common/PluginMacros.hh b/include/ignition/common/PluginMacros.hh index cbaaede90..0b3ba7eeb 100644 --- a/include/ignition/common/PluginMacros.hh +++ b/include/ignition/common/PluginMacros.hh @@ -21,6 +21,8 @@ #include "ignition/common/detail/PluginMacros.hh" +// Deprecated, use gz-plugin + // --------------- Specialize a plugin interface (optional) ------------------- /// \brief Call this macro inside a public scope of an interface in order to get diff --git a/include/ignition/common/PluginPtr.hh b/include/ignition/common/PluginPtr.hh index 1ea2f3874..7228d6308 100644 --- a/include/ignition/common/PluginPtr.hh +++ b/include/ignition/common/PluginPtr.hh @@ -60,19 +60,20 @@ namespace ignition /// \brief Default constructor. Creates a PluginPtr object that does not /// point to any plugin instance. IsEmpty() will return true until a /// plugin instance is provided. - public: TemplatePluginPtr(); + public: IGN_DEPRECATED(5) TemplatePluginPtr(); /// \brief Copy constructor. This PluginPtr will now point at the same /// plugin instance as _other, and they will share ownership. /// \param[in] _other Pointer to plugin being copied. - public: TemplatePluginPtr(const TemplatePluginPtr &_other); + public: IGN_DEPRECATED(5) TemplatePluginPtr( + const TemplatePluginPtr &_other); /// \brief Move constructor. This PluginPtr will take ownership of the /// plugin instance held by _other. If this PluginPtr was holding an /// instance to another plugin, that instance will be deleted if no other /// PluginPtr is referencing it. /// \param[in] _other Pointer to plugin being moved. - public: TemplatePluginPtr(TemplatePluginPtr &&_other); + public: IGN_DEPRECATED(5) TemplatePluginPtr(TemplatePluginPtr &&_other); /// \brief Casting constructor. This PluginPtr will now point at the same /// plugin instance as _other, and they will share ownership. This @@ -83,7 +84,7 @@ namespace ignition /// \param[in] _other Another PluginPtr object. It may have a different /// kind of specialization. public: template - TemplatePluginPtr( + IGN_DEPRECATED(5) TemplatePluginPtr( const TemplatePluginPtr &_other); /// \brief Copy assignment operator. This PluginPtr will now point at the @@ -206,7 +207,8 @@ namespace ignition /// \param[in] _info A PluginInfo instance that was generated by /// PluginLoader. Alternatively, this can take a nullptr to create an /// empty PluginPtr. - private: explicit TemplatePluginPtr(const PluginInfo *_info); + private: explicit IGN_DEPRECATED(5) TemplatePluginPtr( + const PluginInfo *_info); /// \brief Pointer to the plugin wrapper that this PluginPtr is managing. private: std::unique_ptr dataPtr; @@ -218,11 +220,11 @@ namespace ignition /// \brief Typical usage for TemplatePluginPtr is to just hold a generic /// Plugin type. - using PluginPtr = TemplatePluginPtr; + using PluginPtr IGN_DEPRECATED(5) = TemplatePluginPtr; /// \brief This produces a PluginPtr whose Plugin wrapper only grants access /// to const-qualified interfaces of the plugin instance. - using ConstPluginPtr = TemplatePluginPtr; + using ConstPluginPtr IGN_DEPRECATED(5) = TemplatePluginPtr; } } diff --git a/include/ignition/common/SpecializedPlugin.hh b/include/ignition/common/SpecializedPlugin.hh index 3c53b59f1..e3af8f5a2 100644 --- a/include/ignition/common/SpecializedPlugin.hh +++ b/include/ignition/common/SpecializedPlugin.hh @@ -103,7 +103,7 @@ namespace ignition template friend class TemplatePluginPtr; /// \brief Default constructor - private: SpecializedPlugin(); + private: IGN_DEPRECATED(5) SpecializedPlugin(); /// \brief type is an empty placeholder class which is used by the private /// member functions to provide two overloads: a high-performance one for diff --git a/include/ignition/common/SpecializedPluginPtr.hh b/include/ignition/common/SpecializedPluginPtr.hh index 664744dc5..3ab0bc1a6 100644 --- a/include/ignition/common/SpecializedPluginPtr.hh +++ b/include/ignition/common/SpecializedPluginPtr.hh @@ -67,13 +67,13 @@ namespace ignition /// ignition/common/PluginMacros.hh into a public location of its class /// definition. template - using SpecializedPluginPtr = + using SpecializedPluginPtr IGN_DEPRECATED(5) = TemplatePluginPtr< SpecializedPlugin >; /// \brief This alias creates a specialized PluginPtr whose interfaces are /// all const-qualified. template - using ConstSpecializedPluginPtr = + using ConstSpecializedPluginPtr IGN_DEPRECATED(5) = TemplatePluginPtr< const SpecializedPlugin >; } } diff --git a/src/Plugin.cc b/src/Plugin.cc index 6fbfc21a6..54bf85e12 100644 --- a/src/Plugin.cc +++ b/src/Plugin.cc @@ -15,10 +15,12 @@ * */ +#include "gz/utils/SuppressWarning.hh" +#include "ignition/common/Console.hh" +IGN_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION #include "ignition/common/Plugin.hh" #include "ignition/common/PluginInfo.hh" -#include "ignition/common/Console.hh" #include "PluginUtils.hh" namespace ignition @@ -184,3 +186,4 @@ namespace ignition } } } +IGN_UTILS_WARN_RESUME__DEPRECATED_DECLARATION diff --git a/src/PluginLoader.cc b/src/PluginLoader.cc index 230947407..401341e3e 100644 --- a/src/PluginLoader.cc +++ b/src/PluginLoader.cc @@ -23,12 +23,15 @@ #include #include +#include "gz/utils/SuppressWarning.hh" #include "ignition/common/Console.hh" +#include "ignition/common/StringUtils.hh" +#include "ignition/common/Util.hh" + +IGN_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION #include "ignition/common/PluginInfo.hh" #include "ignition/common/PluginLoader.hh" #include "ignition/common/PluginPtr.hh" -#include "ignition/common/StringUtils.hh" -#include "ignition/common/Util.hh" #include "PluginUtils.hh" @@ -315,3 +318,4 @@ namespace ignition } } } +IGN_UTILS_WARN_RESUME__DEPRECATED_DECLARATION diff --git a/src/PluginLoader_TEST.cc b/src/PluginLoader_TEST.cc index 913a81451..fc7e69031 100644 --- a/src/PluginLoader_TEST.cc +++ b/src/PluginLoader_TEST.cc @@ -20,8 +20,9 @@ #include #include +#include + #include "ignition/common/config.hh" -#include "ignition/common/PluginLoader.hh" #include "ignition/common/SystemPaths.hh" #include "ignition/common/TempDirectory.hh" @@ -36,6 +37,9 @@ class TestTempDirectory : public ignition::common::TempDirectory } }; +IGN_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION +#include "ignition/common/PluginLoader.hh" + ///////////////////////////////////////////////// TEST(PluginLoader, InitialNoInterfacesImplemented) { @@ -94,3 +98,4 @@ TEST(PluginLoader, InstantiateUnloadedPlugin) pm.Instantiate("plugin::that::is::not::loaded"); EXPECT_FALSE(plugin); } +IGN_UTILS_WARN_RESUME__DEPRECATED_DECLARATION diff --git a/src/PluginUtils.hh b/src/PluginUtils.hh index 4c1284592..9a65494e9 100644 --- a/src/PluginUtils.hh +++ b/src/PluginUtils.hh @@ -19,6 +19,7 @@ #define IGNITION_COMMON_PLUGINUTILS_HH_ #include +#include "ignition/common/Export.hh" #include "ignition/common/StringUtils.hh" namespace ignition @@ -28,7 +29,7 @@ namespace ignition /// \brief Format the name to start with "::" /// \param[in] _name The name of a plugin or interface /// \return The input, but with "::" prepended if it was not there already. - inline std::string NormalizeName(const std::string &_name) + inline std::string IGN_DEPRECATED(5) NormalizeName(const std::string &_name) { std::string name = _name; if (!StartsWith(_name, "::")) diff --git a/src/PluginUtils_TEST.cc b/src/PluginUtils_TEST.cc index 5ef99d121..ee2690767 100644 --- a/src/PluginUtils_TEST.cc +++ b/src/PluginUtils_TEST.cc @@ -16,11 +16,13 @@ */ #include #include +#include "gz/utils/SuppressWarning.hh" #include "PluginUtils.hh" using namespace ignition; +IGN_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION ///////////////////////////////////////////////// TEST(PluginUtils, NormalizeName) { @@ -33,3 +35,4 @@ TEST(PluginUtils, NormalizeName) EXPECT_EQ("::ignition::math", common::NormalizeName("ignition::math")); EXPECT_EQ("::ignition::math", common::NormalizeName("::ignition::math")); } +IGN_UTILS_WARN_RESUME__DEPRECATED_DECLARATION diff --git a/test/integration/plugin.cc b/test/integration/plugin.cc index a8ee39e5d..a2fecdc4c 100644 --- a/test/integration/plugin.cc +++ b/test/integration/plugin.cc @@ -27,14 +27,17 @@ #include #include "ignition/common/Console.hh" #include "ignition/common/Filesystem.hh" -#include "ignition/common/PluginLoader.hh" #include "ignition/common/SystemPaths.hh" -#include "ignition/common/PluginPtr.hh" -#include "ignition/common/SpecializedPluginPtr.hh" +#include "gz/utils/SuppressWarning.hh" #include "DummyPluginsPath.h" #include "plugins/DummyPlugins.hh" +IGN_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION +#include "ignition/common/PluginLoader.hh" +#include "ignition/common/PluginPtr.hh" +#include "ignition/common/SpecializedPluginPtr.hh" + ///////////////////////////////////////////////// TEST(PluginLoader, LoadBadPlugins) { @@ -434,3 +437,4 @@ TEST(PluginPtr, QueryInterfaceSharedPtr) SetSomeValues(setter); CheckSomeValues(getInt, getDouble, getName); } +IGN_UTILS_WARN_RESUME__DEPRECATED_DECLARATION diff --git a/test/performance/plugin_specialization.cc b/test/performance/plugin_specialization.cc index 9e33a7b87..a508154fc 100644 --- a/test/performance/plugin_specialization.cc +++ b/test/performance/plugin_specialization.cc @@ -20,15 +20,20 @@ #include #include -#include "ignition/common/PluginLoader.hh" +#include "gz/utils/SuppressWarning.hh" + #include "ignition/common/SystemPaths.hh" -#include "ignition/common/SpecializedPluginPtr.hh" #include "ignition/common/Console.hh" #include "DummyPluginsPath.h" #include "plugins/DummyPlugins.hh" +IGN_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION +#include "ignition/common/PluginLoader.hh" +#include "ignition/common/SpecializedPluginPtr.hh" + + #define IGN_CREATE_SPEC_INTERFACE(name)\ class name { public: IGN_COMMON_SPECIALIZE_INTERFACE(name) }; @@ -227,3 +232,5 @@ TEST(PluginSpecialization, AccessTime) << "ns\n" << std::endl; } } + +IGN_UTILS_WARN_RESUME__DEPRECATED_DECLARATION diff --git a/test/plugins/BadPluginAPIVersionNew.cc b/test/plugins/BadPluginAPIVersionNew.cc index 681feca0e..12ca82911 100644 --- a/test/plugins/BadPluginAPIVersionNew.cc +++ b/test/plugins/BadPluginAPIVersionNew.cc @@ -17,6 +17,9 @@ #include #include "ignition/common/PluginMacros.hh" +#include "gz/utils/SuppressWarning.hh" + +IGN_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION extern "C" { std::size_t DETAIL_IGN_PLUGIN_VISIBLE IGNCOMMONPluginInfoSize = @@ -35,3 +38,5 @@ extern "C" std::size_t DETAIL_IGN_PLUGIN_VISIBLE IGNCOMMONMultiPluginInfo( return 0u; } +IGN_UTILS_WARN_RESUME__DEPRECATED_DECLARATION + diff --git a/test/plugins/BadPluginAPIVersionOld.cc b/test/plugins/BadPluginAPIVersionOld.cc index 342286789..9fad92792 100644 --- a/test/plugins/BadPluginAPIVersionOld.cc +++ b/test/plugins/BadPluginAPIVersionOld.cc @@ -16,6 +16,9 @@ */ #include "ignition/common/PluginMacros.hh" +#include "gz/utils/SuppressWarning.hh" + +IGN_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION extern "C" { std::size_t DETAIL_IGN_PLUGIN_VISIBLE IGNCOMMONPluginInfoSize = @@ -33,3 +36,4 @@ extern "C" std::size_t DETAIL_IGN_PLUGIN_VISIBLE IGNCOMMONMultiPluginInfo( return 0u; } +IGN_UTILS_WARN_RESUME__DEPRECATED_DECLARATION diff --git a/test/plugins/BadPluginAlign.cc b/test/plugins/BadPluginAlign.cc index 2d3607158..78d12a3c4 100644 --- a/test/plugins/BadPluginAlign.cc +++ b/test/plugins/BadPluginAlign.cc @@ -16,6 +16,9 @@ */ #include "ignition/common/PluginMacros.hh" +#include "gz/utils/SuppressWarning.hh" + +IGN_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION extern "C" { std::size_t DETAIL_IGN_PLUGIN_VISIBLE IGNCOMMONPluginInfoSize = @@ -34,3 +37,4 @@ extern "C" std::size_t DETAIL_IGN_PLUGIN_VISIBLE IGNCOMMONMultiPluginInfo( return 0u; } +IGN_UTILS_WARN_RESUME__DEPRECATED_DECLARATION diff --git a/test/plugins/BadPluginSize.cc b/test/plugins/BadPluginSize.cc index 82e5deb54..ede97286f 100644 --- a/test/plugins/BadPluginSize.cc +++ b/test/plugins/BadPluginSize.cc @@ -16,6 +16,9 @@ */ #include "ignition/common/PluginMacros.hh" +#include "gz/utils/SuppressWarning.hh" + +IGN_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION extern "C" { std::size_t DETAIL_IGN_PLUGIN_VISIBLE IGNCOMMONPluginInfoSize = @@ -34,3 +37,4 @@ extern "C" std::size_t DETAIL_IGN_PLUGIN_VISIBLE IGNCOMMONMultiPluginInfo( return 0u; } +IGN_UTILS_WARN_RESUME__DEPRECATED_DECLARATION diff --git a/test/plugins/DummyPlugins.cc b/test/plugins/DummyPlugins.cc index 3f10594df..91c603984 100644 --- a/test/plugins/DummyPlugins.cc +++ b/test/plugins/DummyPlugins.cc @@ -16,8 +16,10 @@ */ #include "ignition/common/PluginMacros.hh" +#include "gz/utils/SuppressWarning.hh" #include "DummyPlugins.hh" +IGN_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION namespace test { @@ -87,3 +89,5 @@ IGN_COMMON_BEGIN_ADDING_PLUGINS IGN_COMMON_ADD_PLUGIN(test::util::DummyMultiPlugin, test::util::DummySetterBase) IGN_COMMON_ADD_PLUGIN(test::util::DummyMultiPlugin, test::util::DummyGetSomeObjectBase) IGN_COMMON_FINISH_ADDING_PLUGINS + +IGN_UTILS_WARN_RESUME__DEPRECATED_DECLARATION diff --git a/test/static_assertions/plugin_bad_const_assignment.cc b/test/static_assertions/plugin_bad_const_assignment.cc index ddab315db..46282a6f1 100644 --- a/test/static_assertions/plugin_bad_const_assignment.cc +++ b/test/static_assertions/plugin_bad_const_assignment.cc @@ -15,6 +15,9 @@ * */ +#include + +IGN_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION #include "ignition/common/PluginPtr.hh" int main() @@ -23,3 +26,4 @@ int main() ignition::common::PluginPtr ptr; ptr = const_ptr; } +IGN_UTILS_WARN_RESUME__DEPRECATED_DECLARATION diff --git a/test/static_assertions/plugin_bad_const_construct.cc b/test/static_assertions/plugin_bad_const_construct.cc index 2d7375234..50757befe 100644 --- a/test/static_assertions/plugin_bad_const_construct.cc +++ b/test/static_assertions/plugin_bad_const_construct.cc @@ -15,9 +15,13 @@ * */ +#include + +IGN_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION #include "ignition/common/PluginPtr.hh" int main() { ignition::common::PluginPtr ptr{ignition::common::ConstPluginPtr()}; } +IGN_UTILS_WARN_RESUME__DEPRECATED_DECLARATION diff --git a/test/static_assertions/plugin_no_base_class.cc b/test/static_assertions/plugin_no_base_class.cc index d1a7622e9..62958c0b5 100644 --- a/test/static_assertions/plugin_no_base_class.cc +++ b/test/static_assertions/plugin_no_base_class.cc @@ -15,6 +15,10 @@ * */ +#include + +IGN_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION + #include "ignition/common/PluginMacros.hh" class A @@ -30,3 +34,4 @@ class NotBase IGN_COMMON_REGISTER_SINGLE_PLUGIN(A, NotBase) +IGN_UTILS_WARN_RESUME__DEPRECATED_DECLARATION diff --git a/test/static_assertions/plugin_not_fully_qualified_base.cc b/test/static_assertions/plugin_not_fully_qualified_base.cc index 2e16293ac..90d402519 100644 --- a/test/static_assertions/plugin_not_fully_qualified_base.cc +++ b/test/static_assertions/plugin_not_fully_qualified_base.cc @@ -15,6 +15,10 @@ * */ +#include + +IGN_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION + #include "ignition/common/PluginMacros.hh" namespace ns @@ -36,3 +40,5 @@ class A : public Base using ns::Base; IGN_COMMON_REGISTER_SINGLE_PLUGIN(ns::A, Base) + +IGN_UTILS_WARN_RESUME__DEPRECATED_DECLARATION diff --git a/test/static_assertions/plugin_not_fully_qualified_class.cc b/test/static_assertions/plugin_not_fully_qualified_class.cc index 7e0d65572..4de493564 100644 --- a/test/static_assertions/plugin_not_fully_qualified_class.cc +++ b/test/static_assertions/plugin_not_fully_qualified_class.cc @@ -15,6 +15,9 @@ * */ +#include + +IGN_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION #include "ignition/common/PluginMacros.hh" namespace ns @@ -36,3 +39,5 @@ class A : public Base using ns::A; IGN_COMMON_REGISTER_SINGLE_PLUGIN(A, ns::Base) + +IGN_UTILS_WARN_RESUME__DEPRECATED_DECLARATION diff --git a/test/static_assertions/plugin_not_global_ns.cc b/test/static_assertions/plugin_not_global_ns.cc index e97ed0738..4250c4055 100644 --- a/test/static_assertions/plugin_not_global_ns.cc +++ b/test/static_assertions/plugin_not_global_ns.cc @@ -14,6 +14,9 @@ * limitations under the License. * */ +#include + +IGN_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION #include "ignition/common/PluginMacros.hh" @@ -34,4 +37,4 @@ class A : public Base IGN_COMMON_REGISTER_SINGLE_PLUGIN(ns::A, ns::Base) } - +IGN_UTILS_WARN_RESUME__DEPRECATED_DECLARATION diff --git a/test/static_assertions/plugin_wrong_base_class.cc b/test/static_assertions/plugin_wrong_base_class.cc index 1134a3641..1816b1b62 100644 --- a/test/static_assertions/plugin_wrong_base_class.cc +++ b/test/static_assertions/plugin_wrong_base_class.cc @@ -15,6 +15,10 @@ * */ +#include + +IGN_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION + #include "ignition/common/PluginMacros.hh" namespace ns @@ -41,3 +45,4 @@ class A : public Base IGN_COMMON_REGISTER_SINGLE_PLUGIN(ns::A, ns::WrongBase) +IGN_UTILS_WARN_RESUME__DEPRECATED_DECLARATION