Skip to content

Commit

Permalink
Merge pull request #6480 from Project-OSRM/nested_namespace
Browse files Browse the repository at this point in the history
Nested namespace
  • Loading branch information
DennisOSRM authored Dec 21, 2022
2 parents 1204b74 + 26987f9 commit 95c4523
Show file tree
Hide file tree
Showing 457 changed files with 930 additions and 2,938 deletions.
2 changes: 2 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ Checks: >
-misc-misplaced-const,
-misc-definitions-in-headers,
-misc-unused-parameters,
modernize-concat-nested-namespaces,
modernize-use-using,
performance-*,
-performance-noexcept-move-constructor,
-performance-no-int-to-ptr,
Expand Down
7 changes: 2 additions & 5 deletions include/contractor/contract_excludable_graph.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
#include "contractor/graph_contractor_adaptors.hpp"
#include "contractor/query_graph.hpp"

namespace osrm
{
namespace contractor
namespace osrm::contractor
{

using GraphAndFilter = std::tuple<QueryGraph, std::vector<std::vector<bool>>>;
Expand Down Expand Up @@ -94,7 +92,6 @@ inline auto contractExcludableGraph(ContractorGraph contractor_graph_,
return GraphAndFilter{QueryGraph{num_nodes, edge_container.edges},
edge_container.MakeEdgeFilters()};
}
} // namespace contractor
} // namespace osrm
} // namespace osrm::contractor

#endif
7 changes: 2 additions & 5 deletions include/contractor/contracted_edge_container.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@
#include <numeric>
#include <vector>

namespace osrm
{
namespace contractor
namespace osrm::contractor
{

struct ContractedEdgeContainer
Expand Down Expand Up @@ -164,7 +162,6 @@ struct ContractedEdgeContainer
std::vector<MergedFlags> flags;
std::vector<QueryEdge> edges;
};
} // namespace contractor
} // namespace osrm
} // namespace osrm::contractor

#endif
7 changes: 2 additions & 5 deletions include/contractor/contracted_metric.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@

#include "contractor/query_graph.hpp"

namespace osrm
{
namespace contractor
namespace osrm::contractor
{

namespace detail
Expand All @@ -19,7 +17,6 @@ template <storage::Ownership Ownership> struct ContractedMetric

using ContractedMetric = detail::ContractedMetric<storage::Ownership::Container>;
using ContractedMetricView = detail::ContractedMetric<storage::Ownership::View>;
} // namespace contractor
} // namespace osrm
} // namespace osrm::contractor

#endif
7 changes: 2 additions & 5 deletions include/contractor/contractor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#include "contractor/contractor_config.hpp"

namespace osrm
{
namespace contractor
namespace osrm::contractor
{

/// Base class of osrm-contract
Expand All @@ -49,7 +47,6 @@ class Contractor
private:
ContractorConfig config;
};
} // namespace contractor
} // namespace osrm
} // namespace osrm::contractor

#endif // PROCESSING_CHAIN_HPP
7 changes: 2 additions & 5 deletions include/contractor/contractor_config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#include <string>

namespace osrm
{
namespace contractor
namespace osrm::contractor
{

struct ContractorConfig final : storage::IOConfig
Expand Down Expand Up @@ -71,7 +69,6 @@ struct ContractorConfig final : storage::IOConfig
//(e.g. 0.8 contracts 80 percent of the hierarchy, leaving a core of 20%)
double core_factor = 1.0;
};
} // namespace contractor
} // namespace osrm
} // namespace osrm::contractor

#endif // EXTRACTOR_OPTIONS_HPP
7 changes: 2 additions & 5 deletions include/contractor/contractor_graph.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
#include "util/dynamic_graph.hpp"
#include <algorithm>

namespace osrm
{
namespace contractor
namespace osrm::contractor
{

struct ContractorEdgeData
Expand Down Expand Up @@ -42,7 +40,6 @@ struct ContractorEdgeData
using ContractorGraph = util::DynamicGraph<ContractorEdgeData>;
using ContractorEdge = ContractorGraph::InputEdge;

} // namespace contractor
} // namespace osrm
} // namespace osrm::contractor

#endif // OSRM_CONTRACTOR_CONTRACTOR_GRAPH_HPP_
7 changes: 2 additions & 5 deletions include/contractor/contractor_heap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
#include "util/typedefs.hpp"
#include "util/xor_fast_hash_storage.hpp"

namespace osrm
{
namespace contractor
namespace osrm::contractor
{
struct ContractorHeapData
{
Expand All @@ -24,7 +22,6 @@ using ContractorHeap = util::QueryHeap<NodeID,
ContractorHeapData,
util::XORFastHashStorage<NodeID, NodeID>>;

} // namespace contractor
} // namespace osrm
} // namespace osrm::contractor

#endif // OSRM_CONTRACTOR_CONTRACTOR_HEAP_HPP_
7 changes: 2 additions & 5 deletions include/contractor/contractor_search.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@

#include <cstddef>

namespace osrm
{
namespace contractor
namespace osrm::contractor
{

void search(ContractorHeap &heap,
Expand All @@ -20,7 +18,6 @@ void search(ContractorHeap &heap,
const EdgeWeight weight_limit,
const NodeID forbidden_node);

} // namespace contractor
} // namespace osrm
} // namespace osrm::contractor

#endif // OSRM_CONTRACTOR_DIJKSTRA_HPP
7 changes: 2 additions & 5 deletions include/contractor/crc32_processor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@

#include <iterator>

namespace osrm
{
namespace contractor
namespace osrm::contractor
{

class IteratorbasedCRC32
Expand Down Expand Up @@ -125,7 +123,6 @@ struct RangebasedCRC32
private:
IteratorbasedCRC32 crc32;
};
} // namespace contractor
} // namespace osrm
} // namespace osrm::contractor

#endif /* ITERATOR_BASED_CRC32_H */
10 changes: 2 additions & 8 deletions include/contractor/files.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@

#include <unordered_map>

namespace osrm
{
namespace contractor
{
namespace files
namespace osrm::contractor::files
{
// reads .osrm.hsgr file
template <typename ContractedMetricT>
Expand Down Expand Up @@ -52,8 +48,6 @@ inline void writeGraph(const boost::filesystem::path &path,
serialization::write(writer, "/ch/metrics/" + pair.first, pair.second);
}
}
} // namespace files
} // namespace contractor
} // namespace osrm
} // namespace osrm::contractor::files

#endif
7 changes: 2 additions & 5 deletions include/contractor/graph_contractor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
#include <tuple>
#include <vector>

namespace osrm
{
namespace contractor
namespace osrm::contractor
{

std::vector<bool> contractGraph(ContractorGraph &graph,
Expand All @@ -37,7 +35,6 @@ inline auto contractGraph(ContractorGraph &graph,
graph, {}, std::move(node_is_contractable), std::move(node_weights), core_factor);
}

} // namespace contractor
} // namespace osrm
} // namespace osrm::contractor

#endif // OSRM_CONTRACTOR_GRAPH_CONTRACTOR_HPP
7 changes: 2 additions & 5 deletions include/contractor/graph_contractor_adaptors.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@

#include <vector>

namespace osrm
{
namespace contractor
namespace osrm::contractor
{

// Make sure to move in the input edge list!
Expand Down Expand Up @@ -177,7 +175,6 @@ template <class Edge, typename GraphT> inline std::vector<Edge> toEdges(GraphT g
return edges;
}

} // namespace contractor
} // namespace osrm
} // namespace osrm::contractor

#endif // OSRM_CONTRACTOR_GRAPH_CONTRACTION_ADAPTORS_HPP_
7 changes: 2 additions & 5 deletions include/contractor/query_edge.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@

#include <tuple>

namespace osrm
{
namespace contractor
namespace osrm::contractor
{

struct QueryEdge
Expand Down Expand Up @@ -77,7 +75,6 @@ struct QueryEdge
data.distance == right.data.distance);
}
};
} // namespace contractor
} // namespace osrm
} // namespace osrm::contractor

#endif // QUERYEDGE_HPP
7 changes: 2 additions & 5 deletions include/contractor/query_graph.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
#include "util/static_graph.hpp"
#include "util/typedefs.hpp"

namespace osrm
{
namespace contractor
namespace osrm::contractor
{

namespace detail
Expand All @@ -19,7 +17,6 @@ using QueryGraph = util::StaticGraph<typename QueryEdge::EdgeData, Ownership>;

using QueryGraph = detail::QueryGraph<storage::Ownership::Container>;
using QueryGraphView = detail::QueryGraph<storage::Ownership::View>;
} // namespace contractor
} // namespace osrm
} // namespace osrm::contractor

#endif // QUERYEDGE_HPP
10 changes: 2 additions & 8 deletions include/contractor/serialization.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@
#include "storage/serialization.hpp"
#include "storage/tar.hpp"

namespace osrm
{
namespace contractor
{
namespace serialization
namespace osrm::contractor::serialization
{

template <storage::Ownership Ownership>
Expand Down Expand Up @@ -46,8 +42,6 @@ void read(storage::tar::FileReader &reader,
metric.edge_filter[index]);
}
}
} // namespace serialization
} // namespace contractor
} // namespace osrm
} // namespace osrm::contractor::serialization

#endif
7 changes: 2 additions & 5 deletions include/customizer/cell_customizer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@

#include <unordered_set>

namespace osrm
{
namespace customizer
namespace osrm::customizer
{

class CellCustomizer
Expand Down Expand Up @@ -235,7 +233,6 @@ class CellCustomizer

const partitioner::MultiLevelPartition &partition;
};
} // namespace customizer
} // namespace osrm
} // namespace osrm::customizer

#endif // OSRM_CELLS_CUSTOMIZER_HPP
7 changes: 2 additions & 5 deletions include/customizer/cell_metric.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
#include "util/typedefs.hpp"
#include "util/vector_view.hpp"

namespace osrm
{
namespace customizer
namespace osrm::customizer
{
namespace detail
{
Expand All @@ -26,7 +24,6 @@ template <storage::Ownership Ownership> struct CellMetricImpl

using CellMetric = detail::CellMetricImpl<storage::Ownership::Container>;
using CellMetricView = detail::CellMetricImpl<storage::Ownership::View>;
} // namespace customizer
} // namespace osrm
} // namespace osrm::customizer

#endif
7 changes: 2 additions & 5 deletions include/customizer/customizer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@

#include "customizer/customizer_config.hpp"

namespace osrm
{
namespace customizer
namespace osrm::customizer
{

class Customizer
Expand All @@ -14,7 +12,6 @@ class Customizer
int Run(const CustomizationConfig &config);
};

} // namespace customizer
} // namespace osrm
} // namespace osrm::customizer

#endif // OSRM_CUSTOMIZE_CUSTOMIZER_HPP
7 changes: 2 additions & 5 deletions include/customizer/customizer_config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
#include "storage/io_config.hpp"
#include "updater/updater_config.hpp"

namespace osrm
{
namespace customizer
namespace osrm::customizer
{

struct CustomizationConfig final : storage::IOConfig
Expand Down Expand Up @@ -39,7 +37,6 @@ struct CustomizationConfig final : storage::IOConfig

updater::UpdaterConfig updater_config;
};
} // namespace customizer
} // namespace osrm
} // namespace osrm::customizer

#endif // OSRM_CUSTOMIZE_CUSTOMIZER_CONFIG_HPP
Loading

0 comments on commit 95c4523

Please sign in to comment.