move ts from Tds to Compact_container

Tds now is back to its original version (not different from master)
This commit is contained in:
Jane Tournois 2014-02-14 17:15:33 +01:00
parent 3a6fa91f9a
commit 6db28ed43d
2 changed files with 18 additions and 24 deletions

View File

@ -157,6 +157,7 @@ public:
{
init();
block_size = c.block_size;
time_stamp = c.time_stamp;
std::copy(c.begin(), c.end(), CGAL::inserter(*this));
}
@ -184,6 +185,7 @@ public:
std::swap(last_item, c.last_item);
std::swap(free_list, c.free_list);
all_items.swap(c.all_items);
std::swap(time_stamp, c.time_stamp);
}
iterator begin() { return iterator(first_item, 0, 0); }
@ -229,6 +231,7 @@ public:
new (ret) value_type(args...);
CGAL_assertion(type(ret) == USED);
++size_;
ret->ts = time_stamp++;
return iterator(ret, 0);
}
#else
@ -243,6 +246,7 @@ public:
new (ret) value_type();
CGAL_assertion(type(ret) == USED);
++size_;
ret->ts = time_stamp++;
return iterator(ret, 0);
}
@ -258,6 +262,7 @@ public:
new (ret) value_type(t1);
CGAL_assertion(type(ret) == USED);
++size_;
ret->ts = time_stamp++;
return iterator(ret, 0);
}
@ -273,6 +278,7 @@ public:
new (ret) value_type(t1, t2);
CGAL_assertion(type(ret) == USED);
++size_;
ret->ts = time_stamp++;
return iterator(ret, 0);
}
@ -288,6 +294,7 @@ public:
new (ret) value_type(t1, t2, t3);
CGAL_assertion(type(ret) == USED);
++size_;
ret->ts = time_stamp++;
return iterator(ret, 0);
}
@ -303,6 +310,7 @@ public:
new (ret) value_type(t1, t2, t3, t4);
CGAL_assertion(type(ret) == USED);
++size_;
ret->ts = time_stamp++;
return iterator(ret, 0);
}
@ -319,6 +327,7 @@ public:
new (ret) value_type(t1, t2, t3, t4, t5);
CGAL_assertion(type(ret) == USED);
++size_;
ret->ts = time_stamp++;
return iterator(ret, 0);
}
@ -336,6 +345,7 @@ public:
new (ret) value_type(t1, t2, t3, t4, t5, t6);
CGAL_assertion(type(ret) == USED);
++size_;
ret->ts = time_stamp++;
return iterator(ret, 0);
}
@ -353,6 +363,7 @@ public:
new (ret) value_type(t1, t2, t3, t4, t5, t6, t7);
CGAL_assertion(type(ret) == USED);
++size_;
ret->ts = time_stamp++;
return iterator(ret, 0);
}
@ -370,6 +381,7 @@ public:
new (ret) value_type(t1, t2, t3, t4, t5, t6, t7, t8);
CGAL_assertion(type(ret) == USED);
++size_;
ret->ts = time_stamp++;
return iterator(ret, 0);
}
#endif // CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES
@ -384,6 +396,7 @@ public:
alloc.construct(ret, t);
CGAL_assertion(type(ret) == USED);
++size_;
ret->ts = time_stamp++;
return iterator(ret, 0);
}
@ -574,6 +587,7 @@ private:
first_item = NULL;
last_item = NULL;
all_items = All_items();
time_stamp = 0;
}
allocator_type alloc;
@ -584,6 +598,7 @@ private:
pointer first_item;
pointer last_item;
All_items all_items;
std::size_t time_stamp;
};
template < class T, class Allocator >
@ -865,25 +880,21 @@ namespace internal {
bool operator<(const CC_iterator& other) const
{
return m_ptr.p->ts < other.m_ptr.p->ts;
return (m_ptr.p < other.m_ptr.p);
}
bool operator>(const CC_iterator& other) const
{
std::cerr << ">"<< std::endl;
return (m_ptr.p > other.m_ptr.p);
return m_ptr.p->ts > other.m_ptr.p->ts;
}
bool operator<=(const CC_iterator& other) const
{
std::cerr << "<="<< std::endl;
return (m_ptr.p <= other.m_ptr.p);
return m_ptr.p->ts <= other.m_ptr.p->ts;
}
bool operator>=(const CC_iterator& other) const
{
std::cerr << ">="<< std::endl;
return (m_ptr.p >= other.m_ptr.p);
return m_ptr.p->ts >= other.m_ptr.p->ts;
}
// Can itself be used for bit-squatting.

View File

@ -208,14 +208,12 @@ public:
Vertex_handle create_vertex(const Vertex &v)
{
Vertex_handle vh = vertices().insert(v);
vh->ts = TS++;
return vh;
}
Vertex_handle create_vertex()
{
Vertex_handle vh = vertices().emplace();
vh->ts = TS++;
return vh;
}
@ -227,14 +225,12 @@ public:
Cell_handle create_cell(const Cell &c)
{
Cell_handle ch = cells().insert(c);
ch->ts = TS++;
return ch;
}
Cell_handle create_cell()
{
Cell_handle ch = cells().emplace();
ch->ts = TS++;
return ch;
}
@ -247,7 +243,6 @@ public:
Vertex_handle v2, Vertex_handle v3)
{
Cell_handle ch = cells().emplace(v0, v1, v2, v3);
ch->ts = TS++;
return ch;
}
@ -257,7 +252,6 @@ public:
Cell_handle n2, Cell_handle n3)
{
Cell_handle ch = cells().emplace(v0, v1, v2, v3, n0, n1, n2, n3);
ch->ts = TS++;
return ch;
}
@ -272,7 +266,6 @@ public:
{
CGAL_triangulation_precondition(dimension()<3);
Cell_handle ch = cells().emplace(v0, v1, v2, Vertex_handle());
ch->ts = TS++;
return ch;
}
@ -3657,16 +3650,6 @@ count_cells(size_type & i, bool verbose, int level) const
}
template <class Vb, class Cb >
bool
operator< (typename Triangulation_data_structure_3<Vb,Cb>::Cell_handle a, typename Triangulation_data_structure_3<Vb,Cb>::Cell_handle b)
{
std::cerr << "operator<" << std::endl;
return a->ts < b->ts;
}
} //namespace CGAL
#endif // CGAL_TRIANGULATION_DATA_STRUCTURE_3_H