Nest some more namespaces
Did someone previously suggest that all namespace had been
nested? Silly.
Signed-off-by: Stephan Pleines <pleines.stephan@gmail.com>
Change-Id: I22278c1caaeba8b47dc46fb2ed3078c20a11e190
diff --git a/aos/actions/actions.h b/aos/actions/actions.h
index 1b5d607..f60f20b 100644
--- a/aos/actions/actions.h
+++ b/aos/actions/actions.h
@@ -14,9 +14,7 @@
#include "aos/json_to_flatbuffer.h"
#include "aos/logging/logging.h"
-namespace aos {
-namespace common {
-namespace actions {
+namespace aos::common::actions {
class Action;
@@ -407,8 +405,6 @@
}
}
-} // namespace actions
-} // namespace common
-} // namespace aos
+} // namespace aos::common::actions
#endif // AOS_ACTIONS_ACTIONS_H_
diff --git a/aos/actions/actor.h b/aos/actions/actor.h
index c27f7dd..1c8806b 100644
--- a/aos/actions/actor.h
+++ b/aos/actions/actor.h
@@ -12,9 +12,7 @@
#include "aos/util/phased_loop.h"
#include "frc971/control_loops/control_loop.h"
-namespace aos {
-namespace common {
-namespace actions {
+namespace aos::common::actions {
template <class T>
class ActorBase {
@@ -229,8 +227,6 @@
return ans;
}
-} // namespace actions
-} // namespace common
-} // namespace aos
+} // namespace aos::common::actions
#endif // AOS_ACTIONS_ACTOR_H_
diff --git a/aos/events/epoll.h b/aos/events/epoll.h
index 2b7eb76..526c6a7 100644
--- a/aos/events/epoll.h
+++ b/aos/events/epoll.h
@@ -12,8 +12,7 @@
#include "aos/time/time.h"
-namespace aos {
-namespace internal {
+namespace aos::internal {
// Class wrapping up timerfd.
class TimerFd {
@@ -187,7 +186,6 @@
std::vector<std::function<void()>> before_epoll_wait_functions_;
};
-} // namespace internal
-} // namespace aos
+} // namespace aos::internal
#endif // AOS_EVENTS_EPOLL_H_
diff --git a/aos/events/event_loop_param_test.h b/aos/events/event_loop_param_test.h
index d466a1e..f2b16c5 100644
--- a/aos/events/event_loop_param_test.h
+++ b/aos/events/event_loop_param_test.h
@@ -18,8 +18,7 @@
#include "aos/network/message_bridge_server_schema.h"
#include "aos/network/timestamp_schema.h"
-namespace aos {
-namespace testing {
+namespace aos::testing {
class EventLoopTestFactory {
public:
@@ -398,7 +397,6 @@
// Sends a test message with value 0 with the given sender
RawSender::Error SendTestMessage(aos::Sender<TestMessage> &sender);
-} // namespace testing
-} // namespace aos
+} // namespace aos::testing
#endif // _AOS_EVENTS_EVENT_LOOP_PARAM_TEST_H_
diff --git a/aos/events/logging/log_namer.h b/aos/events/logging/log_namer.h
index 5374acf..e0660eb 100644
--- a/aos/events/logging/log_namer.h
+++ b/aos/events/logging/log_namer.h
@@ -15,8 +15,7 @@
#include "aos/events/logging/logger_generated.h"
#include "aos/uuid.h"
-namespace aos {
-namespace logger {
+namespace aos::logger {
class LogNamer;
@@ -650,7 +649,6 @@
void OpenNodeWriter(const Node *source_node, NewDataWriter *data_writer);
};
-} // namespace logger
-} // namespace aos
+} // namespace aos::logger
#endif // AOS_EVENTS_LOGGING_LOG_NAMER_H_
diff --git a/aos/events/logging/log_reader.h b/aos/events/logging/log_reader.h
index 901bf32..fb19e78 100644
--- a/aos/events/logging/log_reader.h
+++ b/aos/events/logging/log_reader.h
@@ -32,8 +32,7 @@
#include "aos/util/threaded_queue.h"
#include "aos/uuid.h"
-namespace aos {
-namespace logger {
+namespace aos::logger {
class EventNotifier;
@@ -950,7 +949,6 @@
ConfigRemapper config_remapper_;
};
-} // namespace logger
-} // namespace aos
+} // namespace aos::logger
#endif // AOS_EVENTS_LOGGING_LOG_READER_H_
diff --git a/aos/events/logging/log_writer.h b/aos/events/logging/log_writer.h
index ec02b7d..eb69d7e 100644
--- a/aos/events/logging/log_writer.h
+++ b/aos/events/logging/log_writer.h
@@ -17,8 +17,7 @@
#include "aos/time/time.h"
#include "aos/uuid.h"
-namespace aos {
-namespace logger {
+namespace aos::logger {
// Packs the provided configuration into the separate config LogFileHeader
// container.
@@ -377,7 +376,6 @@
std::chrono::nanoseconds logging_delay_ = std::chrono::nanoseconds(0);
};
-} // namespace logger
-} // namespace aos
+} // namespace aos::logger
#endif // AOS_EVENTS_LOGGING_LOG_WRITER_H_
diff --git a/aos/events/logging/logfile_sorting.h b/aos/events/logging/logfile_sorting.h
index 825a210..4f2a2e2 100644
--- a/aos/events/logging/logfile_sorting.h
+++ b/aos/events/logging/logfile_sorting.h
@@ -15,8 +15,7 @@
#include "aos/time/time.h"
#include "aos/uuid.h"
-namespace aos {
-namespace logger {
+namespace aos::logger {
struct Boots {
// Maps the boot UUID to the boot count. Since boot UUIDs are unique, we
@@ -309,7 +308,6 @@
std::vector<std::string> logger_nodes_;
};
-} // namespace logger
-} // namespace aos
+} // namespace aos::logger
#endif // AOS_EVENTS_LOGGING_LOGFILE_SORTING_H_
diff --git a/aos/events/logging/multinode_logger_test_lib.h b/aos/events/logging/multinode_logger_test_lib.h
index f5fb4cf..63604d6 100644
--- a/aos/events/logging/multinode_logger_test_lib.h
+++ b/aos/events/logging/multinode_logger_test_lib.h
@@ -17,9 +17,7 @@
#include "aos/events/logging/lzma_encoder.h"
#endif
-namespace aos {
-namespace logger {
-namespace testing {
+namespace aos::logger::testing {
struct CompressionParams {
std::string_view extension;
@@ -196,8 +194,6 @@
typedef MultinodeLoggerTest MultinodeLoggerDeathTest;
-} // namespace testing
-} // namespace logger
-} // namespace aos
+} // namespace aos::logger::testing
#endif // AOS_EVENTS_LOGGING_MULTINODE_LOGGER_TEST_LIB_H
diff --git a/aos/events/logging/replay_channels.h b/aos/events/logging/replay_channels.h
index f9ec144..0922acc 100644
--- a/aos/events/logging/replay_channels.h
+++ b/aos/events/logging/replay_channels.h
@@ -4,12 +4,10 @@
#include <string>
#include <vector>
-namespace aos {
-namespace logger {
+namespace aos::logger {
// Vector of pair of name and type of the channel
using ReplayChannels = std::vector<std::pair<std::string, std::string>>;
// Vector of channel indices
using ReplayChannelIndices = std::vector<size_t>;
-} // namespace logger
-} // namespace aos
+} // namespace aos::logger
#endif // AOS_EVENTS_LOGGING_REPLAY_CHANNELS_H_
diff --git a/aos/events/message_counter.h b/aos/events/message_counter.h
index 418c1eb..13d75c5 100644
--- a/aos/events/message_counter.h
+++ b/aos/events/message_counter.h
@@ -3,8 +3,7 @@
#include "aos/events/event_loop.h"
-namespace aos {
-namespace testing {
+namespace aos::testing {
// Simple class to count messages on a channel easily. This only counts
// messages published while running.
@@ -22,7 +21,6 @@
size_t count_ = 0;
};
-} // namespace testing
-} // namespace aos
+} // namespace aos::testing
#endif // AOS_EVENTS_MESSAGE_COUNTER_H_
diff --git a/aos/events/simulated_network_bridge.h b/aos/events/simulated_network_bridge.h
index faa6398..14a7321 100644
--- a/aos/events/simulated_network_bridge.h
+++ b/aos/events/simulated_network_bridge.h
@@ -8,8 +8,7 @@
#include "aos/network/remote_message_generated.h"
#include "aos/network/timestamp_channel.h"
-namespace aos {
-namespace message_bridge {
+namespace aos::message_bridge {
class RawMessageDelayer;
@@ -235,7 +234,6 @@
std::vector<std::unique_ptr<DelayersVector>> delayers_list_;
};
-} // namespace message_bridge
-} // namespace aos
+} // namespace aos::message_bridge
#endif // AOS_EVENTS_SIMULATED_NETWORK_BRIDGE_H_
diff --git a/aos/events/timing_statistics.h b/aos/events/timing_statistics.h
index 3c8c741..ef07254 100644
--- a/aos/events/timing_statistics.h
+++ b/aos/events/timing_statistics.h
@@ -6,8 +6,7 @@
#include "aos/events/event_loop_generated.h"
#include "aos/util/error_counter.h"
-namespace aos {
-namespace internal {
+namespace aos::internal {
// Class to compute statistics for the timing report.
class TimingStatistic {
@@ -113,7 +112,6 @@
timing::Timer *timer = nullptr;
};
-} // namespace internal
-} // namespace aos
+} // namespace aos::internal
#endif // AOS_EVENTS_TIMING_STATISTICS_H_
diff --git a/aos/ipc_lib/index.h b/aos/ipc_lib/index.h
index 434da7c..75f1e9b 100644
--- a/aos/ipc_lib/index.h
+++ b/aos/ipc_lib/index.h
@@ -23,8 +23,7 @@
#endif
#endif
-namespace aos {
-namespace ipc_lib {
+namespace aos::ipc_lib {
struct AtomicQueueIndex;
class AtomicIndex;
@@ -305,7 +304,6 @@
::std::atomic<Index::IndexType> index_;
};
-} // namespace ipc_lib
-} // namespace aos
+} // namespace aos::ipc_lib
#endif // AOS_IPC_LIB_INDEX_H_
diff --git a/aos/ipc_lib/lockless_queue.h b/aos/ipc_lib/lockless_queue.h
index 14a11b6..4f867b9 100644
--- a/aos/ipc_lib/lockless_queue.h
+++ b/aos/ipc_lib/lockless_queue.h
@@ -18,8 +18,7 @@
#include "aos/time/time.h"
#include "aos/uuid.h"
-namespace aos {
-namespace ipc_lib {
+namespace aos::ipc_lib {
// Structure to hold the state required to wake a watcher.
struct Watcher {
@@ -478,7 +477,6 @@
// Prints to stdout the data inside the queue for debugging.
void PrintLocklessQueueMemory(const LocklessQueueMemory *memory);
-} // namespace ipc_lib
-} // namespace aos
+} // namespace aos::ipc_lib
#endif // AOS_IPC_LIB_LOCKLESS_QUEUE_H_
diff --git a/aos/ipc_lib/lockless_queue_memory.h b/aos/ipc_lib/lockless_queue_memory.h
index 713d9cd..70fc8a8 100644
--- a/aos/ipc_lib/lockless_queue_memory.h
+++ b/aos/ipc_lib/lockless_queue_memory.h
@@ -10,8 +10,7 @@
#include "aos/ipc_lib/lockless_queue.h"
#include "aos/time/time.h"
-namespace aos {
-namespace ipc_lib {
+namespace aos::ipc_lib {
struct LocklessQueueMemory {
// This is held during initialization. Cleanup after dead processes happens
@@ -194,7 +193,6 @@
}
};
-} // namespace ipc_lib
-} // namespace aos
+} // namespace aos::ipc_lib
#endif // AOS_IPC_LIB_LOCKLESS_QUEUE_MEMORY_H_
diff --git a/aos/ipc_lib/lockless_queue_stepping.cc b/aos/ipc_lib/lockless_queue_stepping.cc
index e819795..40d1631 100644
--- a/aos/ipc_lib/lockless_queue_stepping.cc
+++ b/aos/ipc_lib/lockless_queue_stepping.cc
@@ -25,9 +25,7 @@
#ifdef SUPPORTS_SHM_ROBUSTNESS_TEST
-namespace aos {
-namespace ipc_lib {
-namespace testing {
+namespace aos::ipc_lib::testing {
namespace {
pid_t gettid() { return syscall(SYS_gettid); }
@@ -458,8 +456,6 @@
pid_t SharedTid::Get() { return *tid_; }
-} // namespace testing
-} // namespace ipc_lib
-} // namespace aos
+} // namespace aos::ipc_lib::testing
#endif // SUPPORTS_SHM_ROBSTNESS_TEST
diff --git a/aos/ipc_lib/lockless_queue_stepping.h b/aos/ipc_lib/lockless_queue_stepping.h
index 7aab193..590534f 100644
--- a/aos/ipc_lib/lockless_queue_stepping.h
+++ b/aos/ipc_lib/lockless_queue_stepping.h
@@ -7,9 +7,7 @@
#include "aos/ipc_lib/lockless_queue.h"
#include "aos/ipc_lib/lockless_queue_memory.h"
-namespace aos {
-namespace ipc_lib {
-namespace testing {
+namespace aos::ipc_lib::testing {
#if defined(__ARM_EABI__)
// There are various reasons why we might not actually be able to do this
@@ -142,8 +140,6 @@
#endif
-} // namespace testing
-} // namespace ipc_lib
-} // namespace aos
+} // namespace aos::ipc_lib::testing
#endif // AOS_IPC_LIB_LOCKLESS_QUEUE_STEPPING_H_
diff --git a/aos/ipc_lib/memory_mapped_queue.h b/aos/ipc_lib/memory_mapped_queue.h
index 653dc77..bd766c1 100644
--- a/aos/ipc_lib/memory_mapped_queue.h
+++ b/aos/ipc_lib/memory_mapped_queue.h
@@ -6,8 +6,7 @@
#include "aos/configuration.h"
#include "aos/ipc_lib/lockless_queue.h"
-namespace aos {
-namespace ipc_lib {
+namespace aos::ipc_lib {
std::string ShmFolder(std::string_view shm_base, const Channel *channel);
@@ -58,7 +57,6 @@
const void *const_data_;
};
-} // namespace ipc_lib
-} // namespace aos
+} // namespace aos::ipc_lib
#endif // AOS_IPC_LIB_MEMORY_MAPPED_QUEUE_H_
diff --git a/aos/ipc_lib/queue_racer.h b/aos/ipc_lib/queue_racer.h
index f0a2684..2cbe3ed 100644
--- a/aos/ipc_lib/queue_racer.h
+++ b/aos/ipc_lib/queue_racer.h
@@ -5,8 +5,7 @@
#include "aos/ipc_lib/lockless_queue.h"
-namespace aos {
-namespace ipc_lib {
+namespace aos::ipc_lib {
struct ThreadState;
@@ -97,7 +96,6 @@
size_t) { return true; };
};
-} // namespace ipc_lib
-} // namespace aos
+} // namespace aos::ipc_lib
#endif // AOS_IPC_LIB_QUEUE_RACER_H_
diff --git a/aos/ipc_lib/signalfd.h b/aos/ipc_lib/signalfd.h
index a6991de..014ad5c 100644
--- a/aos/ipc_lib/signalfd.h
+++ b/aos/ipc_lib/signalfd.h
@@ -6,8 +6,7 @@
#include <initializer_list>
-namespace aos {
-namespace ipc_lib {
+namespace aos::ipc_lib {
// Class to manage a signalfd.
class SignalFd {
@@ -34,7 +33,6 @@
sigset_t blocked_mask_;
};
-} // namespace ipc_lib
-} // namespace aos
+} // namespace aos::ipc_lib
#endif // AOS_IPC_LIB_SIGNALFD_H_
diff --git a/aos/libc/dirname.h b/aos/libc/dirname.h
index fa733d7..c549b3c 100644
--- a/aos/libc/dirname.h
+++ b/aos/libc/dirname.h
@@ -3,13 +3,11 @@
#include <string>
-namespace aos {
-namespace libc {
+namespace aos::libc {
// Thread-safe version of dirname(3).
::std::string Dirname(const ::std::string &path);
-} // namespace libc
-} // namespace aos
+} // namespace aos::libc
#endif // AOS_LIBC_DIRNAME_H_
diff --git a/aos/logging/dynamic_logging.h b/aos/logging/dynamic_logging.h
index 0dfd181..e3d3a6f 100644
--- a/aos/logging/dynamic_logging.h
+++ b/aos/logging/dynamic_logging.h
@@ -9,8 +9,7 @@
// and make changes to the log level of the current application based on that
// message. Currently the only supported command is changing the global vlog
// level.
-namespace aos {
-namespace logging {
+namespace aos::logging {
class DynamicLogging {
public:
@@ -23,5 +22,4 @@
DISALLOW_COPY_AND_ASSIGN(DynamicLogging);
};
-} // namespace logging
-} // namespace aos
+} // namespace aos::logging
diff --git a/aos/logging/log_namer.h b/aos/logging/log_namer.h
index a993d31..0c32d5d 100644
--- a/aos/logging/log_namer.h
+++ b/aos/logging/log_namer.h
@@ -4,8 +4,7 @@
#include <optional>
#include <string>
-namespace aos {
-namespace logging {
+namespace aos::logging {
// Returns the correct filename to log to, blocking until the usb drive
// filesystem mounts, incrementing the number on the end of the filename, and
// setting up a symlink at basename-current.
@@ -19,7 +18,6 @@
// the usb drive.
std::optional<std::string> MaybeGetLogName(const char *basename);
-} // namespace logging
-} // namespace aos
+} // namespace aos::logging
#endif // AOS_LOGGING_LOG_NAMER_H_
diff --git a/aos/network/message_bridge_client_lib.h b/aos/network/message_bridge_client_lib.h
index 2df3599..56d2563 100644
--- a/aos/network/message_bridge_client_lib.h
+++ b/aos/network/message_bridge_client_lib.h
@@ -14,8 +14,7 @@
#include "aos/network/sctp_config_request_generated.h"
#include "aos/network/sctp_lib.h"
-namespace aos {
-namespace message_bridge {
+namespace aos::message_bridge {
// Structure to hold per channel state.
struct SctpClientChannelState {
@@ -165,7 +164,6 @@
aos::Sender<SctpConfigRequest> sctp_config_request_;
};
-} // namespace message_bridge
-} // namespace aos
+} // namespace aos::message_bridge
#endif // AOS_NETWORK_MESSAGE_BRIDGE_CLIENT_LIB_H_
diff --git a/aos/network/message_bridge_client_status.h b/aos/network/message_bridge_client_status.h
index 033af95..4e6c2c5 100644
--- a/aos/network/message_bridge_client_status.h
+++ b/aos/network/message_bridge_client_status.h
@@ -8,8 +8,7 @@
#include "aos/network/message_bridge_client_generated.h"
#include "aos/network/timestamp_filter.h"
-namespace aos {
-namespace message_bridge {
+namespace aos::message_bridge {
// This class is responsible for publishing the (filtered) client side
// statistics periodically.
@@ -88,7 +87,6 @@
bool send_ = true;
};
-} // namespace message_bridge
-} // namespace aos
+} // namespace aos::message_bridge
#endif // AOS_NETWORK_MESSAGE_BRIDGE_CLIENT_STATUS_H_
diff --git a/aos/network/message_bridge_protocol.h b/aos/network/message_bridge_protocol.h
index 23a6e0f..0783466 100644
--- a/aos/network/message_bridge_protocol.h
+++ b/aos/network/message_bridge_protocol.h
@@ -7,8 +7,7 @@
#include "aos/network/connect_generated.h"
#include "aos/uuid.h"
-namespace aos {
-namespace message_bridge {
+namespace aos::message_bridge {
// The protocol between the message_bridge_client and server is pretty simple.
// The overarching design philosophy is that the server sends data to the
@@ -41,7 +40,6 @@
std::string_view remote_name, const UUID &boot_uuid,
std::string_view config_sha256);
-} // namespace message_bridge
-} // namespace aos
+} // namespace aos::message_bridge
#endif // AOS_NETWORK_MESSAGE_BRIDGE_PROTOCOL_H_
diff --git a/aos/network/message_bridge_server_lib.h b/aos/network/message_bridge_server_lib.h
index b8377c6..b47a4e6 100644
--- a/aos/network/message_bridge_server_lib.h
+++ b/aos/network/message_bridge_server_lib.h
@@ -20,8 +20,7 @@
#include "aos/network/timestamp_channel.h"
#include "aos/network/timestamp_generated.h"
-namespace aos {
-namespace message_bridge {
+namespace aos::message_bridge {
// See message_bridge_protocol.h for more details about the protocol.
@@ -237,7 +236,6 @@
aos::Sender<SctpConfigRequest> sctp_config_request_;
};
-} // namespace message_bridge
-} // namespace aos
+} // namespace aos::message_bridge
#endif // AOS_NETWORK_MESSAGE_BRIDGE_SERVER_LIB_H_
diff --git a/aos/network/message_bridge_server_status.h b/aos/network/message_bridge_server_status.h
index 3945d57..8bdf4a8 100644
--- a/aos/network/message_bridge_server_status.h
+++ b/aos/network/message_bridge_server_status.h
@@ -13,8 +13,7 @@
#include "aos/network/timestamp_generated.h"
#include "aos/time/time.h"
-namespace aos {
-namespace message_bridge {
+namespace aos::message_bridge {
// This class encapsulates the server side of sending server statistics and
// managing timestamp offsets.
@@ -158,7 +157,6 @@
std::vector<flatbuffers::Offset<ClientOffset>> client_offsets_;
};
-} // namespace message_bridge
-} // namespace aos
+} // namespace aos::message_bridge
#endif // AOS_NETWORK_MESSAGE_BRIDGE_SERVER_STATUS_H_
diff --git a/aos/network/multinode_timestamp_filter.h b/aos/network/multinode_timestamp_filter.h
index 828c489..893f816 100644
--- a/aos/network/multinode_timestamp_filter.h
+++ b/aos/network/multinode_timestamp_filter.h
@@ -16,8 +16,7 @@
#include "aos/network/timestamp_filter.h"
#include "aos/time/time.h"
-namespace aos {
-namespace message_bridge {
+namespace aos::message_bridge {
// Problem description for NewtonSolver.
class Problem {
@@ -667,7 +666,6 @@
std::vector<size_t> source_node_index_;
};
-} // namespace message_bridge
-} // namespace aos
+} // namespace aos::message_bridge
#endif // AOS_NETWORK_MULTINODE_TIMESTAMP_FILTER_H_
diff --git a/aos/network/rawrtc.h b/aos/network/rawrtc.h
index 7908124..57153f0 100644
--- a/aos/network/rawrtc.h
+++ b/aos/network/rawrtc.h
@@ -13,8 +13,7 @@
#include "flatbuffers/flatbuffers.h"
#include "glog/logging.h"
-namespace aos {
-namespace web_proxy {
+namespace aos::web_proxy {
// TODO(austin): This doesn't allow streaming data in.
#define CHECK_RAWRTC(x) \
@@ -215,7 +214,6 @@
std::function<void(std::shared_ptr<ScopedDataChannel>)> on_data_channel_;
};
-} // namespace web_proxy
-} // namespace aos
+} // namespace aos::web_proxy
#endif // AOS_NETWORK_RAWRTC_H_
diff --git a/aos/network/sctp_client.h b/aos/network/sctp_client.h
index 9b9265e..952d0e9 100644
--- a/aos/network/sctp_client.h
+++ b/aos/network/sctp_client.h
@@ -11,8 +11,7 @@
#include "aos/network/sctp_lib.h"
#include "aos/unique_malloc_ptr.h"
-namespace aos {
-namespace message_bridge {
+namespace aos::message_bridge {
// Class to encapsulate everything needed to be a SCTP client.
class SctpClient {
@@ -73,7 +72,6 @@
sctp_assoc_t sac_assoc_id_ = 0;
};
-} // namespace message_bridge
-} // namespace aos
+} // namespace aos::message_bridge
#endif // AOS_NETWORK_SCTP_CLIENT_H_
diff --git a/aos/network/sctp_lib.h b/aos/network/sctp_lib.h
index 0d021a9..3430be8 100644
--- a/aos/network/sctp_lib.h
+++ b/aos/network/sctp_lib.h
@@ -19,8 +19,7 @@
#define HAS_SCTP_AUTH LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0)
-namespace aos {
-namespace message_bridge {
+namespace aos::message_bridge {
constexpr bool HasSctpAuth() { return HAS_SCTP_AUTH; }
@@ -202,7 +201,6 @@
// Returns the max network buffer available for writing for a socket.
size_t ReadWMemMax();
-} // namespace message_bridge
-} // namespace aos
+} // namespace aos::message_bridge
#endif // AOS_NETWORK_SCTP_LIB_H_
diff --git a/aos/network/sctp_server.h b/aos/network/sctp_server.h
index e641fd8..996645e 100644
--- a/aos/network/sctp_server.h
+++ b/aos/network/sctp_server.h
@@ -19,8 +19,7 @@
#include "aos/network/sctp_lib.h"
#include "aos/unique_malloc_ptr.h"
-namespace aos {
-namespace message_bridge {
+namespace aos::message_bridge {
class SctpServer {
public:
@@ -74,7 +73,6 @@
SctpReadWrite sctp_;
};
-} // namespace message_bridge
-} // namespace aos
+} // namespace aos::message_bridge
#endif // AOS_NETWORK_SCTP_SERVER_H_
diff --git a/aos/network/testing_time_converter.h b/aos/network/testing_time_converter.h
index ae85cee..768d0a2 100644
--- a/aos/network/testing_time_converter.h
+++ b/aos/network/testing_time_converter.h
@@ -10,8 +10,7 @@
#include "aos/network/multinode_timestamp_filter.h"
#include "aos/time/time.h"
-namespace aos {
-namespace message_bridge {
+namespace aos::message_bridge {
// Simple class to which uses InterpolatedTimeConverter to produce an
// interpolated timeline. Should only be used for testing.
@@ -77,7 +76,6 @@
std::map<std::pair<size_t, size_t>, UUID> boot_uuids_;
};
-} // namespace message_bridge
-} // namespace aos
+} // namespace aos::message_bridge
#endif // AOS_NETWORK_TESTING_TIME_CONVERTER_H_
diff --git a/aos/network/timestamp_channel.h b/aos/network/timestamp_channel.h
index c8e88d9..7e48a00 100644
--- a/aos/network/timestamp_channel.h
+++ b/aos/network/timestamp_channel.h
@@ -11,8 +11,7 @@
#include "aos/events/event_loop.h"
#include "aos/network/remote_message_generated.h"
-namespace aos {
-namespace message_bridge {
+namespace aos::message_bridge {
// Class to find the corresponding channel where timestamps for a specified data
// channel and connection will be logged.
@@ -89,7 +88,6 @@
timestamp_loggers_;
};
-} // namespace message_bridge
-} // namespace aos
+} // namespace aos::message_bridge
#endif // AOS_NETWORK_TIMESTAMP_CHANNEL_
diff --git a/aos/network/timestamp_filter.h b/aos/network/timestamp_filter.h
index b1aff86..be9318e 100644
--- a/aos/network/timestamp_filter.h
+++ b/aos/network/timestamp_filter.h
@@ -14,8 +14,7 @@
#include "aos/events/logging/boot_timestamp.h"
#include "aos/time/time.h"
-namespace aos {
-namespace message_bridge {
+namespace aos::message_bridge {
// Max velocity to clamp the filter to in seconds/second.
typedef std::ratio<1, 1000> MaxVelocityRatio;
@@ -951,7 +950,6 @@
const Node *node_b_;
};
-} // namespace message_bridge
-} // namespace aos
+} // namespace aos::message_bridge
#endif // AOS_EVENTS_LOGGING_TIMESTAMP_FILTER_H_
diff --git a/aos/network/web_proxy.h b/aos/network/web_proxy.h
index db7fb5b..dec3078 100644
--- a/aos/network/web_proxy.h
+++ b/aos/network/web_proxy.h
@@ -19,8 +19,7 @@
#include "seasocks/StringUtil.h"
#include "seasocks/WebSocket.h"
-namespace aos {
-namespace web_proxy {
+namespace aos::web_proxy {
class Connection;
class Subscriber;
@@ -242,7 +241,6 @@
std::shared_ptr<ScopedDataChannel> channel_;
};
-} // namespace web_proxy
-} // namespace aos
+} // namespace aos::web_proxy
#endif // AOS_NETWORK_WEB_PROXY_H_
diff --git a/aos/network/web_proxy_utils.h b/aos/network/web_proxy_utils.h
index c5e2716..e35708a 100644
--- a/aos/network/web_proxy_utils.h
+++ b/aos/network/web_proxy_utils.h
@@ -4,8 +4,7 @@
#include "aos/flatbuffers.h"
#include "aos/network/web_proxy_generated.h"
-namespace aos {
-namespace web_proxy {
+namespace aos::web_proxy {
int GetPacketCount(const Context &context);
@@ -24,5 +23,4 @@
std::vector<FlatbufferDetachedBuffer<MessageHeader>> PackBuffer(
absl::Span<const uint8_t> span);
-} // namespace web_proxy
-} // namespace aos
+} // namespace aos::web_proxy
diff --git a/aos/seasocks/seasocks_logger.h b/aos/seasocks/seasocks_logger.h
index 64f13fa..f60ab48 100644
--- a/aos/seasocks/seasocks_logger.h
+++ b/aos/seasocks/seasocks_logger.h
@@ -3,8 +3,7 @@
#include "seasocks/PrintfLogger.h"
-namespace aos {
-namespace seasocks {
+namespace aos::seasocks {
class SeasocksLogger : public ::seasocks::PrintfLogger {
public:
@@ -13,7 +12,6 @@
void log(::seasocks::Logger::Level level, const char *message) override;
};
-} // namespace seasocks
-} // namespace aos
+} // namespace aos::seasocks
#endif // AOS_SEASOCKS_SEASOCKS_LOGGER_H_
diff --git a/aos/starter/mock_starter.h b/aos/starter/mock_starter.h
index a0c1b76..212f1e5 100644
--- a/aos/starter/mock_starter.h
+++ b/aos/starter/mock_starter.h
@@ -6,8 +6,7 @@
#include "aos/starter/starter_rpc_generated.h"
#include "aos/starter/starterd_lib.h"
-namespace aos {
-namespace starter {
+namespace aos::starter {
// Simple mock of starterd that updates the starter status message to act as
// though applications are started and stopped when requested.
@@ -50,5 +49,4 @@
std::vector<std::unique_ptr<MockStarter>> mock_starters_;
};
-} // namespace starter
-} // namespace aos
+} // namespace aos::starter
diff --git a/aos/starter/starter_rpc_lib.h b/aos/starter/starter_rpc_lib.h
index eadf5c6..ae2450c 100644
--- a/aos/starter/starter_rpc_lib.h
+++ b/aos/starter/starter_rpc_lib.h
@@ -11,8 +11,7 @@
#include "aos/starter/starter_generated.h"
#include "aos/starter/starter_rpc_generated.h"
-namespace aos {
-namespace starter {
+namespace aos::starter {
// Data required to command that starter start/stop/restart a given application.
struct ApplicationCommand {
@@ -119,7 +118,6 @@
const aos::FlatbufferVector<aos::starter::Status>>>
GetStarterStatus(const aos::Configuration *config, const aos::Node *node);
-} // namespace starter
-} // namespace aos
+} // namespace aos::starter
#endif // AOS_STARTER_STARTER_RPC_LIB_H_
diff --git a/aos/starter/starterd_lib.h b/aos/starter/starterd_lib.h
index 92b20fa..3779c84 100644
--- a/aos/starter/starterd_lib.h
+++ b/aos/starter/starterd_lib.h
@@ -19,8 +19,7 @@
#include "aos/starter/subprocess.h"
#include "aos/util/top.h"
-namespace aos {
-namespace starter {
+namespace aos::starter {
const aos::Channel *StatusChannelForNode(const aos::Configuration *config,
const aos::Node *node);
@@ -107,7 +106,6 @@
DISALLOW_COPY_AND_ASSIGN(Starter);
};
-} // namespace starter
-} // namespace aos
+} // namespace aos::starter
#endif // AOS_STARTER_STARTERD_LIB_H_
diff --git a/aos/testing/flatbuffer_eq.h b/aos/testing/flatbuffer_eq.h
index b560aaa..8a42b5f 100644
--- a/aos/testing/flatbuffer_eq.h
+++ b/aos/testing/flatbuffer_eq.h
@@ -7,8 +7,7 @@
#include "aos/flatbuffers.h"
#include "aos/json_to_flatbuffer.h"
-namespace aos {
-namespace testing {
+namespace aos::testing {
// Use FlatbufferUnwrapped to instantiate this.
template <typename T>
@@ -85,7 +84,6 @@
new FlatbufferEqMatcher(aos::FlatbufferVector<T>(expected))));
}
-} // namespace testing
-} // namespace aos
+} // namespace aos::testing
#endif // AOS_TESTING_FLATBUFFER_EQ_H_
diff --git a/aos/testing/path.h b/aos/testing/path.h
index 7f4187d..ebe63fe 100644
--- a/aos/testing/path.h
+++ b/aos/testing/path.h
@@ -4,13 +4,11 @@
#include <string>
#include <string_view>
-namespace aos {
-namespace testing {
+namespace aos::testing {
// Returns the path to the provided artifact which works
std::string ArtifactPath(std::string_view path);
-} // namespace testing
-} // namespace aos
+} // namespace aos::testing
#endif // AOS_TESTING_PATH_H_
diff --git a/aos/testing/test_logging.h b/aos/testing/test_logging.h
index 5e01879..3671aa1 100644
--- a/aos/testing/test_logging.h
+++ b/aos/testing/test_logging.h
@@ -3,8 +3,7 @@
#include "aos/time/time.h"
-namespace aos {
-namespace testing {
+namespace aos::testing {
// Enables the logging framework for use during a gtest test.
// It will print out all WARNING and above messages all of the time. It will
@@ -23,7 +22,6 @@
// we want to use graphing tools to verify what's happening.
void ForcePrintLogsDuringTests();
-} // namespace testing
-} // namespace aos
+} // namespace aos::testing
#endif // AOS_TESTING_TEST_LOGGING_H_
diff --git a/aos/testing/test_shm.h b/aos/testing/test_shm.h
index a1c79ee..658a72d 100644
--- a/aos/testing/test_shm.h
+++ b/aos/testing/test_shm.h
@@ -3,8 +3,7 @@
#include "aos/ipc_lib/shared_mem.h"
-namespace aos {
-namespace testing {
+namespace aos::testing {
// Manages creating and cleaning up "shared memory" which works within this
// process and any that it fork(2)s.
@@ -18,7 +17,6 @@
struct aos_core global_core_data_;
};
-} // namespace testing
-} // namespace aos
+} // namespace aos::testing
#endif // AOS_TESTING_TEST_SHM_H_
diff --git a/aos/testing/tmpdir.h b/aos/testing/tmpdir.h
index 8eabf86..bf8e7d7 100644
--- a/aos/testing/tmpdir.h
+++ b/aos/testing/tmpdir.h
@@ -3,8 +3,7 @@
#include <string>
-namespace aos {
-namespace testing {
+namespace aos::testing {
// Returns a usable temporary directory.
std::string TestTmpDir();
@@ -13,7 +12,6 @@
// otherwise.
void SetTestShmBase();
-} // namespace testing
-} // namespace aos
+} // namespace aos::testing
#endif // AOS_TESTING_TMPDIR_H_
diff --git a/aos/time/time.h b/aos/time/time.h
index cd4ecda..1a5cbd1 100644
--- a/aos/time/time.h
+++ b/aos/time/time.h
@@ -118,15 +118,13 @@
#ifdef __linux__
-namespace std {
-namespace this_thread {
+namespace std::this_thread {
// Template specialization for monotonic_clock, since we can use clock_nanosleep
// with TIMER_ABSTIME and get very precise absolute time sleeps.
template <>
void sleep_until(const ::aos::monotonic_clock::time_point &end_time);
-} // namespace this_thread
-} // namespace std
+} // namespace std::this_thread
#endif // __linux__
diff --git a/aos/util/death_test_log_implementation.h b/aos/util/death_test_log_implementation.h
index 7765b5b..e35f365 100644
--- a/aos/util/death_test_log_implementation.h
+++ b/aos/util/death_test_log_implementation.h
@@ -6,8 +6,7 @@
#include "aos/logging/context.h"
#include "aos/logging/implementations.h"
-namespace aos {
-namespace util {
+namespace aos::util {
// Prints all FATAL messages to stderr and then abort(3)s before the regular
// stuff can print out anything else. Ignores all other messages.
@@ -27,7 +26,6 @@
}
};
-} // namespace util
-} // namespace aos
+} // namespace aos::util
#endif // AOS_UTIL_DEATH_TEST_LOG_IMPLEMENTATION_H_
diff --git a/aos/util/file.h b/aos/util/file.h
index e825e4c..e0d5c6b 100644
--- a/aos/util/file.h
+++ b/aos/util/file.h
@@ -17,8 +17,7 @@
#include "aos/scoped/scoped_fd.h"
-namespace aos {
-namespace util {
+namespace aos::util {
// Returns the complete contents of filename. LOG(FATAL)s if any errors are
// encountered.
@@ -122,7 +121,6 @@
aos::ScopedFD file_;
};
-} // namespace util
-} // namespace aos
+} // namespace aos::util
#endif // AOS_UTIL_FILE_H_
diff --git a/aos/util/log_interval.h b/aos/util/log_interval.h
index d346852..08d06bb 100644
--- a/aos/util/log_interval.h
+++ b/aos/util/log_interval.h
@@ -6,8 +6,7 @@
#include "aos/logging/logging.h"
#include "aos/time/time.h"
-namespace aos {
-namespace util {
+namespace aos::util {
// A class to help with logging things that happen a lot only occasionally.
//
@@ -91,7 +90,6 @@
const char *context_ = NULL;
};
-} // namespace util
-} // namespace aos
+} // namespace aos::util
#endif // AOS_UTIL_LOG_INTERVAL_H_
diff --git a/aos/util/math.h b/aos/util/math.h
index 5efc3c9..5a3df11 100644
--- a/aos/util/math.h
+++ b/aos/util/math.h
@@ -5,8 +5,7 @@
#include "Eigen/Dense"
-namespace aos {
-namespace math {
+namespace aos::math {
// Normalizes an angle to be in (-M_PI, M_PI]
template <typename Scalar>
@@ -64,7 +63,6 @@
return (C.y() - A.y()) * (B.x() - A.x()) > (B.y() - A.y()) * (C.x() - A.x());
}
-} // namespace math
-} // namespace aos
+} // namespace aos::math
#endif // AOS_UTIL_MATH_H_
diff --git a/aos/util/phased_loop.h b/aos/util/phased_loop.h
index 64a3302..dc2dc96 100644
--- a/aos/util/phased_loop.h
+++ b/aos/util/phased_loop.h
@@ -5,8 +5,7 @@
#include "aos/time/time.h"
-namespace aos {
-namespace time {
+namespace aos::time {
// Handles sleeping until a fixed offset from some time interval.
class PhasedLoop {
@@ -88,7 +87,6 @@
monotonic_clock::time_point last_time_ = monotonic_clock::epoch();
};
-} // namespace time
-} // namespace aos
+} // namespace aos::time
#endif // AOS_UTIL_PHASED_LOOP_H_
diff --git a/aos/util/threaded_consumer.h b/aos/util/threaded_consumer.h
index 95ec79a..3bf4f36 100644
--- a/aos/util/threaded_consumer.h
+++ b/aos/util/threaded_consumer.h
@@ -10,8 +10,7 @@
#include "aos/mutex/mutex.h"
#include "aos/realtime.h"
-namespace aos {
-namespace util {
+namespace aos::util {
// This class implements a threadpool of a single worker that accepts work
// from the main thread through a queue and executes it at a different realtime
@@ -96,7 +95,6 @@
std::thread worker_thread_;
};
-} // namespace util
-} // namespace aos
+} // namespace aos::util
#endif // AOS_UTIL_THREADWORKER_H_
diff --git a/aos/util/trapezoid_profile.h b/aos/util/trapezoid_profile.h
index 944c423..6669777 100644
--- a/aos/util/trapezoid_profile.h
+++ b/aos/util/trapezoid_profile.h
@@ -6,8 +6,7 @@
#include "aos/macros.h"
#include "aos/time/time.h"
-namespace aos {
-namespace util {
+namespace aos::util {
// Calculates a trapezoidal motion profile (like for a control loop's goals).
// Supports having the end speed and position changed in the middle.
@@ -63,7 +62,6 @@
DISALLOW_COPY_AND_ASSIGN(TrapezoidProfile);
};
-} // namespace util
-} // namespace aos
+} // namespace aos::util
#endif // AOS_UTIL_TRAPEZOID_PROFILE_H_
diff --git a/aos/util/wrapping_counter.h b/aos/util/wrapping_counter.h
index ea79ec6..0353e2e 100644
--- a/aos/util/wrapping_counter.h
+++ b/aos/util/wrapping_counter.h
@@ -3,8 +3,7 @@
#include <cstdint>
-namespace aos {
-namespace util {
+namespace aos::util {
// Deals correctly with 1-byte counters which wrap.
// This is only possible if the counter never wraps twice between Update calls.
@@ -28,7 +27,6 @@
uint8_t last_count_;
};
-} // namespace util
-} // namespace aos
+} // namespace aos::util
#endif // AOS_UTIL_WRAPPING_COUNTER_H_
diff --git a/aos/vision/blob/codec.h b/aos/vision/blob/codec.h
index b8a8089..5872b44 100644
--- a/aos/vision/blob/codec.h
+++ b/aos/vision/blob/codec.h
@@ -5,8 +5,7 @@
#include "aos/vision/blob/range_image.h"
-namespace aos {
-namespace vision {
+namespace aos::vision {
template <typename T>
struct IntCodec {
@@ -45,7 +44,6 @@
// Parses a blob from data (Advancing data pointer by the size of the image).
const char *ParseBlobList(BlobList *blob_list, const char *data);
-} // namespace vision
-} // namespace aos
+} // namespace aos::vision
#endif // _AOS_VISION_BLOB_CODEC_H_
diff --git a/aos/vision/blob/contour.h b/aos/vision/blob/contour.h
index bbd59a9..c192a75 100644
--- a/aos/vision/blob/contour.h
+++ b/aos/vision/blob/contour.h
@@ -4,8 +4,7 @@
#include "aos/vision/blob/range_image.h"
#include "aos/vision/blob/region_alloc.h"
-namespace aos {
-namespace vision {
+namespace aos::vision {
// Countour nodes are slingly linked list chains of pixels that go around
// the boundary of a blob.
@@ -35,7 +34,6 @@
ContourNode *RangeImgToContour(const RangeImage &rimg,
AnalysisAllocator *alloc);
-} // namespace vision
-} // namespace aos
+} // namespace aos::vision
#endif // _AOS_VIISON_BLOB_CONTOUR_H_
diff --git a/aos/vision/blob/disjoint_set.h b/aos/vision/blob/disjoint_set.h
index 38cca1d..6343e9f 100644
--- a/aos/vision/blob/disjoint_set.h
+++ b/aos/vision/blob/disjoint_set.h
@@ -3,8 +3,7 @@
#include <vector>
-namespace aos {
-namespace vision {
+namespace aos::vision {
// Disjoint set algorithm, which is similar to what this class does:
// https://en.wikipedia.org/wiki/Disjoint-set_data_structure
@@ -40,7 +39,6 @@
std::vector<int> nodes_;
};
-} // namespace vision
-} // namespace aos
+} // namespace aos::vision
#endif // _AOS_VISION_BLOB_DISJOINT_SET_H_
diff --git a/aos/vision/blob/find_blob.h b/aos/vision/blob/find_blob.h
index d633354..f811749 100644
--- a/aos/vision/blob/find_blob.h
+++ b/aos/vision/blob/find_blob.h
@@ -3,14 +3,12 @@
#include "aos/vision/blob/range_image.h"
-namespace aos {
-namespace vision {
+namespace aos::vision {
// Uses disjoint sets to group ranges into disjoint RangeImage.
// ranges that overlap are grouped into the same output RangeImage.
BlobList FindBlobs(const RangeImage &input_image);
-} // namespace vision
-} // namespace aos
+} // namespace aos::vision
#endif // AOS_VISION_BLOB_FIND_BLOB_H_
diff --git a/aos/vision/blob/hierarchical_contour_merge.h b/aos/vision/blob/hierarchical_contour_merge.h
index 9dd471d..83243bd 100644
--- a/aos/vision/blob/hierarchical_contour_merge.h
+++ b/aos/vision/blob/hierarchical_contour_merge.h
@@ -6,8 +6,7 @@
#include "aos/vision/blob/contour.h"
#include "aos/vision/blob/range_image.h"
-namespace aos {
-namespace vision {
+namespace aos::vision {
struct FittedLine {
Point st;
@@ -19,7 +18,6 @@
void HierarchicalMerge(ContourNode *stval, std::vector<FittedLine> *fit_lines,
float merge_rate = 4.0, int min_len = 15);
-} // namespace vision
-} // namespace aos
+} // namespace aos::vision
#endif // _AOS_VISION_BLOB_HIERARCHICAL_CONTOUR_MERGE_H_
diff --git a/aos/vision/blob/move_scale.h b/aos/vision/blob/move_scale.h
index 061da5c..94a9e9d 100644
--- a/aos/vision/blob/move_scale.h
+++ b/aos/vision/blob/move_scale.h
@@ -7,8 +7,7 @@
#include "aos/vision/blob/range_image.h"
#include "aos/vision/image/image_types.h"
-namespace aos {
-namespace vision {
+namespace aos::vision {
// Sums img into bbox. bbox is constructed empty and grows with each call
// to GetBBox.
@@ -22,7 +21,6 @@
RangeImage MoveScale(const RangeImage &img, int dx, int dy, int scale);
-} // namespace vision
-} // namespace aos
+} // namespace aos::vision
#endif // AOS_VISION_BLOB_MOVE_SCALE_H_
diff --git a/aos/vision/blob/range_image.h b/aos/vision/blob/range_image.h
index d962788..10e801f 100644
--- a/aos/vision/blob/range_image.h
+++ b/aos/vision/blob/range_image.h
@@ -5,8 +5,7 @@
#include "aos/vision/image/image_types.h"
-namespace aos {
-namespace vision {
+namespace aos::vision {
struct Point {
int x;
@@ -100,7 +99,6 @@
// Debug print range image as ### for the ranges.
void DebugPrint(const BlobList &blobl);
-} // namespace vision
-} // namespace aos
+} // namespace aos::vision
#endif // _AOS_VISION_BLOB_RANGE_IMAGE_H_
diff --git a/aos/vision/blob/region_alloc.h b/aos/vision/blob/region_alloc.h
index 3275f3e..101ee6a 100644
--- a/aos/vision/blob/region_alloc.h
+++ b/aos/vision/blob/region_alloc.h
@@ -9,8 +9,7 @@
#include <utility>
#include <vector>
-namespace aos {
-namespace vision {
+namespace aos::vision {
// Region based allocator. Used for arena allocations in vision code.
// Example use: Storing contour nodes.
@@ -52,7 +51,6 @@
size_t used_size_ = 0;
};
-} // namespace vision
-} // namespace aos
+} // namespace aos::vision
#endif // _AOS_VISION_IMAGE_REGION_ALLOC_H_
diff --git a/aos/vision/blob/stream_view.h b/aos/vision/blob/stream_view.h
index 0db69e5..9841ca2 100644
--- a/aos/vision/blob/stream_view.h
+++ b/aos/vision/blob/stream_view.h
@@ -7,8 +7,7 @@
#include "aos/vision/debug/debug_window.h"
#include "aos/vision/image/image_types.h"
-namespace aos {
-namespace vision {
+namespace aos::vision {
class BlobStreamViewer : public DebugWindow {
public:
@@ -85,7 +84,6 @@
ImageValue image_;
};
-} // namespace vision
-} // namespace aos
+} // namespace aos::vision
#endif // _AOS_VISION_BLOB_STREAM_VIEW_H_
diff --git a/aos/vision/blob/test_utils.h b/aos/vision/blob/test_utils.h
index e0c706c..92c087c 100644
--- a/aos/vision/blob/test_utils.h
+++ b/aos/vision/blob/test_utils.h
@@ -3,8 +3,7 @@
#include "aos/vision/blob/range_image.h"
-namespace aos {
-namespace vision {
+namespace aos::vision {
// For tests. Loads a RangeImage from a constant string.
//
@@ -18,7 +17,6 @@
// )"
RangeImage LoadFromTestData(int mini, const char *data);
-} // namespace vision
-} // namespace aos
+} // namespace aos::vision
#endif // AOS_VISION_BLOB_TEST_UTILS_H_
diff --git a/aos/vision/blob/transpose.h b/aos/vision/blob/transpose.h
index 632f270..7ac6626 100644
--- a/aos/vision/blob/transpose.h
+++ b/aos/vision/blob/transpose.h
@@ -3,8 +3,7 @@
#include "aos/vision/blob/range_image.h"
-namespace aos {
-namespace vision {
+namespace aos::vision {
RangeImage Transpose(const RangeImage &img);
inline std::vector<RangeImage> Transpose(const std::vector<RangeImage> &imgs) {
@@ -14,7 +13,6 @@
return out;
}
-} // namespace vision
-} // namespace aos
+} // namespace aos::vision
#endif // _y2017_VISION_ROT90_H_
diff --git a/aos/vision/debug/debug_framework.h b/aos/vision/debug/debug_framework.h
index c2913c2..b9fa166 100644
--- a/aos/vision/debug/debug_framework.h
+++ b/aos/vision/debug/debug_framework.h
@@ -7,8 +7,7 @@
#include "aos/vision/image/camera_params.pb.h"
#include "aos/vision/image/image_types.h"
-namespace aos {
-namespace vision {
+namespace aos::vision {
class BlobStreamViewer;
@@ -120,7 +119,6 @@
void DebugFrameworkMain(int argc, char **argv, FilterHarness *filter,
CameraParams camera_params);
-} // namespace vision
-} // namespace aos
+} // namespace aos::vision
#endif // _AOS_VISION_DEBUG_DEBUG_FRAMEWORK_H_
diff --git a/aos/vision/debug/debug_window.h b/aos/vision/debug/debug_window.h
index 573cef5..dcbc5f7 100644
--- a/aos/vision/debug/debug_window.h
+++ b/aos/vision/debug/debug_window.h
@@ -8,8 +8,7 @@
#include "aos/vision/debug/overlay.h"
#include "aos/vision/image/image_types.h"
-namespace aos {
-namespace vision {
+namespace aos::vision {
// Implement Cairo version of RenderInterface.
class CairoRender : public RenderInterface {
@@ -84,7 +83,6 @@
std::unique_ptr<Internals> self;
};
-} // namespace vision
-} // namespace aos
+} // namespace aos::vision
#endif // AOS_VISION_DEBUG_DEBUG_WINDOW_H_
diff --git a/aos/vision/debug/overlay.h b/aos/vision/debug/overlay.h
index a2cecd5..3beb9e1 100644
--- a/aos/vision/debug/overlay.h
+++ b/aos/vision/debug/overlay.h
@@ -8,8 +8,7 @@
#include "aos/vision/math/segment.h"
#include "aos/vision/math/vector.h"
-namespace aos {
-namespace vision {
+namespace aos::vision {
// Abstract away rendering to avoid compiling gtk for arm.
// This should match a reduced cairo rendering api.
@@ -239,7 +238,6 @@
std::vector<std::pair<Vector<2>, double>> circles_;
};
-} // namespace vision
-} // namespace aos
+} // namespace aos::vision
#endif // _AOS_VISION_IMAGE_DEBUG_OVERLAY_H_
diff --git a/aos/vision/events/epoll_events.h b/aos/vision/events/epoll_events.h
index 7562f41..e3eeb85 100644
--- a/aos/vision/events/epoll_events.h
+++ b/aos/vision/events/epoll_events.h
@@ -11,8 +11,7 @@
#include "aos/scoped/scoped_fd.h"
#include "aos/time/time.h"
-namespace aos {
-namespace events {
+namespace aos::events {
class EpollLoop;
@@ -129,7 +128,6 @@
::std::vector<EpollWait *> waits_;
};
-} // namespace events
-} // namespace aos
+} // namespace aos::events
#endif // AOS_VISION_EVENTS_EPOLL_EVENTS_H_
diff --git a/aos/vision/events/socket_types.h b/aos/vision/events/socket_types.h
index 237bdb1..d3dcf42 100644
--- a/aos/vision/events/socket_types.h
+++ b/aos/vision/events/socket_types.h
@@ -12,8 +12,7 @@
#include "aos/vision/events/tcp_server.h"
#include "aos/vision/image/image_types.h"
-namespace aos {
-namespace events {
+namespace aos::events {
// Simple TCP client connection that sends messages prefixed by length.
// Useful to broadcast to a message all connected clients.
@@ -89,7 +88,6 @@
}
};
-} // namespace events
-} // namespace aos
+} // namespace aos::events
#endif // _AOS_VISION_EVENTS_SOCKET_TYPES_H_
diff --git a/aos/vision/events/tcp_client.h b/aos/vision/events/tcp_client.h
index 8aab2cc..16d7265 100644
--- a/aos/vision/events/tcp_client.h
+++ b/aos/vision/events/tcp_client.h
@@ -6,8 +6,7 @@
#include "aos/vision/events/epoll_events.h"
-namespace aos {
-namespace events {
+namespace aos::events {
// Handles the client connection logic to hostname:portno
class TcpClient : public EpollEvent {
@@ -17,7 +16,6 @@
// Implement ReadEvent from EpollEvent to use this class.
};
-} // namespace events
-} // namespace aos
+} // namespace aos::events
#endif // _AOS_VISION_DEBUG_TCP_CLIENT_H_
diff --git a/aos/vision/events/tcp_server.h b/aos/vision/events/tcp_server.h
index 24b4f60..49a5a8c 100644
--- a/aos/vision/events/tcp_server.h
+++ b/aos/vision/events/tcp_server.h
@@ -7,8 +7,7 @@
#include "aos/vision/events/epoll_events.h"
#include "aos/vision/events/intrusive_free_list.h"
-namespace aos {
-namespace events {
+namespace aos::events {
// Non-templatized base class of TCP server.
// TCPServer implements Construct which specializes the client connection
@@ -71,7 +70,6 @@
}
};
-} // namespace events
-} // namespace aos
+} // namespace aos::events
#endif // _AOS_VISION_EVENTS_TCP_SERVER_H_
diff --git a/aos/vision/events/udp.h b/aos/vision/events/udp.h
index 3c16b28..4acb04d 100644
--- a/aos/vision/events/udp.h
+++ b/aos/vision/events/udp.h
@@ -12,8 +12,7 @@
#include "aos/macros.h"
#include "aos/scoped/scoped_fd.h"
-namespace aos {
-namespace events {
+namespace aos::events {
// Simple wrapper around a transmitting UDP socket.
//
@@ -67,7 +66,6 @@
DISALLOW_COPY_AND_ASSIGN(RXUdpSocket);
};
-} // namespace events
-} // namespace aos
+} // namespace aos::events
#endif // AOS_VISION_EVENTS_UDP_H_
diff --git a/aos/vision/image/image_dataset.h b/aos/vision/image/image_dataset.h
index 7801cec..10ea13e 100644
--- a/aos/vision/image/image_dataset.h
+++ b/aos/vision/image/image_dataset.h
@@ -4,8 +4,7 @@
#include <string>
#include <vector>
-namespace aos {
-namespace vision {
+namespace aos::vision {
struct DatasetFrame {
// TODO: These should be V4L formats ideally.
@@ -17,7 +16,6 @@
DatasetFrame LoadFile(const std::string &jpeg_filename);
-} // namespace vision
-} // namespace aos
+} // namespace aos::vision
#endif // _AOS_VISION_IMAGE_IMAGE_DATASET_H_
diff --git a/aos/vision/image/image_stream.h b/aos/vision/image/image_stream.h
index 60e71b2..5a45c6f 100644
--- a/aos/vision/image/image_stream.h
+++ b/aos/vision/image/image_stream.h
@@ -7,8 +7,7 @@
#include "aos/vision/image/camera_params.pb.h"
#include "aos/vision/image/reader.h"
-namespace aos {
-namespace vision {
+namespace aos::vision {
// Converts a camera reader into a virtual base class that calls ProcessImage
// on each new image.
@@ -45,7 +44,6 @@
std::unique_ptr<::camera::Reader> reader_;
};
-} // namespace vision
-} // namespace aos
+} // namespace aos::vision
#endif // AOS_VISION_IMAGE_IMAGE_STREAM_H_
diff --git a/aos/vision/image/image_types.h b/aos/vision/image/image_types.h
index ee56f7d..80b802e 100644
--- a/aos/vision/image/image_types.h
+++ b/aos/vision/image/image_types.h
@@ -8,8 +8,7 @@
#include <sstream>
#include <string_view>
-namespace aos {
-namespace vision {
+namespace aos::vision {
// Bounding box for a RangeImage.
struct ImageBBox {
@@ -106,7 +105,6 @@
using ImagePtr = Array2dPtr<PixelRef>;
using ImageValue = ValueArray2d<PixelRef>;
-} // namespace vision
-} // namespace aos
+} // namespace aos::vision
#endif // _AOS_VISION_IMAGE_IMAGE_TYPES_H_
diff --git a/aos/vision/image/jpeg_routines.h b/aos/vision/image/jpeg_routines.h
index 59ad296..4bac976 100644
--- a/aos/vision/image/jpeg_routines.h
+++ b/aos/vision/image/jpeg_routines.h
@@ -8,8 +8,7 @@
#include "aos/vision/image/image_types.h"
-namespace aos {
-namespace vision {
+namespace aos::vision {
// Returns true if successful false if an error was encountered.
// Will decompress data into out. Out must be of the right size
@@ -32,7 +31,6 @@
return ProcessJpeg(data, value->data());
}
-} // namespace vision
-} // namespace aos
+} // namespace aos::vision
#endif // _AOS_VISION_IMAGE_JPEGROUTINES_H_
diff --git a/aos/vision/math/segment.h b/aos/vision/math/segment.h
index d6927cb..8ae91e3 100644
--- a/aos/vision/math/segment.h
+++ b/aos/vision/math/segment.h
@@ -5,8 +5,7 @@
#include "aos/vision/math/vector.h"
-namespace aos {
-namespace vision {
+namespace aos::vision {
template <int Size>
class Segment {
@@ -76,7 +75,6 @@
Vector<Size> B_;
};
-} // namespace vision
-} // namespace aos
+} // namespace aos::vision
#endif // AOS_VISION_COMP_GEO_VECTOR_H_
diff --git a/aos/vision/math/vector.h b/aos/vision/math/vector.h
index 5e7520f..ce29901 100644
--- a/aos/vision/math/vector.h
+++ b/aos/vision/math/vector.h
@@ -5,8 +5,7 @@
#include "Eigen/Dense"
-namespace aos {
-namespace vision {
+namespace aos::vision {
// Represents an n-dimensional vector of doubles with various convenient
// shortcuts for common operations.
@@ -222,7 +221,6 @@
return nv;
}
-} // namespace vision
-} // namespace aos
+} // namespace aos::vision
#endif // AOS_VISION_MATH_VECTOR_H_