diff options
author | vvvv <vvvv@ydb.tech> | 2023-07-31 18:21:04 +0300 |
---|---|---|
committer | vvvv <vvvv@ydb.tech> | 2023-07-31 18:21:04 +0300 |
commit | dec41c40e51aa407edef81a3c566a5a15780fc49 (patch) | |
tree | 4f197b596b32f35eca368121f0dff913419da9af /library/cpp/reverse_geocoder/core/region.h | |
parent | 3ca8b54c96e09eb2b65be7f09675623438d559c7 (diff) | |
download | ydb-dec41c40e51aa407edef81a3c566a5a15780fc49.tar.gz |
YQL-16239 Move purecalc to public
Diffstat (limited to 'library/cpp/reverse_geocoder/core/region.h')
-rw-r--r-- | library/cpp/reverse_geocoder/core/region.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/library/cpp/reverse_geocoder/core/region.h b/library/cpp/reverse_geocoder/core/region.h new file mode 100644 index 0000000000..4b010c7103 --- /dev/null +++ b/library/cpp/reverse_geocoder/core/region.h @@ -0,0 +1,37 @@ +#pragma once + +#include "common.h" + +namespace NReverseGeocoder { + struct Y_PACKED TRegion { + TGeoId RegionId; + TNumber KvsOffset; + TNumber KvsNumber; + TSquare Square; + TNumber PolygonsNumber; + ui32 Unused; + + bool operator==(const TRegion& r) const { + return RegionId == r.RegionId; + } + + bool operator<(const TRegion& r) const { + return RegionId < r.RegionId; + } + + bool operator<(const TGeoId& r) const { + return RegionId < r; + } + + friend bool operator<(const TGeoId& regionId, const TRegion& r) { + return regionId < r.RegionId; + } + + bool Better(const TRegion& r) const { + return Square < r.Square; + } + }; + + static_assert(sizeof(TRegion) == 32, "NReverseGeocoder::TRegion size mismatch"); + +} |