|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r83257 - in sandbox-branches/geometry/index: boost/geometry/index example
From: adam.wulkiewicz_at_[hidden]
Date: 2013-03-02 19:34:46
Author: awulkiew
Date: 2013-03-02 19:34:45 EST (Sat, 02 Mar 2013)
New Revision: 83257
URL: http://svn.boost.org/trac/boost/changeset/83257
Log:
rtree: IndexableGetter and EqualTo handled in members_holder interface.
Fix in glut_vis example - macro name fixed.
Text files modified:
sandbox-branches/geometry/index/boost/geometry/index/rtree.hpp | 51 +++++++++++++++++++++++++--------------
sandbox-branches/geometry/index/boost/geometry/index/translator.hpp | 3 --
sandbox-branches/geometry/index/example/glut_vis.cpp | 2
3 files changed, 34 insertions(+), 22 deletions(-)
Modified: sandbox-branches/geometry/index/boost/geometry/index/rtree.hpp
==============================================================================
--- sandbox-branches/geometry/index/boost/geometry/index/rtree.hpp (original)
+++ sandbox-branches/geometry/index/boost/geometry/index/rtree.hpp 2013-03-02 19:34:45 EST (Sat, 02 Mar 2013)
@@ -158,7 +158,7 @@
inline explicit rtree(parameters_type const& parameters = parameters_type(),
IndexableGetter const& indexable_getter = IndexableGetter(),
EqualTo const& equal_to = EqualTo())
- : m_members(translator_type(indexable_getter, equal_to), parameters)
+ : m_members(indexable_getter, equal_to, parameters)
{}
/*!
@@ -176,7 +176,7 @@
IndexableGetter const& indexable_getter,
EqualTo const& equal_to,
allocator_type allocator)
- : m_members(translator_type(indexable_getter, equal_to), parameters, allocator)
+ : m_members(indexable_getter, equal_to, parameters, allocator)
{}
/*!
@@ -201,7 +201,7 @@
IndexableGetter const& indexable_getter = IndexableGetter(),
EqualTo const& equal_to = EqualTo(),
allocator_type allocator = allocator_type())
- : m_members(translator_type(indexable_getter, equal_to), parameters, allocator)
+ : m_members(indexable_getter, equal_to, parameters, allocator)
{
try
{
@@ -235,7 +235,7 @@
IndexableGetter const& indexable_getter = IndexableGetter(),
EqualTo const& equal_to = EqualTo(),
allocator_type allocator = allocator_type())
- : m_members(translator_type(indexable_getter, equal_to), parameters, allocator)
+ : m_members(indexable_getter, equal_to, parameters, allocator)
{
try
{
@@ -273,7 +273,8 @@
\li When memory allocation for Node fails.
*/
inline rtree(rtree const& src)
- : m_members(src.m_members.translator(),
+ : m_members(src.m_members.indexable_getter(),
+ src.m_members.equal_to(),
src.m_members.parameters(),
allocator_traits_type::select_on_container_copy_construction(src.get_allocator()))
{
@@ -295,7 +296,9 @@
\li When memory allocation for Node fails.
*/
inline rtree(rtree const& src, allocator_type const& allocator)
- : m_members(src.m_members.translator(), src.m_members.parameters(), allocator)
+ : m_members(src.m_members.indexable_getter(),
+ src.m_members.equal_to(),
+ src.m_members.parameters(), allocator)
{
this->raw_copy(src, *this, false);
}
@@ -311,7 +314,8 @@
Nothing.
*/
inline rtree(BOOST_RV_REF(rtree) src)
- : m_members(src.m_members.translator(),
+ : m_members(src.m_members.indexable_getter(),
+ src.m_members.equal_to(),
src.m_members.parameters(),
boost::move(src.m_members.allocators()))
{
@@ -335,7 +339,8 @@
\li When memory allocation for Node fails (only if allocators aren't equal).
*/
inline rtree(BOOST_RV_REF(rtree) src, allocator_type const& allocator)
- : m_members(src.m_members.translator(),
+ : m_members(src.m_members.indexable_getter(),
+ src.m_members.equal_to(),
src.m_members.parameters(),
boost::move(allocator))
{
@@ -403,8 +408,10 @@
{
this->raw_destroy(*this);
- m_members.translator() = src.m_members.translator();
+ m_members.indexable_getter() = src.m_members.indexable_getter();
+ m_members.equal_to() = src.m_members.equal_to();
m_members.parameters() = src.m_members.parameters();
+
boost::swap(m_members.values_count, src.m_members.values_count);
boost::swap(m_members.leafs_level, src.m_members.leafs_level);
boost::swap(m_members.root, src.m_members.root);
@@ -437,7 +444,8 @@
*/
void swap(rtree & other)
{
- boost::swap(m_members.translator(), other.m_members.translator());
+ boost::swap(m_members.indexable_getter(), other.m_members.indexable_getter());
+ boost::swap(m_members.equal_to(), other.m_members.equal_to());
boost::swap(m_members.parameters(), other.m_members.parameters());
m_members.allocators().swap(other.m_members.allocators());
@@ -1014,7 +1022,8 @@
if ( copy_tr_and_params )
{
- dst.m_members.translator() = src.m_members.translator(); // SHOULDN'T THROW
+ dst.m_members.indexable_getter() = src.m_members.indexable_getter();
+ dst.m_members.equal_to() = src.m_members.equal_to();
dst.m_members.parameters() = src.m_members.parameters();
}
@@ -1122,11 +1131,12 @@
members_holder(members_holder const&);
public:
- template <typename Transl, typename Alloc>
- members_holder(Transl const& transl,
+ template <typename IndGet, typename ValEq, typename Alloc>
+ members_holder(IndGet const& ind_get,
+ ValEq const& val_eq,
Parameters const& parameters,
BOOST_FWD_REF(Alloc) alloc)
- : translator_type(transl)
+ : translator_type(ind_get, val_eq)
, Parameters(parameters)
, allocators_type(boost::forward<Alloc>(alloc))
, values_count(0)
@@ -1134,10 +1144,11 @@
, root(0)
{}
- template <typename Transl>
- members_holder(Transl const& transl,
+ template <typename IndGet, typename ValEq>
+ members_holder(IndGet const& ind_get,
+ ValEq const& val_eq,
Parameters const& parameters)
- : translator_type(transl)
+ : translator_type(ind_get, val_eq)
, Parameters(parameters)
, allocators_type()
, values_count(0)
@@ -1146,7 +1157,11 @@
{}
translator_type const& translator() const { return *this; }
- translator_type & translator() { return *this; }
+
+ IndexableGetter const& indexable_getter() const { return *this; }
+ IndexableGetter & indexable_getter() { return *this; }
+ EqualTo const& equal_to() const { return *this; }
+ EqualTo & equal_to() { return *this; }
Parameters const& parameters() const { return *this; }
Parameters & parameters() { return *this; }
allocators_type const& allocators() const { return *this; }
Modified: sandbox-branches/geometry/index/boost/geometry/index/translator.hpp
==============================================================================
--- sandbox-branches/geometry/index/boost/geometry/index/translator.hpp (original)
+++ sandbox-branches/geometry/index/boost/geometry/index/translator.hpp 2013-03-02 19:34:45 EST (Sat, 02 Mar 2013)
@@ -249,9 +249,6 @@
{
return EqualTo::operator()(v1, v2);
}
-
- IndexableGetter const& indexable_get() const { return *this; }
- EqualTo const& value_eq() const { return *this; }
};
template <typename Translator>
Modified: sandbox-branches/geometry/index/example/glut_vis.cpp
==============================================================================
--- sandbox-branches/geometry/index/example/glut_vis.cpp (original)
+++ sandbox-branches/geometry/index/example/glut_vis.cpp 2013-03-02 19:34:45 EST (Sat, 02 Mar 2013)
@@ -9,7 +9,7 @@
#include <GL/glut.h>
-#define BOOST_GEOMETRY_INDEX_ENABLE_DEBUG_INTERFACE
+#define BOOST_GEOMETRY_INDEX_DETAIL_ENABLE_DEBUG_INTERFACE
#include <boost/foreach.hpp>
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk