From b28235819903d4433a49093f3027eb373ea5a0bc Mon Sep 17 00:00:00 2001 From: Alexis Duburcq Date: Tue, 17 Oct 2023 20:23:58 +0200 Subject: [PATCH] [core] Flatten nested namespaces. --- .../core/control/abstract_controller.hxx | 4 +- .../jiminy/core/engine/engine_multi_robot.h | 2 +- .../jiminy/core/io/abstract_io_device.hxx | 2 +- core/include/jiminy/core/io/json_loader.h | 3 +- core/include/jiminy/core/io/serialization.hxx | 51 ++++--- .../robot/pinocchio_overload_algorithms.h | 7 +- core/include/jiminy/core/stepper/lie_group.h | 2 +- .../jiminy/core/telemetry/telemetry_data.h | 4 +- .../jiminy/core/telemetry/telemetry_data.hxx | 4 +- .../jiminy/core/telemetry/telemetry_sender.h | 4 +- .../core/telemetry/telemetry_sender.hxx | 4 +- core/include/jiminy/core/types.h | 7 +- core/src/io/json_loader.cc | 2 +- core/src/io/serialization.cc | 131 +++++++++--------- core/src/telemetry/telemetry_data.cc | 2 +- core/src/telemetry/telemetry_sender.cc | 2 +- .../include/jiminy/python/compatibility.h | 7 +- .../include/jiminy/python/constraints.h | 7 +- .../include/jiminy/python/controllers.h | 7 +- .../include/jiminy/python/engine.h | 7 +- .../include/jiminy/python/functors.h | 7 +- .../include/jiminy/python/generators.h | 7 +- .../include/jiminy/python/helpers.h | 7 +- .../include/jiminy/python/motors.h | 7 +- .../include/jiminy/python/robot.h | 7 +- .../include/jiminy/python/sensors.h | 7 +- .../include/jiminy/python/utilities.h | 17 +-- python/jiminy_pywrap/src/compatibility.cc | 7 +- python/jiminy_pywrap/src/constraints.cc | 7 +- python/jiminy_pywrap/src/controllers.cc | 7 +- python/jiminy_pywrap/src/engine.cc | 7 +- python/jiminy_pywrap/src/functors.cc | 7 +- python/jiminy_pywrap/src/generators.cc | 9 +- python/jiminy_pywrap/src/helpers.cc | 8 +- python/jiminy_pywrap/src/module.cc | 5 +- python/jiminy_pywrap/src/motors.cc | 7 +- python/jiminy_pywrap/src/robot.cc | 7 +- python/jiminy_pywrap/src/sensors.cc | 7 +- 38 files changed, 157 insertions(+), 239 deletions(-) diff --git a/core/include/jiminy/core/control/abstract_controller.hxx b/core/include/jiminy/core/control/abstract_controller.hxx index 6af2bf11e..2a59d8e69 100644 --- a/core/include/jiminy/core/control/abstract_controller.hxx +++ b/core/include/jiminy/core/control/abstract_controller.hxx @@ -101,6 +101,4 @@ namespace jiminy } } -#endif // JIMINY_ABSTRACT_CONTROLLER_HXX - - +#endif // JIMINY_ABSTRACT_CONTROLLER_HXX diff --git a/core/include/jiminy/core/engine/engine_multi_robot.h b/core/include/jiminy/core/engine/engine_multi_robot.h index 0c95840fd..5bfb9d702 100644 --- a/core/include/jiminy/core/engine/engine_multi_robot.h +++ b/core/include/jiminy/core/engine/engine_multi_robot.h @@ -675,4 +675,4 @@ namespace jiminy }; } -#endif //end of JIMINY_ENGINE_MULTIROBOT_H +#endif // JIMINY_ENGINE_MULTIROBOT_H diff --git a/core/include/jiminy/core/io/abstract_io_device.hxx b/core/include/jiminy/core/io/abstract_io_device.hxx index bc3054efc..674c3602b 100644 --- a/core/include/jiminy/core/io/abstract_io_device.hxx +++ b/core/include/jiminy/core/io/abstract_io_device.hxx @@ -41,4 +41,4 @@ namespace jiminy template<> hresult_t AbstractIODevice::write >(std::vector const & v); } -#endif // JIMINY_ABSTRACT_IO_DEVICE_HXX +#endif // JIMINY_ABSTRACT_IO_DEVICE_HXX diff --git a/core/include/jiminy/core/io/json_loader.h b/core/include/jiminy/core/io/json_loader.h index ee47b7726..643262df4 100644 --- a/core/include/jiminy/core/io/json_loader.h +++ b/core/include/jiminy/core/io/json_loader.h @@ -47,5 +47,6 @@ namespace jiminy std::vector payload_; std::shared_ptr device_; }; -} // End of namespace jiminy. +} + #endif // JIMINY_JSON_LOADER_H diff --git a/core/include/jiminy/core/io/serialization.hxx b/core/include/jiminy/core/io/serialization.hxx index 9767ed686..aa25b0c0f 100644 --- a/core/include/jiminy/core/io/serialization.hxx +++ b/core/include/jiminy/core/io/serialization.hxx @@ -42,34 +42,31 @@ namespace jiminy } -namespace boost +namespace boost::serialization { - namespace serialization - { - template - void load_construct_data(Archive & /* ar */, - pinocchio::GeometryObject * geomPtr, - unsigned int const /* version */) - { - ::new(geomPtr) pinocchio::GeometryObject( - "", 0, 0, {nullptr}, pinocchio::SE3::Identity()); - } + template + void load_construct_data(Archive & /* ar */, + pinocchio::GeometryObject * geomPtr, + unsigned int const /* version */) + { + ::new(geomPtr) pinocchio::GeometryObject( + "", 0, 0, {nullptr}, pinocchio::SE3::Identity()); + } - template - void serialize(Archive & ar, - pinocchio::GeometryObject & geom, - unsigned int const /* version */); + template + void serialize(Archive & ar, + pinocchio::GeometryObject & geom, + unsigned int const /* version */); - template - void serialize(Archive & ar, - pinocchio::GeometryModel & model, - unsigned int const /* version */) - { - ar & make_nvp("ngeoms", model.ngeoms); - ar & make_nvp("geometryObjects", model.geometryObjects); - ar & make_nvp("collisionPairs", model.collisionPairs); - } - } // namespace serialization -} // namespace boost + template + void serialize(Archive & ar, + pinocchio::GeometryModel & model, + unsigned int const /* version */) + { + ar & make_nvp("ngeoms", model.ngeoms); + ar & make_nvp("geometryObjects", model.geometryObjects); + ar & make_nvp("collisionPairs", model.collisionPairs); + } +} -#endif // JIMINY_SERIALIZATION_HXX +#endif // JIMINY_SERIALIZATION_HXX diff --git a/core/include/jiminy/core/robot/pinocchio_overload_algorithms.h b/core/include/jiminy/core/robot/pinocchio_overload_algorithms.h index 3c28a549a..fd84dd67a 100644 --- a/core/include/jiminy/core/robot/pinocchio_overload_algorithms.h +++ b/core/include/jiminy/core/robot/pinocchio_overload_algorithms.h @@ -31,9 +31,7 @@ #include "jiminy/core/engine/engine_multi_robot.h" -namespace jiminy -{ -namespace pinocchio_overload +namespace jiminy::pinocchio_overload { template class JointCollectionTpl, typename ConfigVectorType, typename TangentVectorType> @@ -546,6 +544,5 @@ namespace pinocchio_overload return data.llt_JMinvJt.solve(v); } } -} -#endif //end of JIMINY_ALGORITHMS_MOTOR_INERTIA_H +#endif // JIMINY_ALGORITHMS_MOTOR_INERTIA_H diff --git a/core/include/jiminy/core/stepper/lie_group.h b/core/include/jiminy/core/stepper/lie_group.h index 25c2439e1..325ec7bb4 100644 --- a/core/include/jiminy/core/stepper/lie_group.h +++ b/core/include/jiminy/core/stepper/lie_group.h @@ -1319,4 +1319,4 @@ namespace jiminy using stateDerivative_t = Eigen::StateDerivativeVector; } -#endif //end of JIMINY_LIE_GROUP_H +#endif // JIMINY_LIE_GROUP_H diff --git a/core/include/jiminy/core/telemetry/telemetry_data.h b/core/include/jiminy/core/telemetry/telemetry_data.h index 712efad0d..2d7a84a2e 100644 --- a/core/include/jiminy/core/telemetry/telemetry_data.h +++ b/core/include/jiminy/core/telemetry/telemetry_data.h @@ -87,8 +87,8 @@ namespace jiminy std::deque > floatsRegistry_; ///< Memory to handle floats bool_t isRegisteringAvailable_; ///< Whether registering is available }; -} // namespace jiminy +} #include "jiminy/core/telemetry/telemetry_data.hxx" -#endif // JIMINY_TELEMETRY_DATA_H \ No newline at end of file +#endif // JIMINY_TELEMETRY_DATA_H diff --git a/core/include/jiminy/core/telemetry/telemetry_data.hxx b/core/include/jiminy/core/telemetry/telemetry_data.hxx index 30710eb30..dcefbf7b5 100644 --- a/core/include/jiminy/core/telemetry/telemetry_data.hxx +++ b/core/include/jiminy/core/telemetry/telemetry_data.hxx @@ -46,6 +46,6 @@ namespace jiminy return hresult_t::SUCCESS; } -} // namespace jiminy +} -#endif // JIMINY_TELEMETRY_DATA_HXX \ No newline at end of file +#endif // JIMINY_TELEMETRY_DATA_HXX diff --git a/core/include/jiminy/core/telemetry/telemetry_sender.h b/core/include/jiminy/core/telemetry/telemetry_sender.h index 8cf78f543..967ef6bf1 100644 --- a/core/include/jiminy/core/telemetry/telemetry_sender.h +++ b/core/include/jiminy/core/telemetry/telemetry_sender.h @@ -106,8 +106,8 @@ namespace jiminy /// reserved position in the contiguous storage of telemetry data. telemetry_data_registry_t bufferPosition_; }; -} // End of jiminy namespace +} #include "jiminy/core/telemetry/telemetry_sender.hxx" -#endif // JIMINY_TELEMETRY_CLIENT_CLASS_H +#endif // JIMINY_TELEMETRY_CLIENT_CLASS_H diff --git a/core/include/jiminy/core/telemetry/telemetry_sender.hxx b/core/include/jiminy/core/telemetry/telemetry_sender.hxx index 564bc8269..01751737f 100644 --- a/core/include/jiminy/core/telemetry/telemetry_sender.hxx +++ b/core/include/jiminy/core/telemetry/telemetry_sender.hxx @@ -38,6 +38,6 @@ namespace jiminy } return returnCode; } -} // namespace jiminy +} -#endif // JIMINY_TELEMETRY_SENDER_HXX \ No newline at end of file +#endif // JIMINY_TELEMETRY_SENDER_HXX diff --git a/core/include/jiminy/core/types.h b/core/include/jiminy/core/types.h index 4d3d7963b..e6de285c4 100644 --- a/core/include/jiminy/core/types.h +++ b/core/include/jiminy/core/types.h @@ -28,12 +28,9 @@ // `pinocchio::container::aligned_vector` -namespace pinocchio +namespace pinocchio::container { - namespace container - { - template struct aligned_vector; - } + template struct aligned_vector; } diff --git a/core/src/io/json_loader.cc b/core/src/io/json_loader.cc index 6ed024b94..6068612a0 100644 --- a/core/src/io/json_loader.cc +++ b/core/src/io/json_loader.cc @@ -51,4 +51,4 @@ namespace jiminy { return rootJson_.get(); } -} // End of namespace jiminy. +} diff --git a/core/src/io/serialization.cc b/core/src/io/serialization.cc index 461ce2285..a92be1446 100644 --- a/core/src/io/serialization.cc +++ b/core/src/io/serialization.cc @@ -17,79 +17,76 @@ EXPL_TPL_INST_SERIALIZE_IMPL(boost::archive::binary_oarchive, __VA_ARGS__) -namespace boost +namespace boost::serialization { - namespace serialization + template + void serialize(Archive & ar, + pinocchio::GeometryObject & geom, + const unsigned int /* version */) { - template - void serialize(Archive & ar, - pinocchio::GeometryObject & geom, - const unsigned int /* version */) - { - ar & make_nvp("name", geom.name); - ar & make_nvp("parentFrame", geom.parentFrame); - ar & make_nvp("parentJoint", geom.parentJoint); - - /* Manual polymorphic up-casting to avoid relying on boost - serialization for doing it, otherwise it would conflict - with any pinocchio bindings exposing the same objects. */ - hpp::fcl::NODE_TYPE nodeType; - if (Archive::is_saving::value) - { - nodeType = geom.geometry->getNodeType(); - } - ar & make_nvp("nodeType", nodeType); + ar & make_nvp("name", geom.name); + ar & make_nvp("parentFrame", geom.parentFrame); + ar & make_nvp("parentJoint", geom.parentJoint); - #define UPCAST_FROM_TYPENAME(TYPENAME, CLASS) \ - case hpp::fcl::NODE_TYPE::TYPENAME: \ - if (Archive::is_loading::value) \ - { \ - geom.geometry = std::shared_ptr(new CLASS); \ - } \ - ar & make_nvp("geometry", static_cast(*geom.geometry)); \ - break; - - switch (nodeType) - { - UPCAST_FROM_TYPENAME(GEOM_TRIANGLE, hpp::fcl::TriangleP) - UPCAST_FROM_TYPENAME(GEOM_SPHERE, hpp::fcl::Sphere) - UPCAST_FROM_TYPENAME(GEOM_BOX, hpp::fcl::Box) - UPCAST_FROM_TYPENAME(GEOM_CAPSULE, hpp::fcl::Capsule) - UPCAST_FROM_TYPENAME(GEOM_CONE, hpp::fcl::Cone) - UPCAST_FROM_TYPENAME(GEOM_CYLINDER, hpp::fcl::Cylinder) - UPCAST_FROM_TYPENAME(GEOM_HALFSPACE, hpp::fcl::Halfspace) - UPCAST_FROM_TYPENAME(GEOM_PLANE, hpp::fcl::Plane) - UPCAST_FROM_TYPENAME(GEOM_ELLIPSOID, hpp::fcl::Ellipsoid) - UPCAST_FROM_TYPENAME(GEOM_CONVEX, hpp::fcl::Convex) - UPCAST_FROM_TYPENAME(BV_AABB, hpp::fcl::BVHModel) - UPCAST_FROM_TYPENAME(BV_OBB, hpp::fcl::BVHModel) - UPCAST_FROM_TYPENAME(BV_RSS, hpp::fcl::BVHModel) - UPCAST_FROM_TYPENAME(BV_OBBRSS, hpp::fcl::BVHModel) - UPCAST_FROM_TYPENAME(BV_kIOS, hpp::fcl::BVHModel) - UPCAST_FROM_TYPENAME(BV_KDOP16, hpp::fcl::BVHModel >) - UPCAST_FROM_TYPENAME(BV_KDOP18, hpp::fcl::BVHModel >) - UPCAST_FROM_TYPENAME(BV_KDOP24, hpp::fcl::BVHModel >) - case hpp::fcl::NODE_TYPE::GEOM_OCTREE: - case hpp::fcl::NODE_TYPE::HF_AABB: - case hpp::fcl::NODE_TYPE::HF_OBBRSS: - case hpp::fcl::NODE_TYPE::BV_UNKNOWN: - case hpp::fcl::NODE_TYPE::NODE_COUNT: - default: - // Falling back to polymorphism - ar & make_nvp("geometry", geom.geometry); - break; - } + /* Manual polymorphic up-casting to avoid relying on boost + serialization for doing it, otherwise it would conflict + with any pinocchio bindings exposing the same objects. */ + hpp::fcl::NODE_TYPE nodeType; + if (Archive::is_saving::value) + { + nodeType = geom.geometry->getNodeType(); + } + ar & make_nvp("nodeType", nodeType); - #undef UPCAST_FROM_TYPENAME + #define UPCAST_FROM_TYPENAME(TYPENAME, CLASS) \ + case hpp::fcl::NODE_TYPE::TYPENAME: \ + if (Archive::is_loading::value) \ + { \ + geom.geometry = std::shared_ptr(new CLASS); \ + } \ + ar & make_nvp("geometry", static_cast(*geom.geometry)); \ + break; - ar & make_nvp("placement", geom.placement); - ar & make_nvp("meshPath", geom.meshPath); - ar & make_nvp("meshScale", geom.meshScale); - ar & make_nvp("overrideMaterial", geom.overrideMaterial); - ar & make_nvp("meshColor", geom.meshColor); - ar & make_nvp("meshTexturePath", geom.meshTexturePath); + switch (nodeType) + { + UPCAST_FROM_TYPENAME(GEOM_TRIANGLE, hpp::fcl::TriangleP) + UPCAST_FROM_TYPENAME(GEOM_SPHERE, hpp::fcl::Sphere) + UPCAST_FROM_TYPENAME(GEOM_BOX, hpp::fcl::Box) + UPCAST_FROM_TYPENAME(GEOM_CAPSULE, hpp::fcl::Capsule) + UPCAST_FROM_TYPENAME(GEOM_CONE, hpp::fcl::Cone) + UPCAST_FROM_TYPENAME(GEOM_CYLINDER, hpp::fcl::Cylinder) + UPCAST_FROM_TYPENAME(GEOM_HALFSPACE, hpp::fcl::Halfspace) + UPCAST_FROM_TYPENAME(GEOM_PLANE, hpp::fcl::Plane) + UPCAST_FROM_TYPENAME(GEOM_ELLIPSOID, hpp::fcl::Ellipsoid) + UPCAST_FROM_TYPENAME(GEOM_CONVEX, hpp::fcl::Convex) + UPCAST_FROM_TYPENAME(BV_AABB, hpp::fcl::BVHModel) + UPCAST_FROM_TYPENAME(BV_OBB, hpp::fcl::BVHModel) + UPCAST_FROM_TYPENAME(BV_RSS, hpp::fcl::BVHModel) + UPCAST_FROM_TYPENAME(BV_OBBRSS, hpp::fcl::BVHModel) + UPCAST_FROM_TYPENAME(BV_kIOS, hpp::fcl::BVHModel) + UPCAST_FROM_TYPENAME(BV_KDOP16, hpp::fcl::BVHModel >) + UPCAST_FROM_TYPENAME(BV_KDOP18, hpp::fcl::BVHModel >) + UPCAST_FROM_TYPENAME(BV_KDOP24, hpp::fcl::BVHModel >) + case hpp::fcl::NODE_TYPE::GEOM_OCTREE: + case hpp::fcl::NODE_TYPE::HF_AABB: + case hpp::fcl::NODE_TYPE::HF_OBBRSS: + case hpp::fcl::NODE_TYPE::BV_UNKNOWN: + case hpp::fcl::NODE_TYPE::NODE_COUNT: + default: + // Falling back to polymorphism + ar & make_nvp("geometry", geom.geometry); + break; } - EXPLICIT_TEMPLATE_INSTANTIATION_SERIALIZE(pinocchio::GeometryObject) + #undef UPCAST_FROM_TYPENAME + + ar & make_nvp("placement", geom.placement); + ar & make_nvp("meshPath", geom.meshPath); + ar & make_nvp("meshScale", geom.meshScale); + ar & make_nvp("overrideMaterial", geom.overrideMaterial); + ar & make_nvp("meshColor", geom.meshColor); + ar & make_nvp("meshTexturePath", geom.meshTexturePath); } + + EXPLICIT_TEMPLATE_INSTANTIATION_SERIALIZE(pinocchio::GeometryObject) } diff --git a/core/src/telemetry/telemetry_data.cc b/core/src/telemetry/telemetry_data.cc index 7748f24c8..31848b57d 100644 --- a/core/src/telemetry/telemetry_data.cc +++ b/core/src/telemetry/telemetry_data.cc @@ -133,4 +133,4 @@ namespace jiminy { return &floatsRegistry_; } -}// end of namespace jiminy +} diff --git a/core/src/telemetry/telemetry_sender.cc b/core/src/telemetry/telemetry_sender.cc index 591bf22da..1401ee183 100644 --- a/core/src/telemetry/telemetry_sender.cc +++ b/core/src/telemetry/telemetry_sender.cc @@ -44,4 +44,4 @@ namespace jiminy { return objectName_; } -} // End of namespace jiminy. +} diff --git a/python/jiminy_pywrap/include/jiminy/python/compatibility.h b/python/jiminy_pywrap/include/jiminy/python/compatibility.h index 95b792c17..3f7342270 100644 --- a/python/jiminy_pywrap/include/jiminy/python/compatibility.h +++ b/python/jiminy_pywrap/include/jiminy/python/compatibility.h @@ -2,12 +2,9 @@ #define COMPATIBILITY_PYTHON_H -namespace jiminy -{ -namespace python +namespace jiminy::python { void exposeCompatibility(void); -} // End of namespace python. -} // End of namespace jiminy. +} #endif // COMPATIBILITY_PYTHON_H diff --git a/python/jiminy_pywrap/include/jiminy/python/constraints.h b/python/jiminy_pywrap/include/jiminy/python/constraints.h index 23a81b48e..bcb4c87a1 100644 --- a/python/jiminy_pywrap/include/jiminy/python/constraints.h +++ b/python/jiminy_pywrap/include/jiminy/python/constraints.h @@ -2,13 +2,10 @@ #define CONSTRAINTS_PYTHON_H -namespace jiminy -{ -namespace python +namespace jiminy::python { void exposeConstraint(void); void exposeConstraintsHolder(void); -} // End of namespace python. -} // End of namespace jiminy. +} #endif // CONSTRAINTS_PYTHON_H diff --git a/python/jiminy_pywrap/include/jiminy/python/controllers.h b/python/jiminy_pywrap/include/jiminy/python/controllers.h index 125ac630f..6b7ec46ea 100644 --- a/python/jiminy_pywrap/include/jiminy/python/controllers.h +++ b/python/jiminy_pywrap/include/jiminy/python/controllers.h @@ -2,13 +2,10 @@ #define CONTROLLERS_PYTHON_H -namespace jiminy -{ -namespace python +namespace jiminy::python { void exposeAbstractController(void); void exposeControllerFunctor(void); -} // End of namespace python. -} // End of namespace jiminy. +} #endif // CONTROLLERS_PYTHON_H diff --git a/python/jiminy_pywrap/include/jiminy/python/engine.h b/python/jiminy_pywrap/include/jiminy/python/engine.h index 3174fcfb4..2e73ec7f3 100644 --- a/python/jiminy_pywrap/include/jiminy/python/engine.h +++ b/python/jiminy_pywrap/include/jiminy/python/engine.h @@ -2,9 +2,7 @@ #define SIMULATOR_PYTHON_H -namespace jiminy -{ -namespace python +namespace jiminy::python { void exposeForces(void); void exposeStepperState(void); @@ -12,7 +10,6 @@ namespace python void exposeSystem(void); void exposeEngineMultiRobot(void); void exposeEngine(void); -} // End of namespace python. -} // End of namespace jiminy. +} #endif // SIMULATOR_PYTHON_H diff --git a/python/jiminy_pywrap/include/jiminy/python/functors.h b/python/jiminy_pywrap/include/jiminy/python/functors.h index 652040949..fde0722d9 100644 --- a/python/jiminy_pywrap/include/jiminy/python/functors.h +++ b/python/jiminy_pywrap/include/jiminy/python/functors.h @@ -8,9 +8,7 @@ #include "jiminy/python/utilities.h" -namespace jiminy -{ -namespace python +namespace jiminy::python { namespace bp = boost::python; @@ -343,7 +341,6 @@ namespace python // **************************** HeightmapFunctorVisitor ***************************** void exposeHeightmapFunctor(void); -} // End of namespace python. -} // End of namespace jiminy. +} #endif // FUNCTORS_PYTHON_H diff --git a/python/jiminy_pywrap/include/jiminy/python/generators.h b/python/jiminy_pywrap/include/jiminy/python/generators.h index b2c04f2b3..ade7fc853 100644 --- a/python/jiminy_pywrap/include/jiminy/python/generators.h +++ b/python/jiminy_pywrap/include/jiminy/python/generators.h @@ -2,12 +2,9 @@ #define GENERATORS_PYTHON_H -namespace jiminy -{ -namespace python +namespace jiminy::python { void exposeGenerators(void); -} // End of namespace python. -} // End of namespace jiminy. +} #endif // GENERATORS_PYTHON_H diff --git a/python/jiminy_pywrap/include/jiminy/python/helpers.h b/python/jiminy_pywrap/include/jiminy/python/helpers.h index f9ed11b31..e564ae743 100644 --- a/python/jiminy_pywrap/include/jiminy/python/helpers.h +++ b/python/jiminy_pywrap/include/jiminy/python/helpers.h @@ -2,12 +2,9 @@ #define HELPERS_PYTHON_H -namespace jiminy -{ -namespace python +namespace jiminy::python { void exposeHelpers(void); -} // End of namespace python. -} // End of namespace jiminy. +} #endif // HELPERS_PYTHON_H diff --git a/python/jiminy_pywrap/include/jiminy/python/motors.h b/python/jiminy_pywrap/include/jiminy/python/motors.h index 0598ee446..3d48788ed 100644 --- a/python/jiminy_pywrap/include/jiminy/python/motors.h +++ b/python/jiminy_pywrap/include/jiminy/python/motors.h @@ -2,13 +2,10 @@ #define MOTORS_PYTHON_H -namespace jiminy -{ -namespace python +namespace jiminy::python { void exposeAbstractMotor(void); void exposeSimpleMotor(void); -} // End of namespace python. -} // End of namespace jiminy. +} #endif // MOTORS_PYTHON_H diff --git a/python/jiminy_pywrap/include/jiminy/python/robot.h b/python/jiminy_pywrap/include/jiminy/python/robot.h index ddd7ad15f..49f5f4ff2 100644 --- a/python/jiminy_pywrap/include/jiminy/python/robot.h +++ b/python/jiminy_pywrap/include/jiminy/python/robot.h @@ -2,13 +2,10 @@ #define ROBOT_PYTHON_H -namespace jiminy -{ -namespace python +namespace jiminy::python { void exposeModel(void); void exposeRobot(void); -} // End of namespace python. -} // End of namespace jiminy. +} #endif // ROBOT_PYTHON_H diff --git a/python/jiminy_pywrap/include/jiminy/python/sensors.h b/python/jiminy_pywrap/include/jiminy/python/sensors.h index e740a61ba..fd9ade7c2 100644 --- a/python/jiminy_pywrap/include/jiminy/python/sensors.h +++ b/python/jiminy_pywrap/include/jiminy/python/sensors.h @@ -2,14 +2,11 @@ #define SENSORS_PYTHON_H -namespace jiminy -{ -namespace python +namespace jiminy::python { void exposeSensorsDataMap(void); void exposeAbstractSensor(void); void exposeBasicSensors(void); -} // End of namespace python. -} // End of namespace jiminy. +} #endif // SENSORS_PYTHON_H diff --git a/python/jiminy_pywrap/include/jiminy/python/utilities.h b/python/jiminy_pywrap/include/jiminy/python/utilities.h index 9b4963cde..f75000544 100644 --- a/python/jiminy_pywrap/include/jiminy/python/utilities.h +++ b/python/jiminy_pywrap/include/jiminy/python/utilities.h @@ -15,9 +15,7 @@ #include -namespace boost::python -{ -namespace converter +namespace boost::python::converter { #define EXPECTED_PYTYPE_FOR_ARG_IS_ARRAY(type) \ template <> \ @@ -31,13 +29,10 @@ namespace converter EXPECTED_PYTYPE_FOR_ARG_IS_ARRAY(numpy::ndarray const) EXPECTED_PYTYPE_FOR_ARG_IS_ARRAY(numpy::ndarray &) EXPECTED_PYTYPE_FOR_ARG_IS_ARRAY(numpy::ndarray const &) -} // namespace converter -} // namespace boost::python +} -namespace jiminy -{ -namespace python +namespace jiminy::python { namespace bp = boost::python; namespace np = boost::python::numpy; @@ -58,7 +53,8 @@ namespace python return {}; } - namespace detail { + namespace detail + { static char constexpr py_signature_tag[] = "PY signature :"; static char constexpr cpp_signature_tag[] = "C++ signature :"; } @@ -897,7 +893,6 @@ namespace python boost::apply_visitor(visitor, configField.second); } } -} // end of namespace python. -} // end of namespace jiminy. +} #endif // UTILITIES_PYTHON_H diff --git a/python/jiminy_pywrap/src/compatibility.cc b/python/jiminy_pywrap/src/compatibility.cc index a28795998..e2020fba2 100644 --- a/python/jiminy_pywrap/src/compatibility.cc +++ b/python/jiminy_pywrap/src/compatibility.cc @@ -4,9 +4,7 @@ #include "jiminy/python/compatibility.h" -namespace jiminy -{ -namespace python +namespace jiminy::python { namespace bp = boost::python; namespace np = boost::python::numpy; @@ -129,5 +127,4 @@ namespace python nativeFromPython(); } -} // End of namespace python. -} // End of namespace jiminy. +} diff --git a/python/jiminy_pywrap/src/constraints.cc b/python/jiminy_pywrap/src/constraints.cc index e7db1e1f9..bc69f6e50 100644 --- a/python/jiminy_pywrap/src/constraints.cc +++ b/python/jiminy_pywrap/src/constraints.cc @@ -23,8 +23,9 @@ namespace jiminy // Explicit template specialization must appear in exactly the same namespace than its template declaration template<> std::string const AbstractConstraintTpl::type_("UserConstraint"); +} -namespace python +namespace jiminy::python { namespace bp = boost::python; @@ -329,6 +330,4 @@ namespace python }; BOOST_PYTHON_VISITOR_EXPOSE(ConstraintsHolder) - -} // End of namespace python. -} // End of namespace jiminy. +} diff --git a/python/jiminy_pywrap/src/controllers.cc b/python/jiminy_pywrap/src/controllers.cc index d7d06076f..44ed3e184 100644 --- a/python/jiminy_pywrap/src/controllers.cc +++ b/python/jiminy_pywrap/src/controllers.cc @@ -8,9 +8,7 @@ #include "jiminy/python/controllers.h" -namespace jiminy -{ -namespace python +namespace jiminy::python { namespace bp = boost::python; @@ -412,5 +410,4 @@ namespace python }; BOOST_PYTHON_VISITOR_EXPOSE(ControllerFunctor) -} // End of namespace python. -} // End of namespace jiminy. +} diff --git a/python/jiminy_pywrap/src/engine.cc b/python/jiminy_pywrap/src/engine.cc index 3439095ce..8976b29e3 100644 --- a/python/jiminy_pywrap/src/engine.cc +++ b/python/jiminy_pywrap/src/engine.cc @@ -18,9 +18,7 @@ #include "jiminy/python/engine.h" -namespace jiminy -{ -namespace python +namespace jiminy::python { namespace bp = boost::python; @@ -1095,5 +1093,4 @@ namespace python }; BOOST_PYTHON_VISITOR_EXPOSE(Engine) -} // End of namespace python. -} // End of namespace jiminy. +} diff --git a/python/jiminy_pywrap/src/functors.cc b/python/jiminy_pywrap/src/functors.cc index e84767b61..e6f1c01ae 100644 --- a/python/jiminy_pywrap/src/functors.cc +++ b/python/jiminy_pywrap/src/functors.cc @@ -5,9 +5,7 @@ #include "jiminy/python/functors.h" -namespace jiminy -{ -namespace python +namespace jiminy::python { namespace bp = boost::python; @@ -86,5 +84,4 @@ namespace python }; BOOST_PYTHON_VISITOR_EXPOSE(HeightmapFunctor) -} // End of namespace python. -} // End of namespace jiminy. +} diff --git a/python/jiminy_pywrap/src/generators.cc b/python/jiminy_pywrap/src/generators.cc index f2ab032e1..f716b7703 100644 --- a/python/jiminy_pywrap/src/generators.cc +++ b/python/jiminy_pywrap/src/generators.cc @@ -4,9 +4,7 @@ #include "jiminy/python/generators.h" -namespace jiminy -{ -namespace python +namespace jiminy::python { namespace bp = boost::python; @@ -113,9 +111,6 @@ namespace python bp::def("discretize_heightmap", &discretizeHeightmap, (bp::arg("heightmap"), "grid_size", "grid_unit")); } - -} // End of namespace python. -} // End of namespace jiminy. - +} diff --git a/python/jiminy_pywrap/src/helpers.cc b/python/jiminy_pywrap/src/helpers.cc index ee31e2edd..221e011ba 100644 --- a/python/jiminy_pywrap/src/helpers.cc +++ b/python/jiminy_pywrap/src/helpers.cc @@ -15,9 +15,7 @@ #include "jiminy/python/helpers.h" -namespace jiminy -{ -namespace python +namespace jiminy::python { namespace bp = boost::python; @@ -387,6 +385,4 @@ namespace python bp::def("solveJMinvJtv", &solveJMinvJtv, (bp::arg("pinocchio_data"), "v", bp::arg("update_decomposition") = true)); } - -} // End of namespace python. -} // End of namespace jiminy. +} diff --git a/python/jiminy_pywrap/src/module.cc b/python/jiminy_pywrap/src/module.cc index 7aca96919..d14c68a03 100755 --- a/python/jiminy_pywrap/src/module.cc +++ b/python/jiminy_pywrap/src/module.cc @@ -31,9 +31,7 @@ #include "jiminy/python/sensors.h" -namespace jiminy -{ -namespace python +namespace jiminy::python { namespace bp = boost::python; namespace np = boost::python::numpy; @@ -147,4 +145,3 @@ namespace python #undef TIME_STATE_FCT_EXPOSE } -} diff --git a/python/jiminy_pywrap/src/motors.cc b/python/jiminy_pywrap/src/motors.cc index 7845f9c5b..d8a4f21e9 100644 --- a/python/jiminy_pywrap/src/motors.cc +++ b/python/jiminy_pywrap/src/motors.cc @@ -6,9 +6,7 @@ #include "jiminy/python/motors.h" -namespace jiminy -{ -namespace python +namespace jiminy::python { namespace bp = boost::python; @@ -131,5 +129,4 @@ namespace python }; BOOST_PYTHON_VISITOR_EXPOSE(SimpleMotor) -} // End of namespace python. -} // End of namespace jiminy. +} diff --git a/python/jiminy_pywrap/src/robot.cc b/python/jiminy_pywrap/src/robot.cc index 7296268bb..87f9aec51 100644 --- a/python/jiminy_pywrap/src/robot.cc +++ b/python/jiminy_pywrap/src/robot.cc @@ -9,9 +9,7 @@ #include "jiminy/python/robot.h" -namespace jiminy -{ -namespace python +namespace jiminy::python { namespace bp = boost::python; @@ -508,5 +506,4 @@ namespace python }; BOOST_PYTHON_VISITOR_EXPOSE(Robot) -} // End of namespace python. -} // End of namespace jiminy. +} diff --git a/python/jiminy_pywrap/src/sensors.cc b/python/jiminy_pywrap/src/sensors.cc index 608e15ccd..5ee88bf6c 100644 --- a/python/jiminy_pywrap/src/sensors.cc +++ b/python/jiminy_pywrap/src/sensors.cc @@ -8,9 +8,7 @@ #include "jiminy/python/sensors.h" -namespace jiminy -{ -namespace python +namespace jiminy::python { namespace bp = boost::python; @@ -464,5 +462,4 @@ namespace python }; BOOST_PYTHON_VISITOR_EXPOSE(BasicSensors) -} // End of namespace python. -} // End of namespace jiminy. +}