14 #ifndef STXXL_CONTAINERS_MAP_HEADER
15 #define STXXL_CONTAINERS_MAP_HEADER
24 template <
class KeyType,
75 template <
class KeyType,
78 unsigned RawNodeSize = 16* 1024,
79 unsigned RawLeafSize = 128* 1024,
151 bool empty()
const {
return impl.empty(); }
171 ) : impl(node_cache_size_in_bytes, leaf_cache_size_in_bytes)
181 ) : impl(c_, node_cache_size_in_bytes, leaf_cache_size_in_bytes)
193 template <
class InputIterator>
198 bool range_sorted =
false,
199 double node_fill_factor = 0.75,
200 double leaf_fill_factor = 0.6
201 ) : impl(b, e, node_cache_size_in_bytes, leaf_cache_size_in_bytes,
202 range_sorted, node_fill_factor, leaf_fill_factor)
215 template <
class InputIterator>
221 bool range_sorted =
false,
222 double node_fill_factor = 0.75,
223 double leaf_fill_factor = 0.6
224 ) : impl(b, e, c_, node_cache_size_in_bytes, leaf_cache_size_in_bytes,
225 range_sorted, node_fill_factor, leaf_fill_factor)
236 return impl.insert(x);
240 return impl.insert(pos, x);
242 template <
class InputIterator>
243 void insert(InputIterator b, InputIterator e)
253 return impl.erase(k);
257 impl.erase(first, last);
279 return impl.count(k);
283 return impl.lower_bound(k);
287 return impl.lower_bound(k);
291 return impl.upper_bound(k);
295 return impl.upper_bound(k);
299 return impl.equal_range(k);
303 return impl.equal_range(k);
324 impl.enable_prefetching();
330 impl.disable_prefetching();
336 return impl.prefetching_enabled();
342 impl.print_statistics(o);
348 impl.reset_statistics();
354 template <
class KeyType_,
357 unsigned RawNodeSize_,
358 unsigned RawLeafSize_,
359 class PDAllocStrategy_>
363 template <
class KeyType_,
366 unsigned RawNodeSize_,
367 unsigned RawLeafSize_,
368 class PDAllocStrategy_>
369 friend bool operator < (const map<KeyType_, DataType_, CompareType_, RawNodeSize_, RawLeafSize_, PDAllocStrategy_>& a,
372 template <
class KeyType_,
375 unsigned RawNodeSize_,
376 unsigned RawLeafSize_,
377 class PDAllocStrategy_>
381 template <
class KeyType_,
384 unsigned RawNodeSize_,
385 unsigned RawLeafSize_,
386 class PDAllocStrategy_>
390 template <
class KeyType_,
393 unsigned RawNodeSize_,
394 unsigned RawLeafSize_,
395 class PDAllocStrategy_>
396 friend bool operator <= (const map<KeyType_, DataType_, CompareType_, RawNodeSize_, RawLeafSize_, PDAllocStrategy_>& a,
399 template <
class KeyType_,
402 unsigned RawNodeSize_,
403 unsigned RawLeafSize_,
404 class PDAllocStrategy_>
410 template <
class KeyType,
413 unsigned RawNodeSize,
414 unsigned RawLeafSize,
415 class PDAllocStrategy
423 template <
class KeyType,
426 unsigned RawNodeSize,
427 unsigned RawLeafSize,
428 class PDAllocStrategy
430 inline bool operator < (const map<KeyType, DataType, CompareType, RawNodeSize, RawLeafSize, PDAllocStrategy>& a,
433 return a.
impl < b.impl;
436 template <
class KeyType,
439 unsigned RawNodeSize,
440 unsigned RawLeafSize,
441 class PDAllocStrategy
449 template <
class KeyType,
452 unsigned RawNodeSize,
453 unsigned RawLeafSize,
454 class PDAllocStrategy
462 template <
class KeyType,
465 unsigned RawNodeSize,
466 unsigned RawLeafSize,
467 class PDAllocStrategy
469 inline bool operator <= (const map<KeyType, DataType, CompareType, RawNodeSize, RawLeafSize, PDAllocStrategy>& a,
472 return a.
impl <= b.impl;
475 template <
class KeyType,
478 unsigned RawNodeSize,
479 unsigned RawLeafSize,
480 class PDAllocStrategy
494 template <
class KeyType,
497 unsigned RawNodeSize,
498 unsigned RawLeafSize,
499 class PDAllocStrategy
510 #endif // !STXXL_CONTAINERS_MAP_HEADER
impl_type::key_compare key_compare
const_reverse_iterator rend() const
impl_type::reference reference
const_iterator upper_bound(const key_type &k) const
const_reverse_iterator rbegin() const
size_type erase(const key_type &k)
const_iterator cbegin() const
const_iterator find(const key_type &k) const
map(unsigned_type node_cache_size_in_bytes, unsigned_type leaf_cache_size_in_bytes)
A constructor.
iterator find(const key_type &k)
impl_type::node_block_type node_block_type
size_type max_size() const
impl_type::key_type key_type
impl_type::pointer pointer
std::reverse_iterator< const_iterator > const_reverse_iterator
const_iterator lower_bound(const key_type &k) const
void print_statistics(std::ostream &o) const
Prints cache statistics.
iterator lower_bound(const key_type &k)
std::pair< const key_type, data_type > value_type
std::pair< iterator, bool > insert(const value_type &x)
Block containing elements of fixed length.
size_type count(const key_type &k)
stxxl::int64 difference_type
bool operator!=(const uint_pair &b) const
inequality checking operator
impl_type::leaf_block_type leaf_block_type
iterator upper_bound(const key_type &k)
void enable_prefetching()
Enables leaf prefetching during scanning.
const value_type & const_reference
bool operator>(const uint_pair &b) const
greater comparison operator
impl_type::difference_type difference_type
bool operator>=(const uint_pair &b) const
greater-or-equal comparison operator
value_compare value_comp() const
const_reverse_iterator crend() const
#define STXXL_BEGIN_NAMESPACE
iterator insert(iterator pos, const value_type &x)
map(InputIterator b, InputIterator e, const key_compare &c_, unsigned_type node_cache_size_in_bytes, unsigned_type leaf_cache_size_in_bytes, bool range_sorted=false, double node_fill_factor=0.75, double leaf_fill_factor=0.6)
Constructs a map from a given input range.
bool prefetching_enabled()
Returns the status of leaf prefetching during scanning.
Simple randomized disk allocation scheme functor.
void reset_statistics()
Resets cache statistics.
const_reverse_iterator crbegin() const
value_type const * const_pointer
impl_type::data_type data_type
reverse_iterator rbegin()
void erase(iterator first, iterator last)
map(const key_compare &c_, unsigned_type node_cache_size_in_bytes, unsigned_type leaf_cache_size_in_bytes)
A constructor.
std::pair< const_iterator, const_iterator > equal_range(const key_type &k) const
choose_int_types< my_pointer_size >::unsigned_type unsigned_type
impl_type::const_reference const_reference
std::pair< iterator, iterator > equal_range(const key_type &k)
impl_type::size_type size_type
std::reverse_iterator< iterator > reverse_iterator
map(InputIterator b, InputIterator e, unsigned_type node_cache_size_in_bytes, unsigned_type leaf_cache_size_in_bytes, bool range_sorted=false, double node_fill_factor=0.75, double leaf_fill_factor=0.6)
Constructs a map from a given input range.
External associative container (map). Introduction to map container: see STXXL Map (B+-tree) tutor...
btree::btree< KeyType, DataType, CompareType, RawNodeSize, RawLeafSize, PDAllocStrategy > impl_type
void disable_prefetching()
Disables leaf prefetching during scanning.
key_compare key_comp() const
impl_type::const_pointer const_pointer
void insert(InputIterator b, InputIterator e)
impl_type::value_compare value_compare
impl_type::const_iterator const_iterator
impl_type::data_type mapped_type
const_iterator cend() const
impl_type::value_type value_type
bool operator==(const uint_pair &b) const
equality checking operator
const_iterator end() const
#define STXXL_END_NAMESPACE
impl_type::iterator iterator
const_iterator begin() const