Skip to content

Commit

Permalink
Add redirection headers
Browse files Browse the repository at this point in the history
Signed-off-by: methylDragon <[email protected]>
  • Loading branch information
methylDragon committed Aug 19, 2022
1 parent 2b2f419 commit 1712cf5
Show file tree
Hide file tree
Showing 85 changed files with 684 additions and 324 deletions.
6 changes: 4 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ set(IGN_CMAKE_VER ${ignition-cmake2_VERSION_MAJOR})
#============================================================================
# Configure the project
#============================================================================
ign_configure_project(VERSION_SUFFIX)
ign_configure_project(
REPLACE_IGNITION_INCLUDE_PATH gz/plugin
VERSION_SUFFIX pre1
)

#============================================================================
# Set project-specific options
Expand Down Expand Up @@ -71,4 +74,3 @@ ign_create_docs(
API_MAINPAGE_MD "${CMAKE_BINARY_DIR}/api.md"
TUTORIALS_MAINPAGE_MD "${CMAKE_BINARY_DIR}/tutorials.md"
)

13 changes: 6 additions & 7 deletions MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ target_link_libraries(my_target PUBLIC ignition-plugin1::core)

However, if your code wants to be able to load plugins, it should link to the
`loader` component. In most cases, it should probably link privately, unless you
need the `ignition::plugin::Loader` class to be part of your library's API:
need the `gz::plugin::Loader` class to be part of your library's API:

```
target_link_libraries(my_target PRIVATE ignition-plugin1::loader)
```

If `ignition::plugin::PluginPtr` objects are part of your library's API, then
If `gz::plugin::PluginPtr` objects are part of your library's API, then
you may want `loader` to be private while `core` is public:

```
Expand Down Expand Up @@ -77,15 +77,15 @@ you choose exactly one.

# Loading a library

The `ignition::common::SystemPaths` class was not ported into `ign-plugin`
The `gz::common::SystemPaths` class was not ported into `ign-plugin`
because it is more related to filesystem utilities than to plugins. If you are
currently using `ignition::common::SystemPaths` to help with loading plugins,
currently using `gz::common::SystemPaths` to help with loading plugins,
then you should continue to use it. It does not have a replacement in `ign-plugin`.

Here is a list of things that you *should* replace:

* `#include <ignition/common/PluginLoader.hh>` should be replaced with `#include <ignition/plugin/Loader.hh>`
* `ignition::common::PluginLoader` should be replaced with `ignition::plugin::Loader`
* `#include <gz/common/PluginLoader.hh>` should be replaced with `#include <ignition/plugin/Loader.hh>`
* `gz::common::PluginLoader` should be replaced with `gz::plugin::Loader`
* When calling `Loader::Instantiate("....")` do **NOT** prefix the class name with `::`. E.g. `"::some_namespace::MyClass"` should now be `"some_namespace::MyClass"`.


Expand Down Expand Up @@ -164,4 +164,3 @@ In general, plugin names that get passed to a `Loader` should not be hard-coded.
They should be selected by either inspecting what interfaces they provide, or by
having a user specify the plugin name. This rule of thumb applies to both
template-based classes and to regular classes.

3 changes: 1 addition & 2 deletions core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@ ign_build_tests(
TYPE UNIT
SOURCES ${tests})


add_subdirectory(include/ignition/plugin)
add_subdirectory(include)
2 changes: 2 additions & 0 deletions core/include/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
add_subdirectory(gz/plugin)
install(DIRECTORY ignition DESTINATION ${IGN_INCLUDE_INSTALL_DIR_FULL})
6 changes: 3 additions & 3 deletions core/include/gz/plugin/EnablePluginFromThis.hh
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
*
*/

#ifndef IGNITION_PLUGIN_ENABLEPLUGINFROMTHIS_HH_
#define IGNITION_PLUGIN_ENABLEPLUGINFROMTHIS_HH_
#ifndef GZ_PLUGIN_ENABLEPLUGINFROMTHIS_HH_
#define GZ_PLUGIN_ENABLEPLUGINFROMTHIS_HH_

#include <memory>

#include <ignition/plugin/PluginPtr.hh>

namespace ignition
namespace gz
{
namespace plugin
{
Expand Down
8 changes: 4 additions & 4 deletions core/include/gz/plugin/Factory.hh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
*
*/

#ifndef IGNITION_PLUGIN_FACTORY_HH_
#define IGNITION_PLUGIN_FACTORY_HH_
#ifndef GZ_PLUGIN_FACTORY_HH_
#define GZ_PLUGIN_FACTORY_HH_

#include <chrono>
#include <functional>
Expand All @@ -25,7 +25,7 @@

#include <ignition/plugin/EnablePluginFromThis.hh>

namespace ignition
namespace gz
{
namespace plugin
{
Expand Down Expand Up @@ -143,6 +143,6 @@ namespace ignition
}
}

#include <ignition/plugin/detail/Factory.hh>
#include <gz/plugin/detail/Factory.hh>

#endif
6 changes: 3 additions & 3 deletions core/include/gz/plugin/Info.hh
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
*/


#ifndef IGNITION_PLUGIN_INFO_HH_
#define IGNITION_PLUGIN_INFO_HH_
#ifndef GZ_PLUGIN_INFO_HH_
#define GZ_PLUGIN_INFO_HH_

#include <functional>
#include <memory>
Expand All @@ -29,7 +29,7 @@

#include <ignition/plugin/Export.hh>

namespace ignition
namespace gz
{
namespace plugin
{
Expand Down
8 changes: 4 additions & 4 deletions core/include/gz/plugin/Plugin.hh
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
*/


#ifndef IGNITION_PLUGIN_PLUGIN_HH_
#define IGNITION_PLUGIN_PLUGIN_HH_
#ifndef GZ_PLUGIN_PLUGIN_HH_
#define GZ_PLUGIN_PLUGIN_HH_

#include <memory>
#include <map>
Expand All @@ -28,7 +28,7 @@
#include <ignition/plugin/Export.hh>
#include <ignition/plugin/Info.hh>

namespace ignition
namespace gz
{
namespace plugin
{
Expand Down Expand Up @@ -215,6 +215,6 @@ namespace ignition
}
}

#include "ignition/plugin/detail/Plugin.hh"
#include "gz/plugin/detail/Plugin.hh"

#endif
10 changes: 5 additions & 5 deletions core/include/gz/plugin/PluginPtr.hh
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,24 @@
*/


#ifndef IGNITION_PLUGIN_PLUGINPTR_HH_
#define IGNITION_PLUGIN_PLUGINPTR_HH_
#ifndef GZ_PLUGIN_PLUGINPTR_HH_
#define GZ_PLUGIN_PLUGINPTR_HH_

#include <map>
#include <string>
#include <memory>

#include <ignition/plugin/Plugin.hh>

namespace ignition
namespace gz
{
namespace plugin
{
// Forward declarations
namespace detail { template<class, class> class ComposePlugin; }

/// \brief This class manages the lifecycle of a plugin instance. It can
/// receive a plugin instance from the ignition::plugin::Loader class
/// receive a plugin instance from the gz::plugin::Loader class
/// or by copy-construction or assignment from another PluginPtr instance.
///
/// This class behaves similarly to a std::shared_ptr where multiple
Expand Down Expand Up @@ -218,6 +218,6 @@ namespace ignition
}
}

#include "ignition/plugin/detail/PluginPtr.hh"
#include "gz/plugin/detail/PluginPtr.hh"

#endif
8 changes: 4 additions & 4 deletions core/include/gz/plugin/SpecializedPlugin.hh
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
*/


#ifndef IGNITION_PLUGIN_SPECIALIZEDPLUGIN_HH_
#define IGNITION_PLUGIN_SPECIALIZEDPLUGIN_HH_
#ifndef GZ_PLUGIN_SPECIALIZEDPLUGIN_HH_
#define GZ_PLUGIN_SPECIALIZEDPLUGIN_HH_

#include <memory>
#include "ignition/plugin/Plugin.hh"

namespace ignition
namespace gz
{
namespace plugin
{
Expand Down Expand Up @@ -160,6 +160,6 @@ namespace ignition
}
}

#include "ignition/plugin/detail/SpecializedPlugin.hh"
#include "gz/plugin/detail/SpecializedPlugin.hh"

#endif
6 changes: 3 additions & 3 deletions core/include/gz/plugin/SpecializedPluginPtr.hh
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
*/


#ifndef IGNITION_PLUGIN_SPECIALIZEDPLUGINPTR_HH_
#define IGNITION_PLUGIN_SPECIALIZEDPLUGINPTR_HH_
#ifndef GZ_PLUGIN_SPECIALIZEDPLUGINPTR_HH_
#define GZ_PLUGIN_SPECIALIZEDPLUGINPTR_HH_

#include "ignition/plugin/PluginPtr.hh"
#include "ignition/plugin/SpecializedPlugin.hh"

namespace ignition
namespace gz
{
namespace plugin
{
Expand Down
6 changes: 3 additions & 3 deletions core/include/gz/plugin/WeakPluginPtr.hh
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
*
*/

#ifndef IGNITION_PLUGIN_WEAKPLUGINPTR_HH_
#define IGNITION_PLUGIN_WEAKPLUGINPTR_HH_
#ifndef GZ_PLUGIN_WEAKPLUGINPTR_HH_
#define GZ_PLUGIN_WEAKPLUGINPTR_HH_

#include <memory>

#include <ignition/plugin/PluginPtr.hh>

namespace ignition
namespace gz
{
namespace plugin
{
Expand Down
4 changes: 2 additions & 2 deletions core/include/gz/plugin/config.hh.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* Config.hh. Generated by CMake for @PROJECT_NAME_NO_VERSION@. */

#ifndef IGNITION_PLUGIN_CONFIG_HH_
#define IGNITION_PLUGIN_CONFIG_HH_
#ifndef GZ_PLUGIN_CONFIG_HH_
#define GZ_PLUGIN_CONFIG_HH_

/* Version number */
#define IGNITION_PLUGIN_MAJOR_VERSION ${PROJECT_VERSION_MAJOR}
Expand Down
10 changes: 5 additions & 5 deletions core/include/gz/plugin/detail/Factory.hh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
*
*/

#ifndef IGNITION_PLUGIN_DETAIL_FACTORY_HH_
#define IGNITION_PLUGIN_DETAIL_FACTORY_HH_
#ifndef GZ_PLUGIN_DETAIL_FACTORY_HH_
#define GZ_PLUGIN_DETAIL_FACTORY_HH_

#include <memory>
#include <utility>
Expand All @@ -25,7 +25,7 @@

#include <ignition/plugin/Factory.hh>

namespace ignition
namespace gz
{
namespace plugin
{
Expand All @@ -50,8 +50,8 @@ namespace ignition
public: virtual ~FactoryCounter();

// friendship declaration
template <typename, typename...> friend class ignition::plugin::Factory;
template <typename> friend class ignition::plugin::ProductDeleter;
template <typename, typename...> friend class gz::plugin::Factory;
template <typename> friend class gz::plugin::ProductDeleter;
};
}

Expand Down
6 changes: 3 additions & 3 deletions core/include/gz/plugin/detail/Plugin.hh
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
*/


#ifndef IGNITION_PLUGIN_DETAIL_PLUGIN_HH_
#define IGNITION_PLUGIN_DETAIL_PLUGIN_HH_
#ifndef GZ_PLUGIN_DETAIL_PLUGIN_HH_
#define GZ_PLUGIN_DETAIL_PLUGIN_HH_

#include <memory>
#include <string>
#include <ignition/plugin/Plugin.hh>

namespace ignition
namespace gz
{
namespace plugin
{
Expand Down
10 changes: 5 additions & 5 deletions core/include/gz/plugin/detail/PluginPtr.hh
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
*/


#ifndef IGNITION_PLUGIN_DETAIL_PLUGINPTR_HH_
#define IGNITION_PLUGIN_DETAIL_PLUGINPTR_HH_
#ifndef GZ_PLUGIN_DETAIL_PLUGINPTR_HH_
#define GZ_PLUGIN_DETAIL_PLUGINPTR_HH_

#include <memory>
#include <utility>
#include <ignition/plugin/PluginPtr.hh>
#include <ignition/plugin/utility.hh>

namespace ignition
namespace gz
{
namespace plugin
{
Expand Down Expand Up @@ -187,10 +187,10 @@ namespace std
/// so that it can easily be used in STL objects like std::unordered_set and
/// std::unordered_map
template <typename PluginType>
struct hash<ignition::plugin::TemplatePluginPtr<PluginType>>
struct hash<gz::plugin::TemplatePluginPtr<PluginType>>
{
size_t operator()(
const ignition::plugin::TemplatePluginPtr<PluginType> &ptr) const
const gz::plugin::TemplatePluginPtr<PluginType> &ptr) const
{
return ptr.Hash();
}
Expand Down
10 changes: 5 additions & 5 deletions core/include/gz/plugin/detail/SpecializedPlugin.hh
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
*/


#ifndef IGNITION_PLUGIN_DETAIL_SPECIALIZEDPLUGIN_HH_
#define IGNITION_PLUGIN_DETAIL_SPECIALIZEDPLUGIN_HH_
#ifndef GZ_PLUGIN_DETAIL_SPECIALIZEDPLUGIN_HH_
#define GZ_PLUGIN_DETAIL_SPECIALIZEDPLUGIN_HH_

#include <memory>
#include "ignition/plugin/SpecializedPlugin.hh"
Expand All @@ -30,7 +30,7 @@ bool usedSpecializedInterfaceAccess;
#endif


namespace ignition
namespace gz
{
namespace plugin
{
Expand Down Expand Up @@ -250,7 +250,7 @@ namespace ignition
bool, HasInterface, () const, const Specializer, ())

// Declare friendship
template <class...> friend class ignition::plugin::SpecializedPlugin;
template <class...> friend class gz::plugin::SpecializedPlugin;
template <class> friend class SelectSpecializers;
template <class, class> friend class ComposePlugin;

Expand All @@ -271,7 +271,7 @@ namespace ignition
using Specialization = ComposePlugin<Base1, Base2>;

// Declare friendship
template <class...> friend class ignition::plugin::SpecializedPlugin;
template <class...> friend class gz::plugin::SpecializedPlugin;
template <class> friend class SelectSpecializers;
template <class, class> friend class ComposePlugin;

Expand Down
Loading

0 comments on commit 1712cf5

Please sign in to comment.