Nest all namespaces
The compiler supports this now. We can type less going forward.
No functional changes.
Signed-off-by: Stephan Pleines <pleines.stephan@gmail.com>
Change-Id: I29d6fa4f9aacc0e381f1a7637294db0392466995
diff --git a/y2019/control_loops/drivetrain/drivetrain_base.cc b/y2019/control_loops/drivetrain/drivetrain_base.cc
index 089bdf0..77085a6 100644
--- a/y2019/control_loops/drivetrain/drivetrain_base.cc
+++ b/y2019/control_loops/drivetrain/drivetrain_base.cc
@@ -13,9 +13,7 @@
namespace chrono = ::std::chrono;
-namespace y2019 {
-namespace control_loops {
-namespace drivetrain {
+namespace y2019::control_loops::drivetrain {
using ::frc971::constants::ShifterHallEffect;
@@ -58,6 +56,4 @@
return kDrivetrainConfig;
};
-} // namespace drivetrain
-} // namespace control_loops
-} // namespace y2019
+} // namespace y2019::control_loops::drivetrain
diff --git a/y2019/control_loops/drivetrain/event_loop_localizer.cc b/y2019/control_loops/drivetrain/event_loop_localizer.cc
index 634cedb..a916914 100644
--- a/y2019/control_loops/drivetrain/event_loop_localizer.cc
+++ b/y2019/control_loops/drivetrain/event_loop_localizer.cc
@@ -2,9 +2,7 @@
#include <functional>
-namespace y2019 {
-namespace control_loops {
-namespace drivetrain {
+namespace y2019::control_loops::drivetrain {
constexpr size_t EventLoopLocalizer::kMaxTargetsPerFrame;
::std::array<EventLoopLocalizer::Camera, constants::Values::kNumCameras>
@@ -110,6 +108,4 @@
localizer_.UpdateTargets(cameras_[camera], views, t);
}
-} // namespace drivetrain
-} // namespace control_loops
-} // namespace y2019
+} // namespace y2019::control_loops::drivetrain
diff --git a/y2019/control_loops/drivetrain/localized_drivetrain_test.cc b/y2019/control_loops/drivetrain/localized_drivetrain_test.cc
index 016e3b7..5aaafd7 100644
--- a/y2019/control_loops/drivetrain/localized_drivetrain_test.cc
+++ b/y2019/control_loops/drivetrain/localized_drivetrain_test.cc
@@ -15,10 +15,7 @@
// drivetrain, will behave properly. The purpose of this test is to make sure
// that all the pieces fit together, not to test the algorithms themselves.
-namespace y2019 {
-namespace control_loops {
-namespace drivetrain {
-namespace testing {
+namespace y2019::control_loops::drivetrain::testing {
using frc971::control_loops::drivetrain::DrivetrainConfig;
using frc971::control_loops::drivetrain::Goal;
@@ -399,7 +396,4 @@
EXPECT_NEAR(HPSlotLeft().abs_pos().y(), drivetrain_plant_.state().y(), 0.2);
}
-} // namespace testing
-} // namespace drivetrain
-} // namespace control_loops
-} // namespace y2019
+} // namespace y2019::control_loops::drivetrain::testing
diff --git a/y2019/control_loops/drivetrain/localizer_test.cc b/y2019/control_loops/drivetrain/localizer_test.cc
index 28f0235..7f0b13d 100644
--- a/y2019/control_loops/drivetrain/localizer_test.cc
+++ b/y2019/control_loops/drivetrain/localizer_test.cc
@@ -19,9 +19,7 @@
DEFINE_bool(plot, false, "If true, plot");
-namespace y2019 {
-namespace control_loops {
-namespace testing {
+namespace y2019::control_loops::testing {
using ::y2019::constants::Field;
@@ -694,6 +692,4 @@
/*goal_tolerance=*/0.7,
})));
-} // namespace testing
-} // namespace control_loops
-} // namespace y2019
+} // namespace y2019::control_loops::testing
diff --git a/y2019/control_loops/drivetrain/replay_localizer.cc b/y2019/control_loops/drivetrain/replay_localizer.cc
index b7d269b..80cf221 100644
--- a/y2019/control_loops/drivetrain/replay_localizer.cc
+++ b/y2019/control_loops/drivetrain/replay_localizer.cc
@@ -25,9 +25,7 @@
DEFINE_int32(start_offset, 0,
"Time, in seconds, to start replay plot after the first enable.");
-namespace y2019 {
-namespace control_loops {
-namespace drivetrain {
+namespace y2019::control_loops::drivetrain {
using ::y2019::constants::Field;
typedef TypedLocalizer<constants::Values::kNumCameras, Field::kNumTargets,
@@ -386,9 +384,7 @@
::std::vector<double> long_accel_;
};
-} // namespace drivetrain
-} // namespace control_loops
-} // namespace y2019
+} // namespace y2019::control_loops::drivetrain
int main(int argc, char *argv[]) {
gflags::ParseCommandLineFlags(&argc, &argv, false);
diff --git a/y2019/control_loops/drivetrain/target_selector.cc b/y2019/control_loops/drivetrain/target_selector.cc
index 87115ae..b078dba 100644
--- a/y2019/control_loops/drivetrain/target_selector.cc
+++ b/y2019/control_loops/drivetrain/target_selector.cc
@@ -2,8 +2,7 @@
#include "aos/json_to_flatbuffer.h"
-namespace y2019 {
-namespace control_loops {
+namespace y2019::control_loops {
constexpr double TargetSelector::kFakeFov;
@@ -100,5 +99,4 @@
return true;
}
-} // namespace control_loops
-} // namespace y2019
+} // namespace y2019::control_loops
diff --git a/y2019/control_loops/drivetrain/target_selector_test.cc b/y2019/control_loops/drivetrain/target_selector_test.cc
index d4ef6da..b0767e5 100644
--- a/y2019/control_loops/drivetrain/target_selector_test.cc
+++ b/y2019/control_loops/drivetrain/target_selector_test.cc
@@ -5,9 +5,7 @@
#include "aos/events/simulated_event_loop.h"
#include "y2019/control_loops/superstructure/superstructure_goal_generated.h"
-namespace y2019 {
-namespace control_loops {
-namespace testing {
+namespace y2019::control_loops::testing {
typedef ::frc971::control_loops::TypedPose<double> Pose;
typedef ::Eigen::Matrix<double, 5, 1> State;
@@ -190,6 +188,4 @@
true, CargoNearLeft(),
/*expected_radius=*/0.0}));
-} // namespace testing
-} // namespace control_loops
-} // namespace y2019
+} // namespace y2019::control_loops::testing
diff --git a/y2019/control_loops/superstructure/collision_avoidance.cc b/y2019/control_loops/superstructure/collision_avoidance.cc
index 9c2bf93..c52141b 100644
--- a/y2019/control_loops/superstructure/collision_avoidance.cc
+++ b/y2019/control_loops/superstructure/collision_avoidance.cc
@@ -7,9 +7,7 @@
#include "y2019/control_loops/superstructure/superstructure_goal_generated.h"
#include "y2019/control_loops/superstructure/superstructure_status_generated.h"
-namespace y2019 {
-namespace control_loops {
-namespace superstructure {
+namespace y2019::control_loops::superstructure {
constexpr double CollisionAvoidance::kElevatorClearHeight;
constexpr double CollisionAvoidance::kElevatorClearWristDownHeight;
@@ -188,6 +186,4 @@
}
}
-} // namespace superstructure
-} // namespace control_loops
-} // namespace y2019
+} // namespace y2019::control_loops::superstructure
diff --git a/y2019/control_loops/superstructure/collision_avoidance_tests.cc b/y2019/control_loops/superstructure/collision_avoidance_tests.cc
index 68449d6..f22e9ba 100644
--- a/y2019/control_loops/superstructure/collision_avoidance_tests.cc
+++ b/y2019/control_loops/superstructure/collision_avoidance_tests.cc
@@ -6,10 +6,7 @@
#include "y2019/control_loops/superstructure/superstructure_goal_generated.h"
#include "y2019/control_loops/superstructure/superstructure_status_generated.h"
-namespace y2019 {
-namespace control_loops {
-namespace superstructure {
-namespace testing {
+namespace y2019::control_loops::superstructure::testing {
using aos::FlatbufferDetachedBuffer;
using frc971::control_loops::AbsoluteEncoderProfiledJointStatus;
@@ -484,7 +481,4 @@
INSTANTIATE_TEST_SUITE_P(CollisionAvoidancePieceTest, CollisionAvoidanceTests,
::testing::Bool());
-} // namespace testing
-} // namespace superstructure
-} // namespace control_loops
-} // namespace y2019
+} // namespace y2019::control_loops::superstructure::testing
diff --git a/y2019/control_loops/superstructure/superstructure.cc b/y2019/control_loops/superstructure/superstructure.cc
index e796f0b..8a38e7a 100644
--- a/y2019/control_loops/superstructure/superstructure.cc
+++ b/y2019/control_loops/superstructure/superstructure.cc
@@ -6,9 +6,7 @@
#include "frc971/control_loops/static_zeroing_single_dof_profiled_subsystem.h"
#include "y2019/status_light_generated.h"
-namespace y2019 {
-namespace control_loops {
-namespace superstructure {
+namespace y2019::control_loops::superstructure {
using frc971::control_loops::AbsoluteEncoderProfiledJointStatus;
using frc971::control_loops::PotAndAbsoluteEncoderProfiledJointStatus;
@@ -214,6 +212,4 @@
}
}
-} // namespace superstructure
-} // namespace control_loops
-} // namespace y2019
+} // namespace y2019::control_loops::superstructure
diff --git a/y2019/control_loops/superstructure/superstructure_lib_test.cc b/y2019/control_loops/superstructure/superstructure_lib_test.cc
index a09913b..c2bf988 100644
--- a/y2019/control_loops/superstructure/superstructure_lib_test.cc
+++ b/y2019/control_loops/superstructure/superstructure_lib_test.cc
@@ -17,10 +17,7 @@
#include "y2019/control_loops/superstructure/superstructure.h"
#include "y2019/control_loops/superstructure/wrist/wrist_plant.h"
-namespace y2019 {
-namespace control_loops {
-namespace superstructure {
-namespace testing {
+namespace y2019::control_loops::superstructure::testing {
namespace {
constexpr double kNoiseScalar = 0.01;
@@ -1010,7 +1007,4 @@
RunFor(chrono::seconds(2));
}
-} // namespace testing
-} // namespace superstructure
-} // namespace control_loops
-} // namespace y2019
+} // namespace y2019::control_loops::superstructure::testing
diff --git a/y2019/control_loops/superstructure/vacuum.cc b/y2019/control_loops/superstructure/vacuum.cc
index fda123e..a9fbd8c 100644
--- a/y2019/control_loops/superstructure/vacuum.cc
+++ b/y2019/control_loops/superstructure/vacuum.cc
@@ -7,9 +7,7 @@
#include "y2019/control_loops/superstructure/superstructure_goal_generated.h"
#include "y2019/control_loops/superstructure/superstructure_output_generated.h"
-namespace y2019 {
-namespace control_loops {
-namespace superstructure {
+namespace y2019::control_loops::superstructure {
namespace chrono = ::std::chrono;
@@ -86,6 +84,4 @@
monotonic_now < last_disable_has_piece_time_ + chrono::milliseconds(250);
}
-} // namespace superstructure
-} // namespace control_loops
-} // namespace y2019
+} // namespace y2019::control_loops::superstructure