Skip to content

Commit

Permalink
Leave ignition as primary in headers to fix ABI
Browse files Browse the repository at this point in the history
Signed-off-by: methylDragon <[email protected]>
  • Loading branch information
methylDragon committed Aug 30, 2022
1 parent 4a53b07 commit 507e2cb
Show file tree
Hide file tree
Showing 58 changed files with 260 additions and 261 deletions.
10 changes: 5 additions & 5 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 `gz::plugin::Loader` class to be part of your library's API:
need the `ignition::plugin::Loader` class to be part of your library's API:

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

If `gz::plugin::PluginPtr` objects are part of your library's API, then
If `ignition::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 `gz::common::SystemPaths` class was not ported into `ign-plugin`
The `ignition::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 `gz::common::SystemPaths` to help with loading plugins,
currently using `ignition::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 <gz/common/PluginLoader.hh>` should be replaced with `#include <gz/plugin/Loader.hh>`
* `gz::common::PluginLoader` should be replaced with `gz::plugin::Loader`
* `ignition::common::PluginLoader` should be replaced with `ignition::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
2 changes: 1 addition & 1 deletion core/include/gz/plugin/EnablePluginFromThis.hh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#include <gz/plugin/PluginPtr.hh>

namespace gz
namespace ignition
{
namespace plugin
{
Expand Down
2 changes: 1 addition & 1 deletion core/include/gz/plugin/Factory.hh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

#include <gz/plugin/EnablePluginFromThis.hh>

namespace gz
namespace ignition
{
namespace plugin
{
Expand Down
2 changes: 1 addition & 1 deletion core/include/gz/plugin/Info.hh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

#include <gz/plugin/Export.hh>

namespace gz
namespace ignition
{
namespace plugin
{
Expand Down
2 changes: 1 addition & 1 deletion core/include/gz/plugin/Plugin.hh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <gz/plugin/Export.hh>
#include <gz/plugin/Info.hh>

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

#include <gz/plugin/Plugin.hh>

namespace gz
namespace ignition
{
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 gz::plugin::Loader class
/// receive a plugin instance from the ignition::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
2 changes: 1 addition & 1 deletion core/include/gz/plugin/SpecializedPlugin.hh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include <memory>
#include "gz/plugin/Plugin.hh"

namespace gz
namespace ignition
{
namespace plugin
{
Expand Down
2 changes: 1 addition & 1 deletion core/include/gz/plugin/SpecializedPluginPtr.hh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include "gz/plugin/PluginPtr.hh"
#include "gz/plugin/SpecializedPlugin.hh"

namespace gz
namespace ignition
{
namespace plugin
{
Expand Down
2 changes: 1 addition & 1 deletion core/include/gz/plugin/WeakPluginPtr.hh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#include <gz/plugin/PluginPtr.hh>

namespace gz
namespace ignition
{
namespace plugin
{
Expand Down
9 changes: 9 additions & 0 deletions core/include/gz/plugin/config.hh.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,13 @@

#define IGNITION_PLUGIN_VERSION_HEADER "Ignition Plugin, version ${PROJECT_VERSION_FULL}\nCopyright (C) 2017 Open Source Robotics Foundation.\nReleased under the Apache 2.0 License.\n\n"

namespace ignition
{
}

namespace gz
{
using namespace ignition;
}

#endif
6 changes: 3 additions & 3 deletions core/include/gz/plugin/detail/Factory.hh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

#include <gz/plugin/Factory.hh>

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

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

Expand Down
2 changes: 1 addition & 1 deletion core/include/gz/plugin/detail/Plugin.hh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <string>
#include <gz/plugin/Plugin.hh>

namespace gz
namespace ignition
{
namespace plugin
{
Expand Down
6 changes: 3 additions & 3 deletions core/include/gz/plugin/detail/PluginPtr.hh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <gz/plugin/PluginPtr.hh>
#include <gz/plugin/utility.hh>

namespace gz
namespace ignition
{
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<gz::plugin::TemplatePluginPtr<PluginType>>
struct hash<ignition::plugin::TemplatePluginPtr<PluginType>>
{
size_t operator()(
const gz::plugin::TemplatePluginPtr<PluginType> &ptr) const
const ignition::plugin::TemplatePluginPtr<PluginType> &ptr) const
{
return ptr.Hash();
}
Expand Down
6 changes: 3 additions & 3 deletions core/include/gz/plugin/detail/SpecializedPlugin.hh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ bool usedSpecializedInterfaceAccess;
#endif


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

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

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

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

Expand Down
2 changes: 1 addition & 1 deletion core/include/gz/plugin/detail/utility.hh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#include <type_traits>

namespace gz
namespace ignition
{
namespace plugin
{
Expand Down
2 changes: 1 addition & 1 deletion core/include/gz/plugin/utility.hh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <gz/plugin/detail/utility.hh>
#include <gz/plugin/Export.hh>

namespace gz
namespace ignition
{
namespace plugin
{
Expand Down
10 changes: 0 additions & 10 deletions core/include/ignition/plugin/config.hh
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,4 @@

// #define IGNITION_PLUGIN_VERSION_HEADER GZ_PLUGIN_VERSION_HEADER

namespace gz
{
}

namespace ignition
{
using namespace gz;
}


#endif
2 changes: 1 addition & 1 deletion core/src/EnablePluginFromThis.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <gz/plugin/EnablePluginFromThis.hh>
#include <gz/plugin/WeakPluginPtr.hh>

namespace gz
namespace ignition
{
namespace plugin
{
Expand Down
2 changes: 1 addition & 1 deletion core/src/Factory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ namespace
static LostProductManager lostProductManager;
} // namespace

namespace gz
namespace ignition
{
namespace plugin
{
Expand Down
6 changes: 3 additions & 3 deletions core/src/Factory_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ struct SomeDerived : public SomeBase
}
};

using NoArgFactory = gz::plugin::Factory<SomeBase>;
using NoArgFactory = ignition::plugin::Factory<SomeBase>;
using NoArgProducer = NoArgFactory::Producing<SomeDerived>;

using DoubleIntFactory = gz::plugin::Factory<SomeBase, double, int>;
using DoubleIntFactory = ignition::plugin::Factory<SomeBase, double, int>;
using DoubleIntProducer = DoubleIntFactory::Producing<SomeDerived>;

using VectorFactory = gz::plugin::Factory<
using VectorFactory = ignition::plugin::Factory<
SomeBase, const std::vector<double>&>;
using VectorProducer = VectorFactory::Producing<SomeDerived>;

Expand Down
2 changes: 1 addition & 1 deletion core/src/Info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#include <gz/plugin/Info.hh>

namespace gz
namespace ignition
{
namespace plugin
{
Expand Down
2 changes: 1 addition & 1 deletion core/src/Info_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ struct SomePlugin : public SomeInterface

TEST(Info, Clear)
{
gz::plugin::Info info;
ignition::plugin::Info info;
info.name = typeid(SomePlugin).name();

info.factory = [=]()
Expand Down
2 changes: 1 addition & 1 deletion core/src/Plugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include "gz/plugin/Plugin.hh"
#include "gz/plugin/Info.hh"

namespace gz
namespace ignition
{
namespace plugin
{
Expand Down
2 changes: 1 addition & 1 deletion core/src/WeakPluginPtr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#include <gz/plugin/WeakPluginPtr.hh>

namespace gz
namespace ignition
{
namespace plugin
{
Expand Down
2 changes: 1 addition & 1 deletion core/src/utility.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

#include <gz/plugin/utility.hh>

namespace gz
namespace ignition
{
namespace plugin
{
Expand Down
2 changes: 1 addition & 1 deletion core/src/utility_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#include <gz/plugin/utility.hh>

using namespace gz::plugin;
using namespace ignition::plugin;

struct SomeType { };

Expand Down
Loading

0 comments on commit 507e2cb

Please sign in to comment.