Boost logo

Boost Users :

From: Lothar Werzinger (lothar_at_[hidden])
Date: 2008-06-10 18:45:44


Hi, I try to use intrusive avl_set to put the set into a memory mapped file (I
manage the file myself using just mapped_region.

If I declare my node without offset_ptr my test program works as expected
except that the pointers in the file are absolute. If I use offset_ptr I get
a runtime assertion (see below). What I don't understand is why the assertion
complains about uniqueness. Any help is appreciated!

struct BalanceNode
:
  public api::helper::BalanceKey
// ,public bin::avl_set_base_hook<bin::optimize_size<true> >
 ,public bin::avl_set_base_hook< bin::optimize_size<true>, bin::void_pointer<
bip::offset_ptr<void> > >
{
  api::values::Decimal m_amount;
};

// Define an avl_set using the base hook
 typedef bin::avl_set< BalanceNode > BalanceSet;

/opt2/linux/x86_64/include/boost-1_35/boost/intrusive/avltree.hpp:618:
boost::intrusive::tree_iterator<boost::intrusive::avltree_impl<Config>,
false> boost::intrusive::avltree_impl<Config>::insert_unique_commit(typename
std::iterator_traits<typename
boost::intrusive::detail::eval_if_c<boost::intrusive::avltree_impl<Config>::external_value_traits,
boost::intrusive::detail::eval_value_traits<typename Config::value_traits>,
boost::intrusive::detail::identity<typename Config::value_traits>
>::type::pointer>::reference, const typename
boost::intrusive::avltree_algorithms<typename
boost::intrusive::detail::eval_if_c<boost::intrusive::avltree_impl<Config>::external_value_traits,
boost::intrusive::detail::eval_value_traits<typename Config::value_traits>,
boost::intrusive::detail::identity<typename Config::value_traits>
>::type::node_traits>::insert_commit_data&) [with Config =
boost::intrusive::avl_setopt<boost::intrusive::detail::base_hook_traits<tradescape::balance::BalanceNode,
boost::intrusive::avltree_node_traits<boost::interprocess::offset_ptr<void>,
true>, safe_link, boost::intrusive::default_tag, 6>,
std::less<tradescape::balance::BalanceNode>, long unsigned int, true>]:
Assertion `node_algorithms::unique(to_insert)' failed.

Lothar

-- 
Lothar Werzinger Dipl.-Ing. Univ.
framework & platform architect
Tradescape Inc. - Enabling Efficient Digital Marketplaces
1754 Technology Drive, Suite 128
San Jose, CA 95110
web: http://www.tradescape.biz

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net