Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Zolotarev <deathbaba@gmail.com>2011-04-01 06:05:53 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:14:36 +0300
commit06c612827e830562514452e9b79b4bc3a7c8863b (patch)
treeb773fbba9f7220a253026670b5aeb24532424ca2 /geometry/rect2d.hpp
parent454c6d0afeca9406b93a8088f5591228f24a4821 (diff)
Added serialization code for m2::Rect, m2::Point and m2::Region
Diffstat (limited to 'geometry/rect2d.hpp')
-rw-r--r--geometry/rect2d.hpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/geometry/rect2d.hpp b/geometry/rect2d.hpp
index 36fcc701ee..896935b56d 100644
--- a/geometry/rect2d.hpp
+++ b/geometry/rect2d.hpp
@@ -31,6 +31,11 @@ namespace m2
template <typename T>
class Rect
{
+ template <class TArchive, class TPoint>
+ friend TArchive & operator << (TArchive & ar, Rect<TPoint> const & rect);
+ template <class TArchive, class TPoint>
+ friend TArchive & operator >> (TArchive & ar, Rect<TPoint> & rect);
+
enum { IsSigned = numeric_limits<T>::is_signed };
T m_minX, m_minY, m_maxX, m_maxY;
@@ -297,6 +302,26 @@ namespace m2
);
}
+ template <class TArchive, class PointT>
+ TArchive & operator >> (TArchive & ar, m2::Rect<PointT> & rect)
+ {
+ ar >> rect.m_minX;
+ ar >> rect.m_minY;
+ ar >> rect.m_maxX;
+ ar >> rect.m_maxY;
+ return ar;
+ }
+
+ template <class TArchive, class PointT>
+ TArchive & operator << (TArchive & ar, m2::Rect<PointT> const & rect)
+ {
+ ar << rect.m_minX;
+ ar << rect.m_minY;
+ ar << rect.m_maxX;
+ ar << rect.m_maxY;
+ return ar;
+ }
+
typedef Rect<float> RectF;
typedef Rect<double> RectD;
typedef Rect<unsigned> RectU;