From 6d519a1a2f9ce2b0a8a390a09f3c66118ccf5946 Mon Sep 17 00:00:00 2001 From: methylDragon Date: Mon, 6 Jun 2022 14:48:19 -0700 Subject: [PATCH] Migrate macros Signed-off-by: methylDragon --- Migration.md | 29 ++++++++--- av/include/gz/common/AudioDecoder.hh | 2 +- av/include/gz/common/HWEncoder.hh | 2 +- av/include/gz/common/HWVideo.hh | 2 +- av/include/gz/common/Video.hh | 2 +- av/include/gz/common/VideoEncoder.hh | 2 +- av/src/AudioDecoder_TEST.cc | 2 +- events/include/gz/common/KeyEvent.hh | 4 +- events/include/gz/common/MouseEvent.hh | 4 +- events/src/Event.cc | 4 +- events/src/Event_TEST.cc | 2 +- examples/CMakeLists.txt | 2 +- examples/profiler.cc | 50 +++++++++---------- .../include/gz/common/geospatial/Dem.hh | 2 +- graphics/include/gz/common/Animation.hh | 8 +-- graphics/include/gz/common/ColladaExporter.hh | 2 +- graphics/include/gz/common/ColladaLoader.hh | 2 +- graphics/include/gz/common/Image.hh | 2 +- graphics/include/gz/common/KeyFrame.hh | 6 +-- graphics/include/gz/common/Material.hh | 2 +- graphics/include/gz/common/Mesh.hh | 2 +- graphics/include/gz/common/MeshManager.hh | 4 +- graphics/include/gz/common/NodeAnimation.hh | 2 +- graphics/include/gz/common/NodeTransform.hh | 2 +- graphics/include/gz/common/OBJLoader.hh | 2 +- graphics/include/gz/common/Pbr.hh | 2 +- graphics/include/gz/common/STLLoader.hh | 2 +- graphics/include/gz/common/SVGLoader.hh | 2 +- graphics/include/gz/common/Skeleton.hh | 2 +- .../include/gz/common/SkeletonAnimation.hh | 2 +- graphics/include/gz/common/SkeletonNode.hh | 2 +- graphics/include/gz/common/SubMesh.hh | 2 +- graphics/src/BVHLoader.cc | 6 +-- graphics/src/ColladaExporter.cc | 2 +- graphics/src/ColladaLoader.cc | 4 +- graphics/src/Material.cc | 4 +- graphics/src/MeshManager.cc | 36 ++++++------- graphics/src/NodeTransform.cc | 2 +- graphics/src/OBJLoader.cc | 2 +- graphics/src/SVGLoader.cc | 14 +++--- graphics/src/SubMesh.cc | 4 +- graphics/src/SubMesh_TEST.cc | 12 ++--- graphics/src/tiny_obj_loader.h | 4 +- include/gz/common/Battery.hh | 2 +- include/gz/common/Console.hh | 12 ++--- include/gz/common/EnumIface.hh | 2 +- include/gz/common/Filesystem.hh | 2 +- include/gz/common/SuppressWarning.hh | 8 +-- include/gz/common/SystemPaths.hh | 2 +- include/gz/common/TempDirectory.hh | 2 +- include/gz/common/Timer.hh | 2 +- include/gz/common/URI.hh | 10 ++-- include/gz/common/Util.hh | 34 ++++++------- include/gz/common/WorkerPool.hh | 2 +- include/ignition/common/EnumIface.hh | 3 ++ include/ignition/common/Plugin.hh | 4 +- include/ignition/common/PluginLoader.hh | 4 +- include/ignition/common/Util.hh | 21 ++++++++ .../ignition/common/detail/PluginMacros.hh | 4 +- .../common/detail/SpecializedPlugin.hh | 8 +-- profiler/BUILD.bazel | 8 +-- profiler/include/gz/common/Profiler.hh | 48 +++++++++--------- profiler/include/ignition/common/Profiler.hh | 11 ++++ profiler/src/CMakeLists.txt | 22 ++++---- profiler/src/Profiler.cc | 8 +-- profiler/src/Profiler_Disabled_TEST.cc | 4 +- profiler/src/Profiler_Remotery_TEST.cc | 4 +- profiler/src/Remotery/ign_remotery_vis.in | 4 +- src/Console.cc | 2 +- src/Console_TEST.cc | 14 +++--- src/EnumIface_TEST.cc | 2 +- src/Filesystem_TEST.cc | 2 +- src/MaterialDensity.cc | 2 +- src/Plugin.cc | 4 +- src/PluginLoader.cc | 4 +- src/PluginLoader_TEST.cc | 4 +- src/PluginUtils_TEST.cc | 4 +- src/SystemPaths.cc | 2 +- src/Util.cc | 6 +-- src/WorkerPool_TEST.cc | 4 +- test/integration/console.cc | 4 +- test/integration/plugin.cc | 16 +++--- test/performance/plugin_specialization.cc | 46 ++++++++--------- test/plugins/BadPluginAPIVersionNew.cc | 4 +- test/plugins/BadPluginAPIVersionOld.cc | 4 +- test/plugins/BadPluginAlign.cc | 4 +- test/plugins/BadPluginSize.cc | 4 +- test/plugins/CMakeLists.txt | 8 +-- test/plugins/DummyPlugins.cc | 4 +- .../plugin_bad_const_assignment.cc | 4 +- .../plugin_bad_const_construct.cc | 4 +- .../static_assertions/plugin_no_base_class.cc | 4 +- .../plugin_not_fully_qualified_base.cc | 4 +- .../plugin_not_fully_qualified_class.cc | 4 +- .../static_assertions/plugin_not_global_ns.cc | 4 +- .../plugin_wrong_base_class.cc | 4 +- .../gz/common/testing/AutoLogFixture.hh | 2 +- .../common/testing/detail/AutoLogFixture.hh | 4 +- tutorials/profiler.md | 24 ++++----- 99 files changed, 364 insertions(+), 316 deletions(-) diff --git a/Migration.md b/Migration.md index 0e4b7b601..b8ea43c9d 100644 --- a/Migration.md +++ b/Migration.md @@ -18,18 +18,31 @@ release will remove the deprecated code. 4. The logging macros (`ignmsg`, `ignwarn`, `ignerr`, etc.) and logging function macros (`ignLogInit()`, etc.) are deprecated and will be removed in future versions. Use `gz` instead (e.g. `gzmsg`, `gzwarn`, `gzLogInit()`) - 5. 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). - 6. The following `IGN_` prefixed environment variables are deprecated and will be removed. Please use the `GZ_` prefixed versions instead! 1. `IGN_VIDEO_ALLOWED_ENCODERS` -> `GZ_VIDEO_ALLOWED_ENCODERS` - 2. `IGN_VIDEO_ENCODER_DEVICE` -> `GZ_VIDEO_ENCODER_DEVICE` - 3. `IGN_VIDEO_USE_HW_SURFACE` -> `GZ_VIDEO_USE_HW_SURFACE` - 4. `IGN_FILE_PATH` -> `GZ_FILE_PATH` - 5. `IGN_LOG_PATH` -> `GZ_LOG_PATH` - 6. `IGN_PLUGIN_PATH` -> `GZ_PLUGIN_PATH` + 2. `IGN_VIDEO_ENCODER_DEVICE` -> `GZ_VIDEO_ENCODER_DEVICE` + 3. `IGN_VIDEO_USE_HW_SURFACE` -> `GZ_VIDEO_USE_HW_SURFACE` + 4. `IGN_FILE_PATH` -> `GZ_FILE_PATH` + 5. `IGN_LOG_PATH` -> `GZ_LOG_PATH` + 6. `IGN_PLUGIN_PATH` -> `GZ_PLUGIN_PATH` +7. The following `IGN_` / `IGNITION_` prefixed macros are deprecated and will be removed in future versions. + Use the `GZ_` prefix instead. + 1. `IGN_ENUM` + 2. `IGN_HOMEDIR` + 3. `IGN_NANO_TO_SEC`, `IGN_SEC_TO_NANO`, `IGN_MS_TO_NANO`, `IGN_US_TO_NANO` + 4. `IGN_SPEED_OF_LIGHT` + 5. `IGN_SLEEP_S`, `IGN_SLEEP_US`, `IGN_SLEEP_MS`, `IGN_SLEEP_NS` + 6. `IGN_SYSTEM_TIME`, `IGN_SYSTEM_TIME_S`, `IGN_SYSTEM_TIME_US`, `IGN_SYSTEM_TIME_MS`, `IGN_SYSTEM_TIME_NS` + 7. `IGN_ASSERT` + 8. `IGNITION_COMMON_TINYOBJLOADER_IMPLEMENTATION` (`src` local, hard-tocked) + 9. `IGN_PROFILER_ENABLE`, `IGN_PROFILE_THREAD_NAME`, `IGN_PROFILE_LOG_TEXT`, `IGN_PROFILE_BEGIN`, `IGN_PROFILE_END`, `IGN_PROFILE_L`, `IGN_PROFILE`, `IGN_PROFILE_VALID` + 10. `IGN_CREATE_SPEC_INTERFACE` + 11. `IGN_DUMMY_PLUGIN_PATH` + 12. `IGNITION_UNITTEST_SPECIALIZED_PLUGIN_ACCESS` + ### Additions @@ -90,7 +103,7 @@ release will remove the deprecated code. 1. Requires c++17. -1. (New in 3.8.0) On Windows, the value of C++ macro `IGN_HOMEDIR` changed from `HOMEPATH` to `USERPROFILE`. It is usually used to read the path to the user's home from environment. The old value pointed to a path relative to the (a) current drive letter as reported by `pwd`, not the system drive letter. The new value correctly points to an environment variable that contains the full absolute path to the user's profile. If the code did not use the macro in some unexpected way, the new behavior should work either the same or even better (it would work even when the current directory is on a non-system drive). If the code relied on this value to be relative to the current drive letter, it needs to be changed to use `HOMEPATH` directly. +1. (New in 3.8.0) On Windows, the value of C++ macro `GZ_HOMEDIR` changed from `HOMEPATH` to `USERPROFILE`. It is usually used to read the path to the user's home from environment. The old value pointed to a path relative to the (a) current drive letter as reported by `pwd`, not the system drive letter. The new value correctly points to an environment variable that contains the full absolute path to the user's profile. If the code did not use the macro in some unexpected way, the new behavior should work either the same or even better (it would work even when the current directory is on a non-system drive). If the code relied on this value to be relative to the current drive letter, it needs to be changed to use `HOMEPATH` directly. ## Gazebo Common 1.X to 2.X diff --git a/av/include/gz/common/AudioDecoder.hh b/av/include/gz/common/AudioDecoder.hh index 2bd9abd9d..4ed9d197c 100644 --- a/av/include/gz/common/AudioDecoder.hh +++ b/av/include/gz/common/AudioDecoder.hh @@ -57,7 +57,7 @@ namespace gz public: int SampleRate(); /// \brief Private data pointer - IGN_UTILS_UNIQUE_IMPL_PTR(dataPtr) + GZ_UTILS_UNIQUE_IMPL_PTR(dataPtr) }; } } diff --git a/av/include/gz/common/HWEncoder.hh b/av/include/gz/common/HWEncoder.hh index 742e8e18a..4c56a5514 100644 --- a/av/include/gz/common/HWEncoder.hh +++ b/av/include/gz/common/HWEncoder.hh @@ -79,7 +79,7 @@ namespace gz::common public: HWEncoderType GetEncoderType() const; /// \brief Private data pointer - IGN_UTILS_UNIQUE_IMPL_PTR(dataPtr) + GZ_UTILS_UNIQUE_IMPL_PTR(dataPtr) }; } diff --git a/av/include/gz/common/HWVideo.hh b/av/include/gz/common/HWVideo.hh index feb8d61c8..e152a95b9 100644 --- a/av/include/gz/common/HWVideo.hh +++ b/av/include/gz/common/HWVideo.hh @@ -37,7 +37,7 @@ namespace gz::common _ // For FlagSet to work. }; - IGN_ENUM(HWEncoderTypeParser, HWEncoderType, + GZ_ENUM(HWEncoderTypeParser, HWEncoderType, HWEncoderType::NONE, HWEncoderType::_, "NONE", "NVENC", diff --git a/av/include/gz/common/Video.hh b/av/include/gz/common/Video.hh index 28cf50033..d4f975d15 100644 --- a/av/include/gz/common/Video.hh +++ b/av/include/gz/common/Video.hh @@ -73,7 +73,7 @@ namespace gz private: void Cleanup(); /// \brief Private data pointer - IGN_UTILS_UNIQUE_IMPL_PTR(dataPtr) + GZ_UTILS_UNIQUE_IMPL_PTR(dataPtr) }; } } diff --git a/av/include/gz/common/VideoEncoder.hh b/av/include/gz/common/VideoEncoder.hh index 4b6f4a8bf..733cd0988 100644 --- a/av/include/gz/common/VideoEncoder.hh +++ b/av/include/gz/common/VideoEncoder.hh @@ -218,7 +218,7 @@ namespace gz public: void Reset(); /// \brief Private data pointer - IGN_UTILS_UNIQUE_IMPL_PTR(dataPtr) + GZ_UTILS_UNIQUE_IMPL_PTR(dataPtr) }; } } diff --git a/av/src/AudioDecoder_TEST.cc b/av/src/AudioDecoder_TEST.cc index c63eb48a1..6809e94bb 100644 --- a/av/src/AudioDecoder_TEST.cc +++ b/av/src/AudioDecoder_TEST.cc @@ -84,7 +84,7 @@ TEST(AudioDecoder, NoCodec) } ///////////////////////////////////////////////// -TEST(AudioDecoder, IGN_UTILS_TEST_DISABLED_ON_WIN32(CheerFile)) +TEST(AudioDecoder, GZ_UTILS_TEST_DISABLED_ON_WIN32(CheerFile)) { common::AudioDecoder audio; diff --git a/events/include/gz/common/KeyEvent.hh b/events/include/gz/common/KeyEvent.hh index 5b3c1f757..b9e50fae2 100644 --- a/events/include/gz/common/KeyEvent.hh +++ b/events/include/gz/common/KeyEvent.hh @@ -110,10 +110,10 @@ namespace gz /// \return this public: KeyEvent& operator=(KeyEvent&& other); - IGN_UTILS_WARN_IGNORE__DLL_INTERFACE_MISSING + GZ_UTILS_WARN_IGNORE__DLL_INTERFACE_MISSING /// \brief Private data pointer private: std::unique_ptr dataPtr; - IGN_UTILS_WARN_RESUME__DLL_INTERFACE_MISSING + GZ_UTILS_WARN_RESUME__DLL_INTERFACE_MISSING }; } } diff --git a/events/include/gz/common/MouseEvent.hh b/events/include/gz/common/MouseEvent.hh index 8c73206ad..766a606f2 100644 --- a/events/include/gz/common/MouseEvent.hh +++ b/events/include/gz/common/MouseEvent.hh @@ -203,11 +203,11 @@ namespace gz /// \return this public: MouseEvent &operator=(const MouseEvent &_other); - IGN_UTILS_WARN_IGNORE__DLL_INTERFACE_MISSING + GZ_UTILS_WARN_IGNORE__DLL_INTERFACE_MISSING /// \internal /// \brief Private data pointer private: std::unique_ptr dataPtr; - IGN_UTILS_WARN_RESUME__DLL_INTERFACE_MISSING + GZ_UTILS_WARN_RESUME__DLL_INTERFACE_MISSING }; } } diff --git a/events/src/Event.cc b/events/src/Event.cc index a0e3cc61d..b8bcb32fd 100644 --- a/events/src/Event.cc +++ b/events/src/Event.cc @@ -48,13 +48,13 @@ void Event::SetSignaled(bool _sig) Connection::Connection(Event *_e, int _i) : event(_e), id(_i) { - this->creationTime = IGN_SYSTEM_TIME(); + this->creationTime = GZ_SYSTEM_TIME(); } ////////////////////////////////////////////////// Connection::~Connection() { - auto diffTime = IGN_SYSTEM_TIME() - this->creationTime; + auto diffTime = GZ_SYSTEM_TIME() - this->creationTime; if ((this->event && !this->event->Signaled()) && diffTime < std::chrono::nanoseconds(10000)) { diff --git a/events/src/Event_TEST.cc b/events/src/Event_TEST.cc index cf4db4172..9db2bc1ce 100644 --- a/events/src/Event_TEST.cc +++ b/events/src/Event_TEST.cc @@ -292,7 +292,7 @@ TEST_F(EventTest, DestructionOrder) evt->Signal(); evt.reset(); // Sleep to avoid warning about deleting a connection right after creation. - IGN_SLEEP_MS(1); + GZ_SLEEP_MS(1); // Check that this doesn't segfault. conn.reset(); diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index efea4b831..97de9444c 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -15,7 +15,7 @@ target_link_libraries(events_example ignition-common${IGN_COMMON_VER}::events) add_executable(profiler_example profiler.cc) target_link_libraries(profiler_example ignition-common${IGN_COMMON_VER}::profiler) -target_compile_definitions(profiler_example PUBLIC "IGN_PROFILER_ENABLE=1") +target_compile_definitions(profiler_example PUBLIC "GZ_PROFILER_ENABLE=1") add_executable(logging_performance logging_performance.cc) target_link_libraries(logging_performance ignition-common${IGN_COMMON_VER}::core) diff --git a/examples/profiler.cc b/examples/profiler.cc index e6eafd1dc..f0107ba3a 100644 --- a/examples/profiler.cc +++ b/examples/profiler.cc @@ -27,17 +27,17 @@ std::atomic running; void task1() { // An example of using scope-based profiling. - IGN_PROFILE("task1"); + GZ_PROFILE("task1"); { - IGN_PROFILE("this"); + GZ_PROFILE("this"); { - IGN_PROFILE("is"); + GZ_PROFILE("is"); { - IGN_PROFILE("a"); + GZ_PROFILE("a"); { - IGN_PROFILE("deep"); + GZ_PROFILE("deep"); { - IGN_PROFILE("stack"); + GZ_PROFILE("stack"); std::this_thread::sleep_for(std::chrono::milliseconds(1)); } } @@ -49,54 +49,54 @@ void task1() void task2() { // An example of using scope-based profiling. - IGN_PROFILE("task2"); + GZ_PROFILE("task2"); { - IGN_PROFILE("a"); + GZ_PROFILE("a"); std::this_thread::sleep_for(std::chrono::milliseconds(2)); } { - IGN_PROFILE("b"); + GZ_PROFILE("b"); std::this_thread::sleep_for(std::chrono::milliseconds(2)); } { - IGN_PROFILE("c"); + GZ_PROFILE("c"); std::this_thread::sleep_for(std::chrono::milliseconds(2)); } { - IGN_PROFILE("d"); + GZ_PROFILE("d"); std::this_thread::sleep_for(std::chrono::milliseconds(2)); } } void task3() { - IGN_PROFILE("task3"); + GZ_PROFILE("task3"); // An example of using start/stop profiling. - IGN_PROFILE_BEGIN("a"); + GZ_PROFILE_BEGIN("a"); std::this_thread::sleep_for(std::chrono::milliseconds(2)); - IGN_PROFILE_END(); + GZ_PROFILE_END(); - IGN_PROFILE_BEGIN("b"); + GZ_PROFILE_BEGIN("b"); std::this_thread::sleep_for(std::chrono::milliseconds(2)); - IGN_PROFILE_END(); + GZ_PROFILE_END(); - IGN_PROFILE_BEGIN("c"); + GZ_PROFILE_BEGIN("c"); std::this_thread::sleep_for(std::chrono::milliseconds(2)); - IGN_PROFILE_END(); + GZ_PROFILE_END(); - IGN_PROFILE_BEGIN("d"); + GZ_PROFILE_BEGIN("d"); std::this_thread::sleep_for(std::chrono::milliseconds(2)); - IGN_PROFILE_END(); + GZ_PROFILE_END(); } void thread(const char *_thread_name) { // Sets the name of the thread to appear in the UI - IGN_PROFILE_THREAD_NAME(_thread_name); + GZ_PROFILE_THREAD_NAME(_thread_name); while (running) { - IGN_PROFILE("Loop"); + GZ_PROFILE("Loop"); // Execute some arbitrary tasks for (size_t ii = 0; ii < 10; ++ii) { @@ -117,7 +117,7 @@ int main(int argc, char** argv) { gz::common::Console::SetVerbosity(4); - IGN_PROFILE_THREAD_NAME("main"); + GZ_PROFILE_THREAD_NAME("main"); running = true; // Connect signal handler @@ -134,14 +134,14 @@ int main(int argc, char** argv) size_t ii = 0; while(running) { - IGN_PROFILE("main loop"); + GZ_PROFILE("main loop"); std::this_thread::sleep_for(std::chrono::milliseconds(100)); // Throttle to once per second if (ii++ % 10 == 0) { // Example of logging text to the remotery console. - IGN_PROFILE_LOG_TEXT("main loop done"); + GZ_PROFILE_LOG_TEXT("main loop done"); } } diff --git a/geospatial/include/gz/common/geospatial/Dem.hh b/geospatial/include/gz/common/geospatial/Dem.hh index 70fe693b1..3933441d3 100644 --- a/geospatial/include/gz/common/geospatial/Dem.hh +++ b/geospatial/include/gz/common/geospatial/Dem.hh @@ -147,7 +147,7 @@ namespace gz /// internal /// \brief Pointer to the private data. - IGN_UTILS_IMPL_PTR(dataPtr) + GZ_UTILS_IMPL_PTR(dataPtr) }; } } diff --git a/graphics/include/gz/common/Animation.hh b/graphics/include/gz/common/Animation.hh index 97ec0e564..ee7566c7e 100644 --- a/graphics/include/gz/common/Animation.hh +++ b/graphics/include/gz/common/Animation.hh @@ -104,7 +104,7 @@ namespace gz unsigned int &_firstKeyIndex) const; /// \brief Private data pointer. - IGN_UTILS_IMPL_PTR(dataPtr) + GZ_UTILS_IMPL_PTR(dataPtr) }; /// \brief A pose animation. @@ -142,7 +142,7 @@ namespace gz protected: void BuildInterpolationSplines(); /// \brief Private data pointer. - IGN_UTILS_IMPL_PTR(dataPtr) + GZ_UTILS_IMPL_PTR(dataPtr) }; /// \brief A numeric animation. @@ -166,7 +166,7 @@ namespace gz public: void InterpolatedKeyFrame(NumericKeyFrame &_kf) const; /// \brief Private data pointer. - IGN_UTILS_IMPL_PTR(dataPtr) + GZ_UTILS_IMPL_PTR(dataPtr) }; /// \brief Information about a trajectory for an animation (e.g., Actor) @@ -246,7 +246,7 @@ namespace gz _waypoints, double _tension = 0.0); /// \brief Private data pointer. - IGN_UTILS_IMPL_PTR(dataPtr) + GZ_UTILS_IMPL_PTR(dataPtr) }; } } diff --git a/graphics/include/gz/common/ColladaExporter.hh b/graphics/include/gz/common/ColladaExporter.hh index 83d1defab..35cdc3327 100644 --- a/graphics/include/gz/common/ColladaExporter.hh +++ b/graphics/include/gz/common/ColladaExporter.hh @@ -108,7 +108,7 @@ namespace gz const std::vector &_lights); /// \brief Pointer to private data. - IGN_UTILS_IMPL_PTR(dataPtr) + GZ_UTILS_IMPL_PTR(dataPtr) }; } } diff --git a/graphics/include/gz/common/ColladaLoader.hh b/graphics/include/gz/common/ColladaLoader.hh index 9b2ca5404..c9cb05c2f 100644 --- a/graphics/include/gz/common/ColladaLoader.hh +++ b/graphics/include/gz/common/ColladaLoader.hh @@ -44,7 +44,7 @@ namespace gz /// \internal /// \brief Pointer to private data. - IGN_UTILS_IMPL_PTR(dataPtr) + GZ_UTILS_IMPL_PTR(dataPtr) }; } } diff --git a/graphics/include/gz/common/Image.hh b/graphics/include/gz/common/Image.hh index 052b43e6c..614917388 100644 --- a/graphics/include/gz/common/Image.hh +++ b/graphics/include/gz/common/Image.hh @@ -256,7 +256,7 @@ namespace gz } /// \brief Private data pointer - IGN_UTILS_IMPL_PTR(dataPtr) + GZ_UTILS_IMPL_PTR(dataPtr) }; } } diff --git a/graphics/include/gz/common/KeyFrame.hh b/graphics/include/gz/common/KeyFrame.hh index 909b391d8..c03da07ad 100644 --- a/graphics/include/gz/common/KeyFrame.hh +++ b/graphics/include/gz/common/KeyFrame.hh @@ -45,7 +45,7 @@ namespace gz public: double Time() const; /// \brief Private data pointer. - IGN_UTILS_IMPL_PTR(dataPtr) + GZ_UTILS_IMPL_PTR(dataPtr) }; /// \brief A keyframe for a PoseAnimation @@ -75,7 +75,7 @@ namespace gz public: const math::Quaterniond &Rotation() const; /// \brief Private data pointer. - IGN_UTILS_IMPL_PTR(dataPtr) + GZ_UTILS_IMPL_PTR(dataPtr) }; /// \brief A keyframe for a NumericAnimation @@ -97,7 +97,7 @@ namespace gz public: const double &Value() const; /// \brief Private data pointer. - IGN_UTILS_IMPL_PTR(dataPtr) + GZ_UTILS_IMPL_PTR(dataPtr) }; } } diff --git a/graphics/include/gz/common/Material.hh b/graphics/include/gz/common/Material.hh index 5a1d68e47..f7929cd38 100644 --- a/graphics/include/gz/common/Material.hh +++ b/graphics/include/gz/common/Material.hh @@ -282,7 +282,7 @@ namespace gz } /// \brief Private data pointer. - IGN_UTILS_UNIQUE_IMPL_PTR(dataPtr) + GZ_UTILS_UNIQUE_IMPL_PTR(dataPtr) }; } } diff --git a/graphics/include/gz/common/Mesh.hh b/graphics/include/gz/common/Mesh.hh index 1bdd62669..0978df838 100644 --- a/graphics/include/gz/common/Mesh.hh +++ b/graphics/include/gz/common/Mesh.hh @@ -204,7 +204,7 @@ namespace gz public: double Volume() const; /// \brief Private data pointer. - IGN_UTILS_UNIQUE_IMPL_PTR(dataPtr) + GZ_UTILS_UNIQUE_IMPL_PTR(dataPtr) }; } } diff --git a/graphics/include/gz/common/MeshManager.hh b/graphics/include/gz/common/MeshManager.hh index 39931b101..5185dd4c7 100644 --- a/graphics/include/gz/common/MeshManager.hh +++ b/graphics/include/gz/common/MeshManager.hh @@ -214,7 +214,7 @@ namespace gz const float _height, const int _rings, const int _segments, - const double _arc = 2.0 * IGN_PI); + const double _arc = 2.0 * GZ_PI); /// \brief Create mesh for a plane /// \param[in] _name @@ -294,7 +294,7 @@ namespace gz const double _tol); /// \brief Private data pointer. - IGN_UTILS_UNIQUE_IMPL_PTR(dataPtr) + GZ_UTILS_UNIQUE_IMPL_PTR(dataPtr) /// \brief Singleton implementation private: friend class SingletonT; diff --git a/graphics/include/gz/common/NodeAnimation.hh b/graphics/include/gz/common/NodeAnimation.hh index 8662b74c0..ca270891f 100644 --- a/graphics/include/gz/common/NodeAnimation.hh +++ b/graphics/include/gz/common/NodeAnimation.hh @@ -109,7 +109,7 @@ namespace gz public: double TimeAtX(const double _x) const; /// \brief Private data pointer. - IGN_UTILS_IMPL_PTR(dataPtr) + GZ_UTILS_IMPL_PTR(dataPtr) }; } } diff --git a/graphics/include/gz/common/NodeTransform.hh b/graphics/include/gz/common/NodeTransform.hh index ba35204d7..9df900a0c 100644 --- a/graphics/include/gz/common/NodeTransform.hh +++ b/graphics/include/gz/common/NodeTransform.hh @@ -114,7 +114,7 @@ namespace gz public: math::Matrix4d operator*(const math::Matrix4d &_m) const; /// \brief Private data pointer. - IGN_UTILS_IMPL_PTR(dataPtr) + GZ_UTILS_IMPL_PTR(dataPtr) }; } } diff --git a/graphics/include/gz/common/OBJLoader.hh b/graphics/include/gz/common/OBJLoader.hh index da2b895ba..98aac8b91 100644 --- a/graphics/include/gz/common/OBJLoader.hh +++ b/graphics/include/gz/common/OBJLoader.hh @@ -49,7 +49,7 @@ namespace gz /// \internal /// \brief Private data pointer. - IGN_UTILS_IMPL_PTR(dataPtr) + GZ_UTILS_IMPL_PTR(dataPtr) }; } } diff --git a/graphics/include/gz/common/Pbr.hh b/graphics/include/gz/common/Pbr.hh index 485adbe03..95bcb473f 100644 --- a/graphics/include/gz/common/Pbr.hh +++ b/graphics/include/gz/common/Pbr.hh @@ -213,7 +213,7 @@ namespace common public: void SetType(PbrType _type); /// \brief Private data pointer. - IGN_UTILS_IMPL_PTR(dataPtr) + GZ_UTILS_IMPL_PTR(dataPtr) }; } } diff --git a/graphics/include/gz/common/STLLoader.hh b/graphics/include/gz/common/STLLoader.hh index 9ae0b4bfc..2f9a28aab 100644 --- a/graphics/include/gz/common/STLLoader.hh +++ b/graphics/include/gz/common/STLLoader.hh @@ -92,7 +92,7 @@ namespace gz private: bool FloatRead(FILE *_filein, double &_value); /// \brief Private data pointer. - IGN_UTILS_IMPL_PTR(dataPtr) + GZ_UTILS_IMPL_PTR(dataPtr) }; } } diff --git a/graphics/include/gz/common/SVGLoader.hh b/graphics/include/gz/common/SVGLoader.hh index ff49075dd..4ae6b0896 100644 --- a/graphics/include/gz/common/SVGLoader.hh +++ b/graphics/include/gz/common/SVGLoader.hh @@ -123,7 +123,7 @@ namespace gz /// \internal /// \brief Private data pointer. - IGN_UTILS_IMPL_PTR(dataPtr) + GZ_UTILS_IMPL_PTR(dataPtr) }; } } diff --git a/graphics/include/gz/common/Skeleton.hh b/graphics/include/gz/common/Skeleton.hh index bdfaa04ce..335a9dfaa 100644 --- a/graphics/include/gz/common/Skeleton.hh +++ b/graphics/include/gz/common/Skeleton.hh @@ -172,7 +172,7 @@ namespace gz private: void BuildNodeMap(); /// \brief Private data pointer. - IGN_UTILS_UNIQUE_IMPL_PTR(dataPtr) + GZ_UTILS_UNIQUE_IMPL_PTR(dataPtr) }; } } diff --git a/graphics/include/gz/common/SkeletonAnimation.hh b/graphics/include/gz/common/SkeletonAnimation.hh index 1900735a8..c93924c72 100644 --- a/graphics/include/gz/common/SkeletonAnimation.hh +++ b/graphics/include/gz/common/SkeletonAnimation.hh @@ -126,7 +126,7 @@ namespace gz public: double Length() const; /// \brief Private data pointer. - IGN_UTILS_IMPL_PTR(dataPtr) + GZ_UTILS_IMPL_PTR(dataPtr) }; } } diff --git a/graphics/include/gz/common/SkeletonNode.hh b/graphics/include/gz/common/SkeletonNode.hh index 83de81580..53b85ce74 100644 --- a/graphics/include/gz/common/SkeletonNode.hh +++ b/graphics/include/gz/common/SkeletonNode.hh @@ -190,7 +190,7 @@ namespace gz public: std::vector Transforms() const; /// \brief Private data pointer. - IGN_UTILS_IMPL_PTR(dataPtr) + GZ_UTILS_IMPL_PTR(dataPtr) }; typedef std::map SkeletonNodeMap; diff --git a/graphics/include/gz/common/SubMesh.hh b/graphics/include/gz/common/SubMesh.hh index fab8019d7..29472fdc3 100644 --- a/graphics/include/gz/common/SubMesh.hh +++ b/graphics/include/gz/common/SubMesh.hh @@ -401,7 +401,7 @@ namespace gz public: double Volume() const; /// \brief Private data pointer. - IGN_UTILS_IMPL_PTR(dataPtr) + GZ_UTILS_IMPL_PTR(dataPtr) }; /// \brief Vertex to node weighted assignement for skeleton animation diff --git a/graphics/src/BVHLoader.cc b/graphics/src/BVHLoader.cc index 9d27d998e..84442d353 100644 --- a/graphics/src/BVHLoader.cc +++ b/graphics/src/BVHLoader.cc @@ -236,7 +236,7 @@ std::unique_ptr BVHLoader::Load(const std::string &_filename, { if (channel == "Zrotation") { - zAngle = IGN_DTOR(value); + zAngle = GZ_DTOR(value); mats.push_back(math::Matrix4d( math::Quaterniond(zAxis, zAngle))); } @@ -244,7 +244,7 @@ std::unique_ptr BVHLoader::Load(const std::string &_filename, { if (channel == "Xrotation") { - xAngle = IGN_DTOR(value); + xAngle = GZ_DTOR(value); mats.push_back(math::Matrix4d( math::Quaterniond(xAxis, xAngle))); } @@ -252,7 +252,7 @@ std::unique_ptr BVHLoader::Load(const std::string &_filename, { if (channel == "Yrotation") { - yAngle = IGN_DTOR(value); + yAngle = GZ_DTOR(value); mats.push_back(math::Matrix4d( math::Quaterniond(yAxis, yAngle))); } diff --git a/graphics/src/ColladaExporter.cc b/graphics/src/ColladaExporter.cc index b4d1615ee..d3ec6bb3b 100644 --- a/graphics/src/ColladaExporter.cc +++ b/graphics/src/ColladaExporter.cc @@ -976,7 +976,7 @@ void ColladaExporter::Implementation::ExportVisualScenes( char str[100] = { 0 }; snprintf(str, sizeof(str), "%g %g %g %g", - axis.X(), axis.Y(), axis.Z(), angle / IGN_PI * 180.0); + axis.X(), axis.Y(), axis.Z(), angle / GZ_PI * 180.0); rotateXml->SetText(str); nodeXml->LinkEndChild(rotateXml); } diff --git a/graphics/src/ColladaLoader.cc b/graphics/src/ColladaLoader.cc index 8c796f9d1..b55e085cd 100644 --- a/graphics/src/ColladaLoader.cc +++ b/graphics/src/ColladaLoader.cc @@ -648,7 +648,7 @@ gz::math::Matrix4d ColladaLoader::Implementation::LoadNodeTransform( iss >> axis.X() >> axis.Y() >> axis.Z(); iss >> angle; - mat.SetFromAxisAngle(axis, IGN_DTOR(angle)); + mat.SetFromAxisAngle(axis, GZ_DTOR(angle)); gz::math::Matrix4d mat4(gz::math::Matrix4d::Identity); mat4 = mat; @@ -1271,7 +1271,7 @@ void ColladaLoader::Implementation::SetSkeletonNodeTransform( iss >> axis.X() >> axis.Y() >> axis.Z(); iss >> angle; - mat.SetFromAxisAngle(axis, IGN_DTOR(angle)); + mat.SetFromAxisAngle(axis, GZ_DTOR(angle)); gz::math::Matrix4d mat4(gz::math::Matrix4d::Identity); mat4 = mat; diff --git a/graphics/src/Material.cc b/graphics/src/Material.cc index 8df358fe9..0ca121b6e 100644 --- a/graphics/src/Material.cc +++ b/graphics/src/Material.cc @@ -23,11 +23,11 @@ using namespace gz; using namespace common; -IGN_ENUM(shadeModeIface, Material::ShadeMode, +GZ_ENUM(shadeModeIface, Material::ShadeMode, Material::SHADE_MODE_BEGIN, Material::SHADE_MODE_END, "FLAT", "GOURAUD", "PHONG", "BLINN") -IGN_ENUM(blendModeIface, Material::BlendMode, +GZ_ENUM(blendModeIface, Material::BlendMode, Material::BLEND_MODE_BEGIN, Material::BLEND_MODE_END, "ADD", "MODULATE", "REPLACE") diff --git a/graphics/src/MeshManager.cc b/graphics/src/MeshManager.cc index f32e5139a..890688eb1 100644 --- a/graphics/src/MeshManager.cc +++ b/graphics/src/MeshManager.cc @@ -290,8 +290,8 @@ void MeshManager::CreateSphere(const std::string &name, float radius, } int ring, seg; - float deltaSegAngle = (2.0 * IGN_PI / segments); - float deltaRingAngle = (IGN_PI / rings); + float deltaSegAngle = (2.0 * GZ_PI / segments); + float deltaRingAngle = (GZ_PI / rings); gz::math::Vector3d vert, norm; unsigned int verticeIndex = 0; @@ -866,10 +866,10 @@ void MeshManager::CreateEllipsoid(const std::string &_name, SubMesh subMesh; - const double umin = -IGN_PI / 2.0; - const double umax = IGN_PI / 2.0; + const double umin = -GZ_PI / 2.0; + const double umax = GZ_PI / 2.0; const double vmin = 0.0; - const double vmax = 2.0 * IGN_PI; + const double vmax = 2.0 * GZ_PI; unsigned int i, j; double theta, phi; @@ -963,16 +963,16 @@ void MeshManager::CreateCapsule(const std::string &_name, v = j; v /= (_rings + 1); - w = sin(0.5 * IGN_PI * v); - z = _radius * cos(0.5 * IGN_PI * v); + w = sin(0.5 * GZ_PI * v); + z = _radius * cos(0.5 * GZ_PI * v); for (unsigned int i = 0; i <= _segments; i++) { u = i; u /= _segments; - x = -sin(u * (IGN_PI * 2.0)); - y = cos(u * (IGN_PI * 2.0)); + x = -sin(u * (GZ_PI * 2.0)); + y = cos(u * (GZ_PI * 2.0)); gz::math::Vector3d p(x * _radius * w, y * _radius * w, z); // Compute vertex @@ -1014,8 +1014,8 @@ void MeshManager::CreateCapsule(const std::string &_name, u = i; u /= _segments; - x = -sin(u * (IGN_PI * 2.0)); - y = cos(u * (IGN_PI * 2.0)); + x = -sin(u * (GZ_PI * 2.0)); + y = cos(u * (GZ_PI * 2.0)); gz::math::Vector3d p(x * _radius, y * _radius, z); @@ -1049,16 +1049,16 @@ void MeshManager::CreateCapsule(const std::string &_name, v /= (_rings + 1); v += 1.0; - w = sin(0.5 * IGN_PI * v); - z = _radius * cos(0.5 * IGN_PI * v); + w = sin(0.5 * GZ_PI * v); + z = _radius * cos(0.5 * GZ_PI * v); for (unsigned int i = 0; i <= _segments; i++) { double u2 = static_cast(i); u2 /= _segments; - x = -sin(u2 * (IGN_PI * 2.0)); - y = cos(u2 * (IGN_PI * 2.0)); + x = -sin(u2 * (GZ_PI * 2.0)); + y = cos(u2 * (GZ_PI * 2.0)); gz::math::Vector3d p(x * _radius * w, y * _radius * w, z); // Compute vertex @@ -1094,7 +1094,7 @@ void MeshManager::CreateCylinder(const std::string &name, float radius, gz::math::Vector3d vert, norm; unsigned int verticeIndex = 0; int ring, seg; - float deltaSegAngle = (2.0 * IGN_PI / segments); + float deltaSegAngle = (2.0 * GZ_PI / segments); if (this->HasMesh(name)) { @@ -1227,7 +1227,7 @@ void MeshManager::CreateCone(const std::string &name, float radius, if (segments <3) segments = 3; - float deltaSegAngle = (2.0 * IGN_PI / segments); + float deltaSegAngle = (2.0 * GZ_PI / segments); // Generate the group of rings for the cone for (ring = 0; ring < rings; ring++) @@ -1453,7 +1453,7 @@ void MeshManager::CreateTube(const std::string &_name, float _innerRadius, } // Close ends in case it's not a full circle - if (!gz::math::equal(_arc, 2.0 * IGN_PI)) + if (!gz::math::equal(_arc, 2.0 * GZ_PI)) { for (ring = 0; ring < rings; ++ring) { diff --git a/graphics/src/NodeTransform.cc b/graphics/src/NodeTransform.cc index b8109f58a..3b44fe223 100644 --- a/graphics/src/NodeTransform.cc +++ b/graphics/src/NodeTransform.cc @@ -167,7 +167,7 @@ void NodeTransform::RecalculateMatrix() mat.SetFromAxisAngle(math::Vector3d(this->dataPtr->source[0], this->dataPtr->source[1], this->dataPtr->source[2]), - IGN_DTOR(this->dataPtr->source[3])); + GZ_DTOR(this->dataPtr->source[3])); this->dataPtr->transform = mat; } else diff --git a/graphics/src/OBJLoader.cc b/graphics/src/OBJLoader.cc index 013b3eba2..d304820a6 100644 --- a/graphics/src/OBJLoader.cc +++ b/graphics/src/OBJLoader.cc @@ -24,7 +24,7 @@ #include "gz/common/SubMesh.hh" #include "gz/common/OBJLoader.hh" -#define IGNITION_COMMON_TINYOBJLOADER_IMPLEMENTATION +#define GZ_COMMON_TINYOBJLOADER_IMPLEMENTATION #include "tiny_obj_loader.h" namespace gz diff --git a/graphics/src/SVGLoader.cc b/graphics/src/SVGLoader.cc index 56d53f56e..66417f3e8 100644 --- a/graphics/src/SVGLoader.cc +++ b/graphics/src/SVGLoader.cc @@ -347,7 +347,7 @@ void arcPath(const gz::math::Vector2d &_p0, // Ported from canvg (https://code.google.com/p/canvg/) double rx = _rx; double ry = _ry; - double rotx = _rotxDeg / 180.0 * IGN_PI; + double rotx = _rotxDeg / 180.0 * GZ_PI; double x1, y1, x2, y2, cx, cy, dx, dy, d; double x1p, y1p, cxp, cyp, s, sa, sb; @@ -421,18 +421,18 @@ void arcPath(const gz::math::Vector2d &_p0, { // Choose large arc if (da > 0.0) - da = da - 2 * IGN_PI; + da = da - 2 * GZ_PI; else - da = 2 * IGN_PI + da; + da = 2 * GZ_PI + da; } // rounding errors for half circles - if (IGN_PI - fabs(da) < 0.001) + if (GZ_PI - fabs(da) < 0.001) { if (_sweepDirection) - da = IGN_PI; + da = GZ_PI; else - da = -IGN_PI; + da = -GZ_PI; } // Approximate the arc using cubic spline segments. @@ -446,7 +446,7 @@ void arcPath(const gz::math::Vector2d &_p0, // Split arc into max 90 degree segments. // The loop assumes an iteration per end point // (including start and end), this +1. - size_t ndivs = static_cast(fabs(da) / (IGN_PI * 0.5) + 1.0); + size_t ndivs = static_cast(fabs(da) / (GZ_PI * 0.5) + 1.0); hda = (da / ndivs) / 2.0; kappa = fabs(4.0 / 3.0 * (1.0 - cos(hda)) / sin(hda)); if (da < 0.0) diff --git a/graphics/src/SubMesh.cc b/graphics/src/SubMesh.cc index 204a3f45f..356997a0f 100644 --- a/graphics/src/SubMesh.cc +++ b/graphics/src/SubMesh.cc @@ -629,8 +629,8 @@ void SubMesh::GenSphericalTexCoordBySet(const gz::math::Vector3d &_center, double r = std::max(0.000001, sqrt(x*x+y*y+z*z)); double s = std::min(1.0, std::max(-1.0, z/r)); double t = std::min(1.0, std::max(-1.0, y/r)); - double u = acos(s) / IGN_PI; - double v = acos(t) / IGN_PI; + double u = acos(s) / GZ_PI; + double v = acos(t) / GZ_PI; this->AddTexCoordBySet(u, v, _setIndex); } } diff --git a/graphics/src/SubMesh_TEST.cc b/graphics/src/SubMesh_TEST.cc index 48df65849..bc0e96c87 100644 --- a/graphics/src/SubMesh_TEST.cc +++ b/graphics/src/SubMesh_TEST.cc @@ -43,7 +43,7 @@ TEST_F(SubMeshTest, SubMesh) { // Test deprecated API // TODO(azeey) Remove this scope block when MaterialIndex is removed - IGN_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION + GZ_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION EXPECT_EQ(submesh->MaterialIndex(), std::numeric_limits::max()); submesh->SetMaterialIndex(3u); @@ -52,7 +52,7 @@ TEST_F(SubMeshTest, SubMesh) // break. submesh = std::make_shared(); ASSERT_NE(nullptr, submesh); - IGN_UTILS_WARN_RESUME__DEPRECATED_DECLARATION + GZ_UTILS_WARN_RESUME__DEPRECATED_DECLARATION } // Use new API @@ -405,7 +405,7 @@ TEST_F(SubMeshTest, Volume) const common::Mesh *unitSphere = common::MeshManager::Instance()->MeshByName("unit_sphere"); ASSERT_TRUE(unitSphere != nullptr); - EXPECT_NEAR(4.0/3.0 * IGN_PI * std::pow(0.5, 3), unitSphere->Volume(), + EXPECT_NEAR(4.0/3.0 * GZ_PI * std::pow(0.5, 3), unitSphere->Volume(), 1e-2); // A larger sphere needs to have higher resolution in order to get the @@ -416,7 +416,7 @@ TEST_F(SubMeshTest, Volume) const common::Mesh *otherSphere = common::MeshManager::Instance()->MeshByName("other_sphere"); ASSERT_TRUE(otherSphere != nullptr); - EXPECT_NEAR(4.0/3.0 * IGN_PI * std::pow(2.5, 3), otherSphere->Volume(), + EXPECT_NEAR(4.0/3.0 * GZ_PI * std::pow(2.5, 3), otherSphere->Volume(), 1e-2); } @@ -490,7 +490,7 @@ TEST_F(SubMeshTest, Volume) const common::Mesh *unitCylinder = common::MeshManager::Instance()->MeshByName("unit_cylinder"); ASSERT_TRUE(unitCylinder != nullptr); - EXPECT_NEAR(IGN_PI * std::pow(0.5, 2) * 1.0, unitCylinder->Volume(), + EXPECT_NEAR(GZ_PI * std::pow(0.5, 2) * 1.0, unitCylinder->Volume(), 1e-2); // A larger cylinder needs to have higher resolution in order to get the @@ -501,7 +501,7 @@ TEST_F(SubMeshTest, Volume) const common::Mesh *otherCylinder = common::MeshManager::Instance()->MeshByName("other_cylinder"); ASSERT_TRUE(otherCylinder != nullptr); - EXPECT_NEAR(IGN_PI * std::pow(2.5, 2) * 12, otherCylinder->Volume(), + EXPECT_NEAR(GZ_PI * std::pow(2.5, 2) * 12, otherCylinder->Volume(), 1e-2); } diff --git a/graphics/src/tiny_obj_loader.h b/graphics/src/tiny_obj_loader.h index f4be265fb..a61e43ce6 100644 --- a/graphics/src/tiny_obj_loader.h +++ b/graphics/src/tiny_obj_loader.h @@ -42,7 +42,7 @@ THE SOFTWARE. // // Use this in *one* .cc -// #define IGNITION_COMMON_TINYOBJLOADER_IMPLEMENTATION +// #define GZ_COMMON_TINYOBJLOADER_IMPLEMENTATION // #include "tiny_obj_loader.h" // @@ -401,7 +401,7 @@ bool ParseTextureNameAndOption(std::string *texname, texture_option_t *texopt, #endif // GZ_COMMON_TINY_OBJ_LOADER_H_ -#ifdef IGNITION_COMMON_TINYOBJLOADER_IMPLEMENTATION +#ifdef GZ_COMMON_TINYOBJLOADER_IMPLEMENTATION #include #include #include diff --git a/include/gz/common/Battery.hh b/include/gz/common/Battery.hh index 3996a6cf6..fa24ae6b1 100644 --- a/include/gz/common/Battery.hh +++ b/include/gz/common/Battery.hh @@ -172,7 +172,7 @@ namespace gz private: double UpdateDefault(Battery *_battery); /// \brief Pointer to private data. - IGN_UTILS_UNIQUE_IMPL_PTR(dataPtr) + GZ_UTILS_UNIQUE_IMPL_PTR(dataPtr) }; /// \def BatteryPtr diff --git a/include/gz/common/Console.hh b/include/gz/common/Console.hh index a623b75e1..f21a697ad 100644 --- a/include/gz/common/Console.hh +++ b/include/gz/common/Console.hh @@ -132,11 +132,11 @@ namespace gz public: std::ofstream *stream; }; - IGN_UTILS_WARN_IGNORE__DLL_INTERFACE_MISSING + GZ_UTILS_WARN_IGNORE__DLL_INTERFACE_MISSING /// \brief Stores the full path of the directory where all the log files /// are stored. private: std::string logDirectory; - IGN_UTILS_WARN_RESUME__DLL_INTERFACE_MISSING + GZ_UTILS_WARN_RESUME__DLL_INTERFACE_MISSING /// \brief True if initialized. private: bool initialized; @@ -221,10 +221,10 @@ namespace gz public: std::mutex syncMutex; }; - IGN_UTILS_WARN_IGNORE__DLL_INTERFACE_MISSING + GZ_UTILS_WARN_IGNORE__DLL_INTERFACE_MISSING /// \brief Prefix to use when logging to file. private: std::string prefix; - IGN_UTILS_WARN_RESUME__DLL_INTERFACE_MISSING + GZ_UTILS_WARN_RESUME__DLL_INTERFACE_MISSING }; /// \class Console Console.hh common/common.hh @@ -284,10 +284,10 @@ namespace gz /// \brief The level of verbosity, the default level is 1. private: static int verbosity; - IGN_UTILS_WARN_IGNORE__DLL_INTERFACE_MISSING + GZ_UTILS_WARN_IGNORE__DLL_INTERFACE_MISSING /// \brief A custom prefix. See SetPrefix(). private: static std::string customPrefix; - IGN_UTILS_WARN_RESUME__DLL_INTERFACE_MISSING + GZ_UTILS_WARN_RESUME__DLL_INTERFACE_MISSING }; } } diff --git a/include/gz/common/EnumIface.hh b/include/gz/common/EnumIface.hh index 24d0fae00..41c8ae358 100644 --- a/include/gz/common/EnumIface.hh +++ b/include/gz/common/EnumIface.hh @@ -37,7 +37,7 @@ namespace gz /// \param[in] names A vector of strings, one for each enum value. /// \sa EnumIface /// \sa EnumIterator - #define IGN_ENUM(name, enumType, begin, end, ...) \ + #define GZ_ENUM(name, enumType, begin, end, ...) \ static gz::common::EnumIface name( \ begin, end, {__VA_ARGS__}); diff --git a/include/gz/common/Filesystem.hh b/include/gz/common/Filesystem.hh index 6799f2839..99ddbca03 100644 --- a/include/gz/common/Filesystem.hh +++ b/include/gz/common/Filesystem.hh @@ -285,7 +285,7 @@ namespace gz public: bool operator!=(const DirIter &_other) const; /// \brief Pointer to private data. - IGN_UTILS_IMPL_PTR(dataPtr) + GZ_UTILS_IMPL_PTR(dataPtr) }; } } diff --git a/include/gz/common/SuppressWarning.hh b/include/gz/common/SuppressWarning.hh index cc2f0b93d..a6c598558 100644 --- a/include/gz/common/SuppressWarning.hh +++ b/include/gz/common/SuppressWarning.hh @@ -54,10 +54,10 @@ /// of our implementation) that the pointer is definitely not pointing to a more /// derived type. #define IGN_COMMON_WARN_IGNORE__DELETE_NON_VIRTUAL_DESTRUCTOR \ - IGN_UTILS_WARN_IGNORE__NON_VIRTUAL_DESTRUCTOR + GZ_UTILS_WARN_IGNORE__NON_VIRTUAL_DESTRUCTOR #define IGN_COMMON_WARN_RESUME__DELETE_NON_VIRTUAL_DESTRUCTOR \ - IGN_UTILS_WARN_RESUME__NON_VIRTUAL_DESTRUCTOR + GZ_UTILS_WARN_RESUME__NON_VIRTUAL_DESTRUCTOR /// \brief Microsoft Visual Studio does not automatically export the interface @@ -66,9 +66,9 @@ /// choose to suppress the warning instead of needlessly adding the class /// information to the DLL interface. #define IGN_COMMON_WARN_IGNORE__DLL_INTERFACE_MISSING \ - IGN_UTILS_WARN_IGNORE__DLL_INTERFACE_MISSING + GZ_UTILS_WARN_IGNORE__DLL_INTERFACE_MISSING #define IGN_COMMON_WARN_RESUME__DLL_INTERFACE_MISSING \ - IGN_UTILS_WARN_RESUME__DLL_INTERFACE_MISSING + GZ_UTILS_WARN_RESUME__DLL_INTERFACE_MISSING #endif diff --git a/include/gz/common/SystemPaths.hh b/include/gz/common/SystemPaths.hh index 02530692c..df9cc7e30 100644 --- a/include/gz/common/SystemPaths.hh +++ b/include/gz/common/SystemPaths.hh @@ -190,7 +190,7 @@ namespace gz public: static char Delimiter(); /// \brief Pointer to private data. - IGN_UTILS_IMPL_PTR(dataPtr) + GZ_UTILS_IMPL_PTR(dataPtr) }; } } diff --git a/include/gz/common/TempDirectory.hh b/include/gz/common/TempDirectory.hh index e54cbbaf1..3611d156f 100644 --- a/include/gz/common/TempDirectory.hh +++ b/include/gz/common/TempDirectory.hh @@ -116,7 +116,7 @@ namespace gz public: std::string Path() const; /// \brief Pointer to private data. - IGN_UTILS_UNIQUE_IMPL_PTR(dataPtr) + GZ_UTILS_UNIQUE_IMPL_PTR(dataPtr) }; } // namespace common } // namespace gz diff --git a/include/gz/common/Timer.hh b/include/gz/common/Timer.hh index 3b057b9c8..66b4737ac 100644 --- a/include/gz/common/Timer.hh +++ b/include/gz/common/Timer.hh @@ -57,7 +57,7 @@ namespace gz } /// \brief Private data pointer - IGN_UTILS_IMPL_PTR(dataPtr) + GZ_UTILS_IMPL_PTR(dataPtr) }; } } diff --git a/include/gz/common/URI.hh b/include/gz/common/URI.hh index 1bb35dd8d..73702a23a 100644 --- a/include/gz/common/URI.hh +++ b/include/gz/common/URI.hh @@ -130,7 +130,7 @@ namespace gz bool _emptyHostValid = false); /// \brief Pointer to private data. - IGN_UTILS_IMPL_PTR(dataPtr) + GZ_UTILS_IMPL_PTR(dataPtr) }; /// \brief A URI path contains a sequence of segments separated by `/`. @@ -235,7 +235,7 @@ namespace gz public: bool Parse(const std::string &_str); /// \brief Pointer to private data. - IGN_UTILS_IMPL_PTR(dataPtr) + GZ_UTILS_IMPL_PTR(dataPtr) }; /// \brief The query component of a URI @@ -283,7 +283,7 @@ namespace gz public: bool Parse(const std::string &_string); /// \brief Pointer to private data. - IGN_UTILS_IMPL_PTR(dataPtr) + GZ_UTILS_IMPL_PTR(dataPtr) }; /// \brief The fragment component of a URI @@ -328,7 +328,7 @@ namespace gz public: bool Parse(const std::string &_string); /// \brief Pointer to private data. - IGN_UTILS_IMPL_PTR(dataPtr) + GZ_UTILS_IMPL_PTR(dataPtr) }; /// \brief A complete URI which has the following components: @@ -425,7 +425,7 @@ namespace gz public: bool Parse(const std::string &_str); /// \brief Pointer to private data. - IGN_UTILS_IMPL_PTR(dataPtr) + GZ_UTILS_IMPL_PTR(dataPtr) }; } } diff --git a/include/gz/common/Util.hh b/include/gz/common/Util.hh index 39369de2d..b476b6ad3 100644 --- a/include/gz/common/Util.hh +++ b/include/gz/common/Util.hh @@ -34,61 +34,61 @@ // Defines #ifdef _WIN32 -# define IGN_HOMEDIR "USERPROFILE" +# define GZ_HOMEDIR "USERPROFILE" #else -# define IGN_HOMEDIR "HOME" +# define GZ_HOMEDIR "HOME" #endif /// \brief Seconds in one nano second. -#define IGN_NANO_TO_SEC 1e-9 +#define GZ_NANO_TO_SEC 1e-9 /// \brief Nano seconds in one second. -#define IGN_SEC_TO_NANO 1000000000 +#define GZ_SEC_TO_NANO 1000000000 /// \brief Nano seconds in one millisecond. -#define IGN_MS_TO_NANO 1000000 +#define GZ_MS_TO_NANO 1000000 /// \brief Nano seconds in one microsecond. -#define IGN_US_TO_NANO 1000 +#define GZ_US_TO_NANO 1000 /// \brief Speed of light. -#define IGN_SPEED_OF_LIGHT = 299792458.0 +#define GZ_SPEED_OF_LIGHT = 299792458.0 /// \brief Sleep for the specifed number of seconds -#define IGN_SLEEP_S(_s) (std::this_thread::sleep_for(\ +#define GZ_SLEEP_S(_s) (std::this_thread::sleep_for(\ std::chrono::seconds(_s))) /// \brief Sleep for the specifed number of microseconds -#define IGN_SLEEP_US(_us) (std::this_thread::sleep_for(\ +#define GZ_SLEEP_US(_us) (std::this_thread::sleep_for(\ std::chrono::microseconds(_us))) /// \brief Sleep for the specifed number of milliseconds -#define IGN_SLEEP_MS(_ms) (std::this_thread::sleep_for(\ +#define GZ_SLEEP_MS(_ms) (std::this_thread::sleep_for(\ std::chrono::milliseconds(_ms))) /// \brief Sleep for the specifed number of nanoseconds -#define IGN_SLEEP_NS(_ns) (std::this_thread::sleep_for(\ +#define GZ_SLEEP_NS(_ns) (std::this_thread::sleep_for(\ std::chrono::nanoseconds(_ns))) /// \brief Get the system time. -#define IGN_SYSTEM_TIME() (std::chrono::system_clock::now()) +#define GZ_SYSTEM_TIME() (std::chrono::system_clock::now()) /// \brief Get the system time in seconds since epoch. -#define IGN_SYSTEM_TIME_S() (std::chrono::duration_cast(\ +#define GZ_SYSTEM_TIME_S() (std::chrono::duration_cast(\ std::chrono::system_clock::now().time_since_epoch()).count()) /// \brief Get the system time in microseconds since epoch. -#define IGN_SYSTEM_TIME_US() (\ +#define GZ_SYSTEM_TIME_US() (\ std::chrono::duration_cast(\ std::chrono::system_clock::now().time_since_epoch()).count()) /// \brief Get the system time in milliseconds since epoch. -#define IGN_SYSTEM_TIME_MS() (\ +#define GZ_SYSTEM_TIME_MS() (\ std::chrono::duration_cast(\ std::chrono::system_clock::now().time_since_epoch()).count()) /// \brief Get the system time in nanoseconds since epoch. -#define IGN_SYSTEM_TIME_NS() (\ +#define GZ_SYSTEM_TIME_NS() (\ std::chrono::duration_cast(\ std::chrono::system_clock::now().time_since_epoch()).count()) @@ -120,7 +120,7 @@ namespace gz /// \brief Converts a time point to an ISO string: YYYY-MM-DDTHH:MM:SS.NS /// \param[in] _time A time point, such as one created by - /// IGN_SYSTEM_TIME(). + /// GZ_SYSTEM_TIME(). /// \return An ISO string that represents the given _time. std::string GZ_COMMON_VISIBLE timeToIso( const std::chrono::time_point &_time); diff --git a/include/gz/common/WorkerPool.hh b/include/gz/common/WorkerPool.hh index 43107f17c..d158dd199 100644 --- a/include/gz/common/WorkerPool.hh +++ b/include/gz/common/WorkerPool.hh @@ -62,7 +62,7 @@ namespace gz const std::chrono::steady_clock::duration &_timeout = std::chrono::steady_clock::duration::zero()); - IGN_UTILS_UNIQUE_IMPL_PTR(dataPtr) + GZ_UTILS_UNIQUE_IMPL_PTR(dataPtr) }; } } diff --git a/include/ignition/common/EnumIface.hh b/include/ignition/common/EnumIface.hh index 69a3d3ba7..fda76b697 100644 --- a/include/ignition/common/EnumIface.hh +++ b/include/ignition/common/EnumIface.hh @@ -17,3 +17,6 @@ #include #include + +#define IGN_ENUM(name, enumType, begin, end, ...) \ + GZ_ENUM(name, enumType, begin, end, ...) diff --git a/include/ignition/common/Plugin.hh b/include/ignition/common/Plugin.hh index d111fab5d..f8062fba1 100644 --- a/include/ignition/common/Plugin.hh +++ b/include/ignition/common/Plugin.hh @@ -180,10 +180,10 @@ namespace gz private: InterfaceMap::iterator PrivateGetOrCreateIterator( const std::string &_interfaceName); - IGN_UTILS_WARN_IGNORE__DLL_INTERFACE_MISSING + GZ_UTILS_WARN_IGNORE__DLL_INTERFACE_MISSING /// \brief PIMPL pointer to the implementation of this class. private: const std::unique_ptr dataPtr; - IGN_UTILS_WARN_RESUME__DLL_INTERFACE_MISSING + GZ_UTILS_WARN_RESUME__DLL_INTERFACE_MISSING /// \brief Virtual destructor public: virtual ~Plugin(); diff --git a/include/ignition/common/PluginLoader.hh b/include/ignition/common/PluginLoader.hh index ce19fd572..d509a8304 100644 --- a/include/ignition/common/PluginLoader.hh +++ b/include/ignition/common/PluginLoader.hh @@ -91,10 +91,10 @@ namespace gz private: const PluginInfo *PrivateGetPluginInfo( const std::string &_pluginName) const; - IGN_UTILS_WARN_IGNORE__DLL_INTERFACE_MISSING + GZ_UTILS_WARN_IGNORE__DLL_INTERFACE_MISSING /// \brief PIMPL pointer to class implementation private: std::unique_ptr dataPtr; - IGN_UTILS_WARN_RESUME__DLL_INTERFACE_MISSING + GZ_UTILS_WARN_RESUME__DLL_INTERFACE_MISSING }; } } diff --git a/include/ignition/common/Util.hh b/include/ignition/common/Util.hh index 760930934..8f6ed595a 100644 --- a/include/ignition/common/Util.hh +++ b/include/ignition/common/Util.hh @@ -17,3 +17,24 @@ #include #include + +#define IGN_HOMEDIR GZ_HOMEDIR + +#define IGN_NANO_TO_SEC GZ_NANO_TO_SEC +#define IGN_SEC_TO_NANO GZ_SEC_TO_NANO +#define IGN_MS_TO_NANO GZ_MS_TO_NANO +#define IGN_US_TO_NANO GZ_US_TO_NANO +#define IGN_SPEED_OF_LIGHT GZ_SPEED_OF_LIGHT + +#define IGN_SLEEP_S(_s) GZ_SLEEP_S(_s) +#define IGN_SLEEP_US(_us) GZ_SLEEP_US(_us) +#define IGN_SLEEP_MS(_ms) GZ_SLEEP_MS(_ms) +#define IGN_SLEEP_NS(_ns) GZ_SLEEP_NS(_ns) + +#define IGN_SYSTEM_TIME() GZ_SYSTEM_TIME() +#define IGN_SYSTEM_TIME_S() GZ_SYSTEM_TIME_S() +#define IGN_SYSTEM_TIME_US() GZ_SYSTEM_TIME_US() +#define IGN_SYSTEM_TIME_MS() GZ_SYSTEM_TIME_MS() +#define IGN_SYSTEM_TIME_NS() GZ_SYSTEM_TIME_NS() + +#define IGN_ASSERT(_expr, _msg) IGN_ASSERT(_expr, _msg) diff --git a/include/ignition/common/detail/PluginMacros.hh b/include/ignition/common/detail/PluginMacros.hh index e185c4461..3c3a30754 100644 --- a/include/ignition/common/detail/PluginMacros.hh +++ b/include/ignition/common/detail/PluginMacros.hh @@ -63,7 +63,7 @@ #define DETAIL_IGN_COMMON_BEGIN_ADDING_PLUGINS \ DETAIL_IGN_COMMON_REGISTER_PLUGININFO_META_DATA \ -IGN_UTILS_WARN_IGNORE__NON_VIRTUAL_DESTRUCTOR \ +GZ_UTILS_WARN_IGNORE__NON_VIRTUAL_DESTRUCTOR \ /* This struct attempts to make sure that the macro is being called from */ \ /* a global namespace */ \ struct IGN_macro_must_be_used_in_global_namespace; \ @@ -172,7 +172,7 @@ IGN_UTILS_WARN_IGNORE__NON_VIRTUAL_DESTRUCTOR \ } \ return visitedPlugins.size() - _pluginId; \ } \ -IGN_UTILS_WARN_RESUME__NON_VIRTUAL_DESTRUCTOR +GZ_UTILS_WARN_RESUME__NON_VIRTUAL_DESTRUCTOR #endif diff --git a/include/ignition/common/detail/SpecializedPlugin.hh b/include/ignition/common/detail/SpecializedPlugin.hh index 2a2e7ba6f..c87a52524 100644 --- a/include/ignition/common/detail/SpecializedPlugin.hh +++ b/include/ignition/common/detail/SpecializedPlugin.hh @@ -25,7 +25,7 @@ // This preprocessor token should only be used by the unittest that is // responsible for checking that the specialized routines are being used to // access specialized plugin interfaces. -#ifdef IGNITION_UNITTEST_SPECIALIZED_PLUGIN_ACCESS +#ifdef GZ_UNITTEST_SPECIALIZED_PLUGIN_ACCESS bool usedSpecializedInterfaceAccess; #endif @@ -100,7 +100,7 @@ namespace gz SpecInterface *SpecializedPlugin::PrivateQueryInterface( type) { - #ifdef IGNITION_UNITTEST_SPECIALIZED_PLUGIN_ACCESS + #ifdef GZ_UNITTEST_SPECIALIZED_PLUGIN_ACCESS usedSpecializedInterfaceAccess = true; #endif return static_cast( @@ -121,7 +121,7 @@ namespace gz const SpecInterface *SpecializedPlugin:: PrivateQueryInterface(type) const { - #ifdef IGNITION_UNITTEST_SPECIALIZED_PLUGIN_ACCESS + #ifdef GZ_UNITTEST_SPECIALIZED_PLUGIN_ACCESS usedSpecializedInterfaceAccess = true; #endif return static_cast( @@ -142,7 +142,7 @@ namespace gz bool SpecializedPlugin::PrivateHasInterface( type) const { - #ifdef IGNITION_UNITTEST_SPECIALIZED_PLUGIN_ACCESS + #ifdef GZ_UNITTEST_SPECIALIZED_PLUGIN_ACCESS usedSpecializedInterfaceAccess = true; #endif return (nullptr != this->privateSpecializedInterfaceIterator->second); diff --git a/profiler/BUILD.bazel b/profiler/BUILD.bazel index d0d159bd8..6aa4148e5 100644 --- a/profiler/BUILD.bazel +++ b/profiler/BUILD.bazel @@ -89,8 +89,8 @@ cc_library( srcs = sources, hdrs = public_headers, defines = [ - "IGN_PROFILER_ENABLE=1", - "IGN_PROFILER_REMOTERY=1", + "GZ_PROFILER_ENABLE=1", + "GZ_PROFILER_REMOTERY=1", ], includes = ["include"], deps = [ @@ -111,8 +111,8 @@ cc_test( name = "Profiler_Disabled_TEST", srcs = ["src/Profiler_Disabled_TEST.cc"], defines = [ - "IGN_PROFILER_ENABLE=0", - "IGN_PROFILER_REMOTERY=0", + "GZ_PROFILER_ENABLE=0", + "GZ_PROFILER_REMOTERY=0", ], deps = [ ":profiler", diff --git a/profiler/include/gz/common/Profiler.hh b/profiler/include/gz/common/Profiler.hh index e5add1a03..435dcf32c 100644 --- a/profiler/include/gz/common/Profiler.hh +++ b/profiler/include/gz/common/Profiler.hh @@ -47,11 +47,11 @@ namespace gz /// The profiler header also exports several convenience macros to make /// adding inspection points easier. /// - /// * IGN_PROFILE_THREAD_NAME - Set the name of the current profiled thread. - /// * IGN_PROFILE_LOG_TEXT - Log text to the profiler console (if supported) - /// * IGN_PROFILE_BEGIN - Begin a named profile sample - /// * IGN_PROFILE_END - End a named profile sample - /// * IGN_PROFILE - RAII-style profile sample. The sample will end at the + /// * GZ_PROFILE_THREAD_NAME - Set the name of the current profiled thread. + /// * GZ_PROFILE_LOG_TEXT - Log text to the profiler console (if supported) + /// * GZ_PROFILE_BEGIN - Begin a named profile sample + /// * GZ_PROFILE_END - End a named profile sample + /// * GZ_PROFILE - RAII-style profile sample. The sample will end at the /// end of the current scope. class GZ_COMMON_PROFILER_VISIBLE Profiler : public virtual SingletonT @@ -122,44 +122,44 @@ namespace gz } } -#ifndef IGN_PROFILER_ENABLE +#ifndef GZ_PROFILER_ENABLE /// Always set this variable to some value -#define IGN_PROFILER_ENABLE 0 +#define GZ_PROFILER_ENABLE 0 #endif -#if IGN_PROFILER_ENABLE +#if GZ_PROFILER_ENABLE /// \brief Set name of profiled thread -#define IGN_PROFILE_THREAD_NAME(name) \ +#define GZ_PROFILE_THREAD_NAME(name) \ gz::common::Profiler::Instance()->SetThreadName(name); /// \brief Log profiling text, if supported by implementation -#define IGN_PROFILE_LOG_TEXT(name) \ +#define GZ_PROFILE_LOG_TEXT(name) \ gz::common::Profiler::Instance()->LogText(name); /// \brief Being profiling sample -#define IGN_PROFILE_BEGIN(name) \ +#define GZ_PROFILE_BEGIN(name) \ gz::common::Profiler::Instance()->BeginSample(name) /// \brief End profiling sample -#define IGN_PROFILE_END() \ +#define GZ_PROFILE_END() \ gz::common::Profiler::Instance()->EndSample() -/// \brief Convenience wrapper for scoped profiling sample. Use IGN_PROFILE -#define IGN_PROFILE_L(name, line) \ +/// \brief Convenience wrapper for scoped profiling sample. Use GZ_PROFILE +#define GZ_PROFILE_L(name, line) \ static uint32_t __hash##line = 0; \ gz::common::ScopedProfile __profile##line(name, &__hash##line); /// \brief Scoped profiling sample. Sample will stop at end of scope. -#define IGN_PROFILE(name) IGN_PROFILE_L(name, __LINE__); +#define GZ_PROFILE(name) GZ_PROFILE_L(name, __LINE__); #else -#define IGN_PROFILE_THREAD_NAME(name) ((void) name) -#define IGN_PROFILE_LOG_TEXT(name) ((void) name) -#define IGN_PROFILE_BEGIN(name) ((void) name) -#define IGN_PROFILE_END() ((void) 0) -#define IGN_PROFILE_L(name, line) ((void) name) -#define IGN_PROFILE(name) ((void) name) -#endif // IGN_PROFILER_ENABLE +#define GZ_PROFILE_THREAD_NAME(name) ((void) name) +#define GZ_PROFILE_LOG_TEXT(name) ((void) name) +#define GZ_PROFILE_BEGIN(name) ((void) name) +#define GZ_PROFILE_END() ((void) 0) +#define GZ_PROFILE_L(name, line) ((void) name) +#define GZ_PROFILE(name) ((void) name) +#endif // GZ_PROFILER_ENABLE /// \brief Macro to determine if profiler is enabled and has an implementation. -#define IGN_PROFILER_VALID \ - IGN_PROFILER_ENABLE && gz::common::Profiler::Instance()->Valid() +#define GZ_PROFILER_VALID \ + GZ_PROFILER_ENABLE && gz::common::Profiler::Instance()->Valid() #endif // GZ_COMMON_PROFILER_HH_ diff --git a/profiler/include/ignition/common/Profiler.hh b/profiler/include/ignition/common/Profiler.hh index 6b35d68c5..bb6687dfd 100644 --- a/profiler/include/ignition/common/Profiler.hh +++ b/profiler/include/ignition/common/Profiler.hh @@ -17,3 +17,14 @@ #include #include + +#define IGN_PROFILER_ENABLE GZ_PROFILER_ENABLE + +#define IGN_PROFILE_THREAD_NAME(name) GZ_PROFILE_THREAD_NAME(name) +#define IGN_PROFILE_LOG_TEXT(name) GZ_PROFILE_LOG_TEXT(name) +#define IGN_PROFILE_BEGIN(name) GZ_PROFILE_BEGIN(name) +#define IGN_PROFILE_END() GZ_PROFILE_END() +#define IGN_PROFILE_L(name, line) GZ_PROFILE_L(name, line) +#define IGN_PROFILE(name) GZ_PROFILE(name) + +#define IGN_PROFILER_VALID GZ_PROFILER_VALID diff --git a/profiler/src/CMakeLists.txt b/profiler/src/CMakeLists.txt index 3874cb0fb..f73d8c6bf 100644 --- a/profiler/src/CMakeLists.txt +++ b/profiler/src/CMakeLists.txt @@ -1,4 +1,4 @@ -option(IGN_PROFILER_REMOTERY "Enable the Remotery profiler" TRUE) +option(GZ_PROFILER_REMOTERY "Enable the Remotery profiler" TRUE) set( PROFILER_SRCS @@ -10,7 +10,7 @@ set( Profiler_Disabled_TEST.cc ) -if(IGN_PROFILER_REMOTERY) +if(GZ_PROFILER_REMOTERY) set( Remotery_SRC ./Remotery/lib/Remotery.c @@ -57,11 +57,11 @@ ign_add_component(profiler SOURCES ${PROFILER_SRCS} GET_TARGET_NAME profiler_tar # Always enable profiler so that it's built, but make it # private so that downstream users can still disable profiling -target_compile_definitions(${profiler_target} PRIVATE "IGN_PROFILER_ENABLE=1") +target_compile_definitions(${profiler_target} PRIVATE "GZ_PROFILER_ENABLE=1") target_compile_definitions(${profiler_target} PRIVATE "RMT_USE_METAL=${RMT_USE_METAL}") -if(IGN_PROFILER_REMOTERY) - target_compile_definitions(${profiler_target} PRIVATE "IGN_PROFILER_REMOTERY=1") +if(GZ_PROFILER_REMOTERY) + target_compile_definitions(${profiler_target} PRIVATE "GZ_PROFILER_REMOTERY=1") target_include_directories( ${profiler_target} @@ -89,12 +89,12 @@ ign_build_tests( if(TARGET UNIT_Profiler_Remotery_TEST) target_compile_definitions(UNIT_Profiler_Remotery_TEST - PUBLIC "IGN_PROFILER_ENABLE=1") + PUBLIC "GZ_PROFILER_ENABLE=1") endif() -if(IGN_PROFILER_REMOTERY) - set(IGN_PROFILER_SCRIPT_PATH ${CMAKE_INSTALL_LIBEXECDIR}/ignition/ignition-common${PROJECT_VERSION_MAJOR}) - set(IGN_PROFILER_VIS_PATH ${IGN_DATA_INSTALL_DIR}/profiler_vis) +if(GZ_PROFILER_REMOTERY) + set(GZ_PROFILER_SCRIPT_PATH ${CMAKE_INSTALL_LIBEXECDIR}/ignition/ignition-common${PROJECT_VERSION_MAJOR}) + set(GZ_PROFILER_VIS_PATH ${IGN_DATA_INSTALL_DIR}/profiler_vis) configure_file(Remotery/ign_remotery_vis.in ${CMAKE_CURRENT_BINARY_DIR}/ign_remotery_vis @@ -102,8 +102,8 @@ if(IGN_PROFILER_REMOTERY) install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/ign_remotery_vis - DESTINATION ${IGN_PROFILER_SCRIPT_PATH}) + DESTINATION ${GZ_PROFILER_SCRIPT_PATH}) install(DIRECTORY Remotery/vis/ - DESTINATION ${IGN_PROFILER_VIS_PATH}) + DESTINATION ${GZ_PROFILER_VIS_PATH}) endif() diff --git a/profiler/src/Profiler.cc b/profiler/src/Profiler.cc index f53cd6ef5..3d072bf3a 100644 --- a/profiler/src/Profiler.cc +++ b/profiler/src/Profiler.cc @@ -19,9 +19,9 @@ #include "ProfilerImpl.hh" -#ifdef IGN_PROFILER_REMOTERY +#ifdef GZ_PROFILER_REMOTERY #include "RemoteryProfilerImpl.hh" -#endif // IGN_PROFILER_REMOTERY +#endif // GZ_PROFILER_REMOTERY using namespace gz; using namespace common; @@ -30,9 +30,9 @@ using namespace common; Profiler::Profiler(): impl(nullptr) { -#ifdef IGN_PROFILER_REMOTERY +#ifdef GZ_PROFILER_REMOTERY impl = new RemoteryProfilerImpl(); -#endif // IGN_PROFILER_REMOTERY +#endif // GZ_PROFILER_REMOTERY if (this->impl == nullptr) { diff --git a/profiler/src/Profiler_Disabled_TEST.cc b/profiler/src/Profiler_Disabled_TEST.cc index 321b7c765..4f1fa7dc9 100644 --- a/profiler/src/Profiler_Disabled_TEST.cc +++ b/profiler/src/Profiler_Disabled_TEST.cc @@ -28,6 +28,6 @@ using namespace common; ///////////////////////////////////////////////// TEST(Profiler, ProfilerDisabled) { - EXPECT_FALSE(IGN_PROFILER_ENABLE); - EXPECT_FALSE(IGN_PROFILER_VALID); + EXPECT_FALSE(GZ_PROFILER_ENABLE); + EXPECT_FALSE(GZ_PROFILER_VALID); } diff --git a/profiler/src/Profiler_Remotery_TEST.cc b/profiler/src/Profiler_Remotery_TEST.cc index e0b357655..79afda2bb 100644 --- a/profiler/src/Profiler_Remotery_TEST.cc +++ b/profiler/src/Profiler_Remotery_TEST.cc @@ -28,8 +28,8 @@ using namespace common; ///////////////////////////////////////////////// TEST(Profiler, ProfilerDisabled) { - EXPECT_TRUE(IGN_PROFILER_ENABLE); - EXPECT_TRUE(IGN_PROFILER_VALID); + EXPECT_TRUE(GZ_PROFILER_ENABLE); + EXPECT_TRUE(GZ_PROFILER_VALID); EXPECT_EQ(Profiler::Instance()->ImplementationName(), "ign_profiler_remotery"); } diff --git a/profiler/src/Remotery/ign_remotery_vis.in b/profiler/src/Remotery/ign_remotery_vis.in index 079f5baa9..1cfc160e0 100755 --- a/profiler/src/Remotery/ign_remotery_vis.in +++ b/profiler/src/Remotery/ign_remotery_vis.in @@ -1,7 +1,7 @@ #!/usr/bin/env bash -SCRIPT_PATH=@IGN_PROFILER_SCRIPT_PATH@/ign_remotery_vis -VIS_PATH=@IGN_PROFILER_VIS_PATH@/index.html +SCRIPT_PATH=@GZ_PROFILER_SCRIPT_PATH@/ign_remotery_vis +VIS_PATH=@GZ_PROFILER_VIS_PATH@/index.html # Get the full path to this script SCRIPT=`realpath $0` diff --git a/src/Console.cc b/src/Console.cc index 7d4a1d476..32055ad97 100644 --- a/src/Console.cc +++ b/src/Console.cc @@ -241,7 +241,7 @@ void FileLogger::Init(const std::string &_directory, #endif ) { - if (!env(IGN_HOMEDIR, logPath)) + if (!env(GZ_HOMEDIR, logPath)) { // Use stderr here to prevent infinite recursion // trying to get the log initialized diff --git a/src/Console_TEST.cc b/src/Console_TEST.cc index e8585a986..0e1bcc87a 100644 --- a/src/Console_TEST.cc +++ b/src/Console_TEST.cc @@ -34,14 +34,14 @@ class Console_TEST : public ::testing::Test { this->temp = std::make_unique( "test", "ign_common", true); ASSERT_TRUE(this->temp->Valid()); - common::setenv(IGN_HOMEDIR, this->temp->Path()); + common::setenv(GZ_HOMEDIR, this->temp->Path()); } /// \brief Clear out all the directories we produced during this test. public: virtual void TearDown() { gzLogClose(); - EXPECT_TRUE(gz::common::unsetenv(IGN_HOMEDIR)); + EXPECT_TRUE(gz::common::unsetenv(GZ_HOMEDIR)); } /// \brief Temporary directory to run test in @@ -52,7 +52,7 @@ std::string GetLogContent(const std::string &_filename) { // Get the absolute path std::string path; - EXPECT_TRUE(gz::common::env(IGN_HOMEDIR, path)); + EXPECT_TRUE(gz::common::env(GZ_HOMEDIR, path)); path = gz::common::joinPaths(path, _filename); EXPECT_TRUE(gz::common::exists(path)); @@ -87,7 +87,7 @@ TEST_F(Console_TEST, NoInitAndLog) // Cleanup gzLogClose(); std::string path; - EXPECT_TRUE(gz::common::env(IGN_HOMEDIR, path)); + EXPECT_TRUE(gz::common::env(GZ_HOMEDIR, path)); path = gz::common::joinPaths(path, logPath); EXPECT_TRUE(gz::common::removeAll(path)); } @@ -108,7 +108,7 @@ TEST_F(Console_TEST, InitAndLog) // Get the absolute path std::string basePath; - EXPECT_TRUE(gz::common::env(IGN_HOMEDIR, basePath)); + EXPECT_TRUE(gz::common::env(GZ_HOMEDIR, basePath)); basePath = gz::common::joinPaths(basePath, path); // Get the absolute log file path @@ -533,7 +533,7 @@ TEST_F(Console_TEST, LogDirectory) // Get the absolute path std::string absPath; - EXPECT_TRUE(gz::common::env(IGN_HOMEDIR, absPath)); + EXPECT_TRUE(gz::common::env(GZ_HOMEDIR, absPath)); absPath = gz::common::joinPaths(absPath, path); EXPECT_EQ(logDir, absPath); @@ -545,7 +545,7 @@ TEST_F(Console_TEST, LogDirectory) TEST_F(Console_TEST, NoInitAndLogNoHome) { gzLogClose(); - EXPECT_TRUE(gz::common::unsetenv(IGN_HOMEDIR)); + EXPECT_TRUE(gz::common::unsetenv(GZ_HOMEDIR)); // This should not throw gzlog << "this is a test" << std::endl; } diff --git a/src/EnumIface_TEST.cc b/src/EnumIface_TEST.cc index ea20da1a2..a8a8fd51a 100644 --- a/src/EnumIface_TEST.cc +++ b/src/EnumIface_TEST.cc @@ -33,7 +33,7 @@ enum MyType MY_TYPE_END }; -IGN_ENUM(myTypeIface, MyType, MY_TYPE_BEGIN, MY_TYPE_END, +GZ_ENUM(myTypeIface, MyType, MY_TYPE_BEGIN, MY_TYPE_END, "TYPE1", "TYPE2", "MY_TYPE_END" diff --git a/src/Filesystem_TEST.cc b/src/Filesystem_TEST.cc index 8bf81b0fd..cd3a90da7 100644 --- a/src/Filesystem_TEST.cc +++ b/src/Filesystem_TEST.cc @@ -388,7 +388,7 @@ TEST_F(FilesystemTest, parentPath) } ///////////////////////////////////////////////// -TEST_F(FilesystemTest, IGN_UTILS_TEST_DISABLED_ON_WIN32(cwd_error)) +TEST_F(FilesystemTest, GZ_UTILS_TEST_DISABLED_ON_WIN32(cwd_error)) { // This test intentionally creates a directory, switches to it, removes // the directory, and then tries to call cwd() on it to cause diff --git a/src/MaterialDensity.cc b/src/MaterialDensity.cc index e899103f6..b5d010bb5 100644 --- a/src/MaterialDensity.cc +++ b/src/MaterialDensity.cc @@ -23,7 +23,7 @@ using namespace gz; using namespace common; // Initialize enum iterator, and string converter -IGN_ENUM(materialDensityIface, MaterialDensity::Type, +GZ_ENUM(materialDensityIface, MaterialDensity::Type, MaterialDensity::Type::BEGIN, MaterialDensity::Type::END, "Styrofoam", diff --git a/src/Plugin.cc b/src/Plugin.cc index bf8acef27..1b5d9c37d 100644 --- a/src/Plugin.cc +++ b/src/Plugin.cc @@ -20,7 +20,7 @@ #include "gz/utils/SuppressWarning.hh" #include "ignition/common/Console.hh" -IGN_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION +GZ_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION #include "ignition/common/Plugin.hh" #include "ignition/common/PluginInfo.hh" #include "PluginUtils.hh" @@ -188,6 +188,6 @@ namespace gz } } } -IGN_UTILS_WARN_RESUME__DEPRECATED_DECLARATION +GZ_UTILS_WARN_RESUME__DEPRECATED_DECLARATION #undef SUPPRESS_IGNITION_HEADER_DEPRECATION diff --git a/src/PluginLoader.cc b/src/PluginLoader.cc index 5b156f3c2..6b971585e 100644 --- a/src/PluginLoader.cc +++ b/src/PluginLoader.cc @@ -30,7 +30,7 @@ #include "ignition/common/StringUtils.hh" #include "ignition/common/Util.hh" -IGN_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION +GZ_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION #include "ignition/common/PluginInfo.hh" #include "ignition/common/PluginLoader.hh" #include "ignition/common/PluginPtr.hh" @@ -320,6 +320,6 @@ namespace gz } } } -IGN_UTILS_WARN_RESUME__DEPRECATED_DECLARATION +GZ_UTILS_WARN_RESUME__DEPRECATED_DECLARATION #undef SUPPRESS_IGNITION_HEADER_DEPRECATION diff --git a/src/PluginLoader_TEST.cc b/src/PluginLoader_TEST.cc index 5c466c3f6..4726e9f8b 100644 --- a/src/PluginLoader_TEST.cc +++ b/src/PluginLoader_TEST.cc @@ -39,7 +39,7 @@ class TestTempDirectory : public gz::common::TempDirectory } }; -IGN_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION +GZ_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION #include "ignition/common/PluginLoader.hh" ///////////////////////////////////////////////// @@ -100,6 +100,6 @@ TEST(PluginLoader, InstantiateUnloadedPlugin) pm.Instantiate("plugin::that::is::not::loaded"); EXPECT_FALSE(plugin); } -IGN_UTILS_WARN_RESUME__DEPRECATED_DECLARATION +GZ_UTILS_WARN_RESUME__DEPRECATED_DECLARATION #undef SUPPRESS_IGNITION_HEADER_DEPRECATION diff --git a/src/PluginUtils_TEST.cc b/src/PluginUtils_TEST.cc index 17ac8d3df..7f6b1b1d4 100644 --- a/src/PluginUtils_TEST.cc +++ b/src/PluginUtils_TEST.cc @@ -25,7 +25,7 @@ using namespace gz; -IGN_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION +GZ_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION ///////////////////////////////////////////////// TEST(PluginUtils, NormalizeName) { @@ -38,6 +38,6 @@ TEST(PluginUtils, NormalizeName) EXPECT_EQ("::gz::math", common::NormalizeName("gz::math")); EXPECT_EQ("::gz::math", common::NormalizeName("::gz::math")); } -IGN_UTILS_WARN_RESUME__DEPRECATED_DECLARATION +GZ_UTILS_WARN_RESUME__DEPRECATED_DECLARATION #undef SUPPRESS_IGNITION_HEADER_DEPRECATION diff --git a/src/SystemPaths.cc b/src/SystemPaths.cc index 03d4ccfcd..ee55af5a7 100644 --- a/src/SystemPaths.cc +++ b/src/SystemPaths.cc @@ -88,7 +88,7 @@ SystemPaths::SystemPaths() : dataPtr(gz::utils::MakeImpl()) { std::string home, path, fullPath; - if (!env(IGN_HOMEDIR, home)) + if (!env(GZ_HOMEDIR, home)) home = "/tmp/gz"; if (!env("GZ_LOG_PATH", path)) diff --git a/src/Util.cc b/src/Util.cc index dd2e5cb79..91d3e61dd 100644 --- a/src/Util.cc +++ b/src/Util.cc @@ -251,13 +251,13 @@ bool Sha1::Digest(void const *_buffer, std::size_t _byteCount, ///////////////////////////////////////////////// std::string gz::common::systemTimeISO() { - return timeToIso(IGN_SYSTEM_TIME()); + return timeToIso(GZ_SYSTEM_TIME()); } ///////////////////////////////////////////////// std::string gz::common::systemTimeIso() { - return timeToIso(IGN_SYSTEM_TIME()); + return timeToIso(GZ_SYSTEM_TIME()); } // Taken from gtest.cc @@ -284,7 +284,7 @@ std::string gz::common::timeToIso( auto epoch = _time.time_since_epoch(); auto sec = std::chrono::duration_cast(epoch).count(); auto nano = std::chrono::duration_cast( - epoch).count() - sec * IGN_SEC_TO_NANO; + epoch).count() - sec * GZ_SEC_TO_NANO; time_t tmSec = static_cast(sec); struct tm localTime; diff --git a/src/WorkerPool_TEST.cc b/src/WorkerPool_TEST.cc index a1839c2e7..f52c2553f 100644 --- a/src/WorkerPool_TEST.cc +++ b/src/WorkerPool_TEST.cc @@ -100,7 +100,7 @@ TEST(WorkerPool, WaitWithTimeout) // /TODO(anyone) Deflake this test // ref: https://github.com/gazebosim/gz-common/issues/52 TEST(WorkerPool, - IGN_UTILS_TEST_ENABLED_ONLY_ON_LINUX(WaitWithTimeoutThatTimesOut)) + GZ_UTILS_TEST_ENABLED_ONLY_ON_LINUX(WaitWithTimeoutThatTimesOut)) { WorkerPool pool; pool.AddWork([] () @@ -114,7 +114,7 @@ TEST(WorkerPool, // /TODO(anyone) Deflake this test // ref: https://github.com/gazebosim/gz-common/issues/53 TEST(WorkerPool, - IGN_UTILS_TEST_ENABLED_ONLY_ON_LINUX(ThingsRunInParallel)) + GZ_UTILS_TEST_ENABLED_ONLY_ON_LINUX(ThingsRunInParallel)) { const unsigned int hc = std::thread::hardware_concurrency(); if (2 > hc) diff --git a/test/integration/console.cc b/test/integration/console.cc index f6b6bdccb..cd0050898 100644 --- a/test/integration/console.cc +++ b/test/integration/console.cc @@ -27,9 +27,9 @@ TEST(Console_TEST, LogInitAfterConsoleOut) auto tempDir = gz::common::testing::MakeTestTempDirectory(); ASSERT_TRUE(tempDir->Valid()); - gz::common::setenv(IGN_HOMEDIR, tempDir->Path()); + gz::common::setenv(GZ_HOMEDIR, tempDir->Path()); std::string home; - ASSERT_TRUE(gz::common::env(IGN_HOMEDIR, home)); + ASSERT_TRUE(gz::common::env(GZ_HOMEDIR, home)); auto logDir = tempDir->Path(); std::string logFile = gz::common::joinPaths(logDir, logFilename); diff --git a/test/integration/plugin.cc b/test/integration/plugin.cc index 2ce0ba919..2db874801 100644 --- a/test/integration/plugin.cc +++ b/test/integration/plugin.cc @@ -18,7 +18,7 @@ // Defining this macro before including ignition/common/SpecializedPluginPtr.hh // allows us to test that the high-speed routines are being used to access the // specialized plugin interfaces. -#define IGNITION_UNITTEST_SPECIALIZED_PLUGIN_ACCESS +#define GZ_UNITTEST_SPECIALIZED_PLUGIN_ACCESS #include @@ -35,7 +35,7 @@ #include "DummyPluginsPath.h" #include "plugins/DummyPlugins.hh" -IGN_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION +GZ_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION #include "ignition/common/PluginLoader.hh" #include "ignition/common/PluginPtr.hh" #include "ignition/common/SpecializedPluginPtr.hh" @@ -44,7 +44,7 @@ IGN_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION TEST(PluginLoader, LoadBadPlugins) { std::string dummyPath = - gz::common::copyFromUnixPath(IGN_DUMMY_PLUGIN_PATH); + gz::common::copyFromUnixPath(GZ_DUMMY_PLUGIN_PATH); gz::common::SystemPaths sp; sp.AddPluginPaths(dummyPath); @@ -72,7 +72,7 @@ TEST(PluginLoader, LoadBadPlugins) TEST(PluginLoader, LoadExistingLibrary) { std::string dummyPath = - gz::common::copyFromUnixPath(IGN_DUMMY_PLUGIN_PATH); + gz::common::copyFromUnixPath(GZ_DUMMY_PLUGIN_PATH); gz::common::SystemPaths sp; sp.AddPluginPaths(dummyPath); @@ -168,7 +168,7 @@ using SomeSpecializedPluginPtr = TEST(SpecializedPluginPtr, Construction) { gz::common::SystemPaths sp; - sp.AddPluginPaths(IGN_DUMMY_PLUGIN_PATH); + sp.AddPluginPaths(GZ_DUMMY_PLUGIN_PATH); std::string path = sp.FindSharedLibrary("GzDummyPlugins"); ASSERT_FALSE(path.empty()); @@ -295,7 +295,7 @@ TEST(PluginPtr, CopyMoveSemantics) EXPECT_TRUE(plugin.IsEmpty()); gz::common::SystemPaths sp; - sp.AddPluginPaths(IGN_DUMMY_PLUGIN_PATH); + sp.AddPluginPaths(GZ_DUMMY_PLUGIN_PATH); std::string path = sp.FindSharedLibrary("GzDummyPlugins"); ASSERT_FALSE(path.empty()); @@ -375,7 +375,7 @@ void CheckSomeValues( TEST(PluginPtr, QueryInterfaceSharedPtr) { gz::common::SystemPaths sp; - sp.AddPluginPaths(IGN_DUMMY_PLUGIN_PATH); + sp.AddPluginPaths(GZ_DUMMY_PLUGIN_PATH); std::string path = sp.FindSharedLibrary("GzDummyPlugins"); ASSERT_FALSE(path.empty()); @@ -439,6 +439,6 @@ TEST(PluginPtr, QueryInterfaceSharedPtr) SetSomeValues(setter); CheckSomeValues(getInt, getDouble, getName); } -IGN_UTILS_WARN_RESUME__DEPRECATED_DECLARATION +GZ_UTILS_WARN_RESUME__DEPRECATED_DECLARATION #undef SUPPRESS_IGNITION_HEADER_DEPRECATION diff --git a/test/performance/plugin_specialization.cc b/test/performance/plugin_specialization.cc index 16ac92923..92574211a 100644 --- a/test/performance/plugin_specialization.cc +++ b/test/performance/plugin_specialization.cc @@ -31,33 +31,33 @@ #include "plugins/DummyPlugins.hh" -IGN_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION +GZ_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION #include "ignition/common/PluginLoader.hh" #include "ignition/common/SpecializedPluginPtr.hh" -#define IGN_CREATE_SPEC_INTERFACE(name)\ +#define GZ_CREATE_SPEC_INTERFACE(name)\ class name { public: IGN_COMMON_SPECIALIZE_INTERFACE(name) }; -IGN_CREATE_SPEC_INTERFACE(Interface1) -IGN_CREATE_SPEC_INTERFACE(Interface2) -IGN_CREATE_SPEC_INTERFACE(Interface3) -IGN_CREATE_SPEC_INTERFACE(Interface4) -IGN_CREATE_SPEC_INTERFACE(Interface5) -IGN_CREATE_SPEC_INTERFACE(Interface6) -IGN_CREATE_SPEC_INTERFACE(Interface7) -IGN_CREATE_SPEC_INTERFACE(Interface8) -IGN_CREATE_SPEC_INTERFACE(Interface9) -IGN_CREATE_SPEC_INTERFACE(Interface10) -IGN_CREATE_SPEC_INTERFACE(Interface11) -IGN_CREATE_SPEC_INTERFACE(Interface12) -IGN_CREATE_SPEC_INTERFACE(Interface13) -IGN_CREATE_SPEC_INTERFACE(Interface14) -IGN_CREATE_SPEC_INTERFACE(Interface15) -IGN_CREATE_SPEC_INTERFACE(Interface16) -IGN_CREATE_SPEC_INTERFACE(Interface17) -IGN_CREATE_SPEC_INTERFACE(Interface18) -IGN_CREATE_SPEC_INTERFACE(Interface19) +GZ_CREATE_SPEC_INTERFACE(Interface1) +GZ_CREATE_SPEC_INTERFACE(Interface2) +GZ_CREATE_SPEC_INTERFACE(Interface3) +GZ_CREATE_SPEC_INTERFACE(Interface4) +GZ_CREATE_SPEC_INTERFACE(Interface5) +GZ_CREATE_SPEC_INTERFACE(Interface6) +GZ_CREATE_SPEC_INTERFACE(Interface7) +GZ_CREATE_SPEC_INTERFACE(Interface8) +GZ_CREATE_SPEC_INTERFACE(Interface9) +GZ_CREATE_SPEC_INTERFACE(Interface10) +GZ_CREATE_SPEC_INTERFACE(Interface11) +GZ_CREATE_SPEC_INTERFACE(Interface12) +GZ_CREATE_SPEC_INTERFACE(Interface13) +GZ_CREATE_SPEC_INTERFACE(Interface14) +GZ_CREATE_SPEC_INTERFACE(Interface15) +GZ_CREATE_SPEC_INTERFACE(Interface16) +GZ_CREATE_SPEC_INTERFACE(Interface17) +GZ_CREATE_SPEC_INTERFACE(Interface18) +GZ_CREATE_SPEC_INTERFACE(Interface19) // Specialize for only 1 type using Specialize1Type = @@ -137,7 +137,7 @@ double RunPerformanceTest(const PluginType &plugin) TEST(PluginSpecialization, AccessTime) { gz::common::SystemPaths sp; - sp.AddPluginPaths(IGN_DUMMY_PLUGIN_PATH); + sp.AddPluginPaths(GZ_DUMMY_PLUGIN_PATH); std::string path = sp.FindSharedLibrary("GzDummyPlugins"); ASSERT_FALSE(path.empty()); @@ -235,6 +235,6 @@ TEST(PluginSpecialization, AccessTime) } } -IGN_UTILS_WARN_RESUME__DEPRECATED_DECLARATION +GZ_UTILS_WARN_RESUME__DEPRECATED_DECLARATION #undef SUPPRESS_IGNITION_HEADER_DEPRECATION diff --git a/test/plugins/BadPluginAPIVersionNew.cc b/test/plugins/BadPluginAPIVersionNew.cc index 9d981f6a8..29106f4e0 100644 --- a/test/plugins/BadPluginAPIVersionNew.cc +++ b/test/plugins/BadPluginAPIVersionNew.cc @@ -21,7 +21,7 @@ #include "ignition/common/PluginMacros.hh" #include "gz/utils/SuppressWarning.hh" -IGN_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION +GZ_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION extern "C" { std::size_t DETAIL_IGN_PLUGIN_VISIBLE IGNCOMMONPluginInfoSize = @@ -40,6 +40,6 @@ extern "C" std::size_t DETAIL_IGN_PLUGIN_VISIBLE IGNCOMMONMultiPluginInfo( return 0u; } -IGN_UTILS_WARN_RESUME__DEPRECATED_DECLARATION +GZ_UTILS_WARN_RESUME__DEPRECATED_DECLARATION #undef SUPPRESS_IGNITION_HEADER_DEPRECATION diff --git a/test/plugins/BadPluginAPIVersionOld.cc b/test/plugins/BadPluginAPIVersionOld.cc index 0d5f12c6f..705b7eef3 100644 --- a/test/plugins/BadPluginAPIVersionOld.cc +++ b/test/plugins/BadPluginAPIVersionOld.cc @@ -20,7 +20,7 @@ #include "ignition/common/PluginMacros.hh" #include "gz/utils/SuppressWarning.hh" -IGN_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION +GZ_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION extern "C" { std::size_t DETAIL_IGN_PLUGIN_VISIBLE IGNCOMMONPluginInfoSize = @@ -38,6 +38,6 @@ extern "C" std::size_t DETAIL_IGN_PLUGIN_VISIBLE IGNCOMMONMultiPluginInfo( return 0u; } -IGN_UTILS_WARN_RESUME__DEPRECATED_DECLARATION +GZ_UTILS_WARN_RESUME__DEPRECATED_DECLARATION #undef SUPPRESS_IGNITION_HEADER_DEPRECATION diff --git a/test/plugins/BadPluginAlign.cc b/test/plugins/BadPluginAlign.cc index 40877371a..34020529a 100644 --- a/test/plugins/BadPluginAlign.cc +++ b/test/plugins/BadPluginAlign.cc @@ -20,7 +20,7 @@ #include "ignition/common/PluginMacros.hh" #include "gz/utils/SuppressWarning.hh" -IGN_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION +GZ_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION extern "C" { std::size_t DETAIL_IGN_PLUGIN_VISIBLE IGNCOMMONPluginInfoSize = @@ -39,6 +39,6 @@ extern "C" std::size_t DETAIL_IGN_PLUGIN_VISIBLE IGNCOMMONMultiPluginInfo( return 0u; } -IGN_UTILS_WARN_RESUME__DEPRECATED_DECLARATION +GZ_UTILS_WARN_RESUME__DEPRECATED_DECLARATION #undef SUPPRESS_IGNITION_HEADER_DEPRECATION diff --git a/test/plugins/BadPluginSize.cc b/test/plugins/BadPluginSize.cc index 936a3a438..b73436110 100644 --- a/test/plugins/BadPluginSize.cc +++ b/test/plugins/BadPluginSize.cc @@ -20,7 +20,7 @@ #include "ignition/common/PluginMacros.hh" #include "gz/utils/SuppressWarning.hh" -IGN_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION +GZ_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION extern "C" { std::size_t DETAIL_IGN_PLUGIN_VISIBLE IGNCOMMONPluginInfoSize = @@ -39,6 +39,6 @@ extern "C" std::size_t DETAIL_IGN_PLUGIN_VISIBLE IGNCOMMONMultiPluginInfo( return 0u; } -IGN_UTILS_WARN_RESUME__DEPRECATED_DECLARATION +GZ_UTILS_WARN_RESUME__DEPRECATED_DECLARATION #undef SUPPRESS_IGNITION_HEADER_DEPRECATION diff --git a/test/plugins/CMakeLists.txt b/test/plugins/CMakeLists.txt index 6655b4613..c6f7c0b49 100644 --- a/test/plugins/CMakeLists.txt +++ b/test/plugins/CMakeLists.txt @@ -17,14 +17,14 @@ set_property(TARGET GzDummyPlugins PROPERTY CXX_STANDARD 11) # Create a variable for the name of the header which will contain the dummy plugin path. # This variable gets put in the cache so that it is available at generation time. -set(IGN_DUMMY_PLUGIN_PATH_HEADER "DummyPluginsPath.h" CACHE INTERNAL "Name of header which contains DummyPlugin library path") +set(GZ_DUMMY_PLUGIN_PATH_HEADER "DummyPluginsPath.h" CACHE INTERNAL "Name of header which contains DummyPlugin library path") if(WIN32) get_target_property(GzDummyPluginsLocation GzDummyPlugins RUNTIME_OUTPUT_DIRECTORY) else() get_target_property(GzDummyPluginsLocation GzDummyPlugins LIBRARY_OUTPUT_DIRECTORY) endif() -set(header_text "#define IGN_DUMMY_PLUGIN_PATH \"${GzDummyPluginsLocation}\"") +set(header_text "#define GZ_DUMMY_PLUGIN_PATH \"${GzDummyPluginsLocation}\"") # Pipe the header text into a header that will be placed in the project binary directory. # We need to use this approach instead of the usual configure_file, because we required a @@ -38,12 +38,12 @@ if(WIN32) add_custom_command(TARGET GzDummyPluginsPathHeader PRE_BUILD COMMAND echo - ARGS "${header_text}" > ${PROJECT_BINARY_DIR}/${IGN_DUMMY_PLUGIN_PATH_HEADER}) + ARGS "${header_text}" > ${PROJECT_BINARY_DIR}/${GZ_DUMMY_PLUGIN_PATH_HEADER}) else() add_custom_command(TARGET GzDummyPluginsPathHeader PRE_BUILD COMMAND echo - ARGS "${header_text}" > ${PROJECT_BINARY_DIR}/${IGN_DUMMY_PLUGIN_PATH_HEADER} + ARGS "${header_text}" > ${PROJECT_BINARY_DIR}/${GZ_DUMMY_PLUGIN_PATH_HEADER} VERBATIM) endif() add_dependencies(GzDummyPlugins GzDummyPluginsPathHeader) diff --git a/test/plugins/DummyPlugins.cc b/test/plugins/DummyPlugins.cc index 798f2b06e..bcfe8d268 100644 --- a/test/plugins/DummyPlugins.cc +++ b/test/plugins/DummyPlugins.cc @@ -21,7 +21,7 @@ #include "gz/utils/SuppressWarning.hh" #include "DummyPlugins.hh" -IGN_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION +GZ_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION namespace test { @@ -92,6 +92,6 @@ IGN_COMMON_BEGIN_ADDING_PLUGINS IGN_COMMON_ADD_PLUGIN(test::util::DummyMultiPlugin, test::util::DummyGetSomeObjectBase) IGN_COMMON_FINISH_ADDING_PLUGINS -IGN_UTILS_WARN_RESUME__DEPRECATED_DECLARATION +GZ_UTILS_WARN_RESUME__DEPRECATED_DECLARATION #undef SUPPRESS_IGNITION_HEADER_DEPRECATION diff --git a/test/static_assertions/plugin_bad_const_assignment.cc b/test/static_assertions/plugin_bad_const_assignment.cc index dab667fcd..6822da660 100644 --- a/test/static_assertions/plugin_bad_const_assignment.cc +++ b/test/static_assertions/plugin_bad_const_assignment.cc @@ -17,7 +17,7 @@ #include -IGN_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION +GZ_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION #define SUPPRESS_IGNITION_HEADER_DEPRECATION #include "ignition/common/PluginPtr.hh" @@ -28,6 +28,6 @@ int main() gz::common::PluginPtr ptr; ptr = const_ptr; } -IGN_UTILS_WARN_RESUME__DEPRECATED_DECLARATION +GZ_UTILS_WARN_RESUME__DEPRECATED_DECLARATION #undef SUPPRESS_IGNITION_HEADER_DEPRECATION diff --git a/test/static_assertions/plugin_bad_const_construct.cc b/test/static_assertions/plugin_bad_const_construct.cc index f89119db6..131fa9488 100644 --- a/test/static_assertions/plugin_bad_const_construct.cc +++ b/test/static_assertions/plugin_bad_const_construct.cc @@ -17,7 +17,7 @@ #include -IGN_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION +GZ_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION #define SUPPRESS_IGNITION_HEADER_DEPRECATION #include "ignition/common/PluginPtr.hh" @@ -26,6 +26,6 @@ int main() { gz::common::PluginPtr ptr{gz::common::ConstPluginPtr()}; } -IGN_UTILS_WARN_RESUME__DEPRECATED_DECLARATION +GZ_UTILS_WARN_RESUME__DEPRECATED_DECLARATION #undef SUPPRESS_IGNITION_HEADER_DEPRECATION diff --git a/test/static_assertions/plugin_no_base_class.cc b/test/static_assertions/plugin_no_base_class.cc index c7c931080..dab8c24d8 100644 --- a/test/static_assertions/plugin_no_base_class.cc +++ b/test/static_assertions/plugin_no_base_class.cc @@ -17,7 +17,7 @@ #include -IGN_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION +GZ_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION #define SUPPRESS_IGNITION_HEADER_DEPRECATION #include "ignition/common/PluginMacros.hh" @@ -35,6 +35,6 @@ class NotBase IGN_COMMON_REGISTER_SINGLE_PLUGIN(A, NotBase) -IGN_UTILS_WARN_RESUME__DEPRECATED_DECLARATION +GZ_UTILS_WARN_RESUME__DEPRECATED_DECLARATION #undef SUPPRESS_IGNITION_HEADER_DEPRECATION diff --git a/test/static_assertions/plugin_not_fully_qualified_base.cc b/test/static_assertions/plugin_not_fully_qualified_base.cc index 7d44febb2..f84c61e67 100644 --- a/test/static_assertions/plugin_not_fully_qualified_base.cc +++ b/test/static_assertions/plugin_not_fully_qualified_base.cc @@ -17,7 +17,7 @@ #include -IGN_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION +GZ_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION #define SUPPRESS_IGNITION_HEADER_DEPRECATION #include "ignition/common/PluginMacros.hh" @@ -42,6 +42,6 @@ using ns::Base; IGN_COMMON_REGISTER_SINGLE_PLUGIN(ns::A, Base) -IGN_UTILS_WARN_RESUME__DEPRECATED_DECLARATION +GZ_UTILS_WARN_RESUME__DEPRECATED_DECLARATION #undef SUPPRESS_IGNITION_HEADER_DEPRECATION diff --git a/test/static_assertions/plugin_not_fully_qualified_class.cc b/test/static_assertions/plugin_not_fully_qualified_class.cc index e00b8cce6..71ce70a34 100644 --- a/test/static_assertions/plugin_not_fully_qualified_class.cc +++ b/test/static_assertions/plugin_not_fully_qualified_class.cc @@ -17,7 +17,7 @@ #include -IGN_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION +GZ_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION #define SUPPRESS_IGNITION_HEADER_DEPRECATION #include "ignition/common/PluginMacros.hh" @@ -42,6 +42,6 @@ using ns::A; IGN_COMMON_REGISTER_SINGLE_PLUGIN(A, ns::Base) -IGN_UTILS_WARN_RESUME__DEPRECATED_DECLARATION +GZ_UTILS_WARN_RESUME__DEPRECATED_DECLARATION #undef SUPPRESS_IGNITION_HEADER_DEPRECATION diff --git a/test/static_assertions/plugin_not_global_ns.cc b/test/static_assertions/plugin_not_global_ns.cc index 061fee0e6..99529221d 100644 --- a/test/static_assertions/plugin_not_global_ns.cc +++ b/test/static_assertions/plugin_not_global_ns.cc @@ -16,7 +16,7 @@ */ #include -IGN_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION +GZ_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION #define SUPPRESS_IGNITION_HEADER_DEPRECATION #include "ignition/common/PluginMacros.hh" @@ -38,5 +38,5 @@ class A : public Base IGN_COMMON_REGISTER_SINGLE_PLUGIN(ns::A, ns::Base) } -IGN_UTILS_WARN_RESUME__DEPRECATED_DECLARATION +GZ_UTILS_WARN_RESUME__DEPRECATED_DECLARATION #undef SUPPRESS_IGNITION_HEADER_DEPRECATION diff --git a/test/static_assertions/plugin_wrong_base_class.cc b/test/static_assertions/plugin_wrong_base_class.cc index b4b2a2cf4..8288f3ac0 100644 --- a/test/static_assertions/plugin_wrong_base_class.cc +++ b/test/static_assertions/plugin_wrong_base_class.cc @@ -17,7 +17,7 @@ #include -IGN_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION +GZ_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION #define SUPPRESS_IGNITION_HEADER_DEPRECATION #include "ignition/common/PluginMacros.hh" @@ -46,5 +46,5 @@ class A : public Base IGN_COMMON_REGISTER_SINGLE_PLUGIN(ns::A, ns::WrongBase) -IGN_UTILS_WARN_RESUME__DEPRECATED_DECLARATION +GZ_UTILS_WARN_RESUME__DEPRECATED_DECLARATION #undef SUPPRESS_IGNITION_HEADER_DEPRECATION diff --git a/testing/include/gz/common/testing/AutoLogFixture.hh b/testing/include/gz/common/testing/AutoLogFixture.hh index a63080279..a8798035f 100644 --- a/testing/include/gz/common/testing/AutoLogFixture.hh +++ b/testing/include/gz/common/testing/AutoLogFixture.hh @@ -50,7 +50,7 @@ class AutoLogFixture : public ::testing::Test protected: std::string LogContent() const; /// \brief Pointer to private data. - IGN_UTILS_UNIQUE_IMPL_PTR(dataPtr) + GZ_UTILS_UNIQUE_IMPL_PTR(dataPtr) }; } // namespace gz::common::testing diff --git a/testing/include/gz/common/testing/detail/AutoLogFixture.hh b/testing/include/gz/common/testing/detail/AutoLogFixture.hh index 5263d67bf..4126da5fb 100644 --- a/testing/include/gz/common/testing/detail/AutoLogFixture.hh +++ b/testing/include/gz/common/testing/detail/AutoLogFixture.hh @@ -57,7 +57,7 @@ AutoLogFixture::AutoLogFixture(): AutoLogFixture::~AutoLogFixture() { gzLogClose(); - EXPECT_TRUE(gz::common::unsetenv(IGN_HOMEDIR)); + EXPECT_TRUE(gz::common::unsetenv(GZ_HOMEDIR)); } ////////////////////////////////////////////////// @@ -77,7 +77,7 @@ void AutoLogFixture::SetUp() this->dataPtr->temp = std::make_unique( "test", "ign_common", true); ASSERT_TRUE(this->dataPtr->temp->Valid()); - common::setenv(IGN_HOMEDIR, this->dataPtr->temp->Path()); + common::setenv(GZ_HOMEDIR, this->dataPtr->temp->Path()); // Initialize Console auto logPath = common::joinPaths(this->dataPtr->temp->Path(), "test_logs"); diff --git a/tutorials/profiler.md b/tutorials/profiler.md index d995849df..8162ca026 100644 --- a/tutorials/profiler.md +++ b/tutorials/profiler.md @@ -14,7 +14,7 @@ implementation is [Remotery](https://github.com/Celtoys/Remotery). The goal of the profiler is to provide introspection and analysis when enabled at compile time, but to introduce no overhead when it is disabled at compile-time. -To control if the profiler is enabled, set the `IGN_PROFILER_ENABLE` flag using +To control if the profiler is enabled, set the `GZ_PROFILER_ENABLE` flag using cmake on the targets or sources that you are interested in (described below). ## Enabling the Profiler @@ -37,11 +37,11 @@ The relevant corresponding C++ would be as follows: void thread(const char *_thread_name) { // Sets the name of the thread to appear in the UI - IGN_PROFILE_THREAD_NAME(_thread_name); + GZ_PROFILE_THREAD_NAME(_thread_name); while (running) { // Add a profiling point to this scope. - IGN_PROFILE("Loop"); + GZ_PROFILE("Loop"); // Execute some arbitrary tasks for (size_t ii = 0; ii < 10; ++ii) { @@ -65,7 +65,7 @@ find_package(ignition-common5 QUIET REQUIRED COMPONENTS profiler) add_executable(profiler_example profiler.cc) target_link_libraries(profiler_example ignition-common5::profiler) # Enable the profiler for the example -target_compile_definitions(profiler_example PUBLIC "IGN_PROFILER_ENABLE=1") +target_compile_definitions(profiler_example PUBLIC "GZ_PROFILER_ENABLE=1") ``` Run `cmake` and build the example @@ -148,17 +148,17 @@ If you see ``connection error``, there are a couple of things to double check The profiler is used through a series of macros. The two primary ways of profiling a section of code are to either use -a matched pair of `IGN_PROFILE_BEGIN` and `IGN_PROFILE_END` macros, or to use -a single RAII-style macro `IGN_PROFILE`. The RAII style will stop measuring +a matched pair of `GZ_PROFILE_BEGIN` and `GZ_PROFILE_END` macros, or to use +a single RAII-style macro `GZ_PROFILE`. The RAII style will stop measuring once the scope that the macro was invoked in is left. Using begin/end: ```{.cpp} // An example of using start/stop profiling. - IGN_PROFILE_BEGIN("a"); + GZ_PROFILE_BEGIN("a"); std::this_thread::sleep_for(std::chrono::milliseconds(2)); - IGN_PROFILE_END(); + GZ_PROFILE_END(); ``` Using RAII-style: @@ -166,7 +166,7 @@ Using RAII-style: ```{.cpp} { // An example of using scope-based profiling. - IGN_PROFILE("a"); + GZ_PROFILE("a"); std::this_thread::sleep_for(std::chrono::milliseconds(2)); } ``` @@ -174,9 +174,9 @@ Using RAII-style: Additionally, each thread can be given a name for easy reference in the UI: ```{.cpp} - IGN_PROFILE_THREAD_NAME("main"); - IGN_PROFILE_THREAD_NAME("physics"); - IGN_PROFILE_THREAD_NAME("gui"); + GZ_PROFILE_THREAD_NAME("main"); + GZ_PROFILE_THREAD_NAME("physics"); + GZ_PROFILE_THREAD_NAME("gui"); ``` ## Configuring the Profiler