Initial interation on writing out MLD partition/cell data
This commit is contained in:
committed by
Patrick Niklaus
parent
757e7ca936
commit
ff0a98196f
@@ -134,6 +134,26 @@ class FileReader
|
||||
ReadInto(data.data(), count);
|
||||
}
|
||||
|
||||
template <typename T> std::size_t GetVectorMemorySize()
|
||||
{
|
||||
const auto count = ReadElementCount64();
|
||||
Skip<T>(count);
|
||||
return sizeof(count) + sizeof(T) * count;
|
||||
}
|
||||
|
||||
template <typename T> void *DeserializeVector(void *begin, const void *end)
|
||||
{
|
||||
auto count = ReadElementCount64();
|
||||
auto required = reinterpret_cast<char *>(begin) + sizeof(count) + sizeof(T) * count;
|
||||
if (required > end)
|
||||
throw util::exception("Not enough memory ");
|
||||
|
||||
*reinterpret_cast<decltype(count) *>(begin) = count;
|
||||
ReadInto(reinterpret_cast<T *>(reinterpret_cast<char *>(begin) + sizeof(decltype(count))),
|
||||
count);
|
||||
return required;
|
||||
}
|
||||
|
||||
bool ReadAndCheckFingerprint()
|
||||
{
|
||||
auto loaded_fingerprint = ReadOne<util::FingerPrint>();
|
||||
|
||||
@@ -56,7 +56,9 @@ const constexpr char *block_id_to_name[] = {"NAME_CHAR_DATA",
|
||||
"LANE_DESCRIPTION_OFFSETS",
|
||||
"LANE_DESCRIPTION_MASKS",
|
||||
"TURN_WEIGHT_PENALTIES",
|
||||
"TURN_DURATION_PENALTIES"};
|
||||
"TURN_DURATION_PENALTIES",
|
||||
"MLD_CELL_PARTITION",
|
||||
"MLD_CELL_STORAGE"};
|
||||
|
||||
struct DataLayout
|
||||
{
|
||||
@@ -101,6 +103,8 @@ struct DataLayout
|
||||
LANE_DESCRIPTION_MASKS,
|
||||
TURN_WEIGHT_PENALTIES,
|
||||
TURN_DURATION_PENALTIES,
|
||||
MLD_CELL_PARTITION,
|
||||
MLD_CELL_STORAGE,
|
||||
NUM_BLOCKS
|
||||
};
|
||||
|
||||
|
||||
@@ -69,6 +69,8 @@ struct StorageConfig final
|
||||
boost::filesystem::path intersection_class_path;
|
||||
boost::filesystem::path turn_lane_data_path;
|
||||
boost::filesystem::path turn_lane_description_path;
|
||||
boost::filesystem::path mld_partition_path;
|
||||
boost::filesystem::path mld_storage_path;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user