Apply clang-format

This commit is contained in:
Patrick Niklaus
2017-03-09 22:45:27 +00:00
committed by Patrick Niklaus
parent 94e2a8598d
commit fb552fd751
11 changed files with 64 additions and 65 deletions
+3 -4
View File
@@ -12,8 +12,7 @@ namespace extractor
namespace io
{
template <>
void read(const boost::filesystem::path &path, SegmentDataContainer &segment_data)
template <> void read(const boost::filesystem::path &path, SegmentDataContainer &segment_data)
{
const auto fingerprint = storage::io::FileReader::HasNoFingerprint;
storage::io::FileReader reader{path, fingerprint};
@@ -36,7 +35,8 @@ void read(const boost::filesystem::path &path, SegmentDataContainer &segment_dat
reader.ReadInto(segment_data.rev_durations.data(), segment_data.rev_durations.size());
}
template <> void write(const boost::filesystem::path &path, const SegmentDataContainer &segment_data)
template <>
void write(const boost::filesystem::path &path, const SegmentDataContainer &segment_data)
{
const auto fingerprint = storage::io::FileWriter::HasNoFingerprint;
storage::io::FileWriter writer{path, fingerprint};
@@ -54,7 +54,6 @@ template <> void write(const boost::filesystem::path &path, const SegmentDataCon
writer.WriteFrom(segment_data.fwd_durations.data(), segment_data.fwd_durations.size());
writer.WriteFrom(segment_data.rev_durations.data(), segment_data.rev_durations.size());
}
}
}
}
+16 -15
View File
@@ -4,9 +4,9 @@
#include "util/shared_memory_vector_wrapper.hpp"
#include "util/typedefs.hpp"
#include <boost/filesystem/path.hpp>
#include <boost/range/adaptor/reversed.hpp>
#include <boost/range/iterator_range.hpp>
#include <boost/filesystem/path.hpp>
#include <unordered_map>
@@ -28,9 +28,11 @@ template <bool UseShareMemory> class SegmentDataContainerImpl;
namespace io
{
template <bool UseShareMemory>
inline void read(const boost::filesystem::path &path, detail::SegmentDataContainerImpl<UseShareMemory> &segment_data);
inline void read(const boost::filesystem::path &path,
detail::SegmentDataContainerImpl<UseShareMemory> &segment_data);
template <bool UseShareMemory>
inline void write(const boost::filesystem::path &path, const detail::SegmentDataContainerImpl<UseShareMemory> &segment_data);
inline void write(const boost::filesystem::path &path,
const detail::SegmentDataContainerImpl<UseShareMemory> &segment_data);
}
namespace detail
@@ -61,19 +63,19 @@ template <bool UseShareMemory> class SegmentDataContainerImpl
}
// TODO these random access functions can be removed after we implemented #3737
auto& ForwardDuration(const DirectionalGeometryID id, const SegmentOffset offset)
auto &ForwardDuration(const DirectionalGeometryID id, const SegmentOffset offset)
{
return fwd_durations[index[id] + 1 + offset];
}
auto& ReverseDuration(const DirectionalGeometryID id, const SegmentOffset offset)
auto &ReverseDuration(const DirectionalGeometryID id, const SegmentOffset offset)
{
return rev_durations[index[id] + offset];
}
auto& ForwardWeight(const DirectionalGeometryID id, const SegmentOffset offset)
auto &ForwardWeight(const DirectionalGeometryID id, const SegmentOffset offset)
{
return fwd_weights[index[id] + 1 + offset];
}
auto& ReverseWeight(const DirectionalGeometryID id, const SegmentOffset offset)
auto &ReverseWeight(const DirectionalGeometryID id, const SegmentOffset offset)
{
return rev_weights[index[id] + offset];
}
@@ -129,15 +131,14 @@ template <bool UseShareMemory> class SegmentDataContainerImpl
return boost::adaptors::reverse(boost::make_iterator_range(begin, end));
}
auto GetNumberOfSegments() const
{
return fwd_weights.size();
}
auto GetNumberOfSegments() const { return fwd_weights.size(); }
friend void io::read<UseShareMemory>(const boost::filesystem::path &path,
detail::SegmentDataContainerImpl<UseShareMemory> &segment_data);
friend void io::write<UseShareMemory>(const boost::filesystem::path &path,
const detail::SegmentDataContainerImpl<UseShareMemory> &segment_data);
friend void
io::read<UseShareMemory>(const boost::filesystem::path &path,
detail::SegmentDataContainerImpl<UseShareMemory> &segment_data);
friend void
io::write<UseShareMemory>(const boost::filesystem::path &path,
const detail::SegmentDataContainerImpl<UseShareMemory> &segment_data);
private:
Vector<std::uint32_t> index;