14 #ifndef STXXL_CONTAINERS_MAP_HEADER
15 #define STXXL_CONTAINERS_MAP_HEADER
25 template <
class KeyType,
76 template <
class KeyType,
79 unsigned RawNodeSize = 16* 1024,
80 unsigned RawLeafSize = 128* 1024,
152 bool empty()
const {
return Impl.empty(); }
172 ) : Impl(node_cache_size_in_bytes, leaf_cache_size_in_bytes)
182 ) : Impl(c_, node_cache_size_in_bytes, leaf_cache_size_in_bytes)
194 template <
class InputIterator>
199 bool range_sorted =
false,
200 double node_fill_factor = 0.75,
201 double leaf_fill_factor = 0.6
202 ) : Impl(b, e, node_cache_size_in_bytes, leaf_cache_size_in_bytes,
203 range_sorted, node_fill_factor, leaf_fill_factor)
216 template <
class InputIterator>
222 bool range_sorted =
false,
223 double node_fill_factor = 0.75,
224 double leaf_fill_factor = 0.6
225 ) : Impl(b, e, c_, node_cache_size_in_bytes, leaf_cache_size_in_bytes,
226 range_sorted, node_fill_factor, leaf_fill_factor)
237 return Impl.insert(x);
241 return Impl.insert(pos, x);
243 template <
class InputIterator>
244 void insert(InputIterator b, InputIterator e)
254 return Impl.erase(k);
258 Impl.erase(first, last);
280 return Impl.count(k);
284 return Impl.lower_bound(k);
288 return Impl.lower_bound(k);
292 return Impl.upper_bound(k);
296 return Impl.upper_bound(k);
300 return Impl.equal_range(k);
304 return Impl.equal_range(k);
325 Impl.enable_prefetching();
331 Impl.disable_prefetching();
337 return Impl.prefetching_enabled();
343 Impl.print_statistics(o);
349 Impl.reset_statistics();
355 template <
class KeyType_,
358 unsigned RawNodeSize_,
359 unsigned RawLeafSize_,
360 class PDAllocStrategy_>
364 template <
class KeyType_,
367 unsigned RawNodeSize_,
368 unsigned RawLeafSize_,
369 class PDAllocStrategy_>
370 friend bool operator < (const map<KeyType_, DataType_, CompareType_, RawNodeSize_, RawLeafSize_, PDAllocStrategy_>& a,
373 template <
class KeyType_,
376 unsigned RawNodeSize_,
377 unsigned RawLeafSize_,
378 class PDAllocStrategy_>
382 template <
class KeyType_,
385 unsigned RawNodeSize_,
386 unsigned RawLeafSize_,
387 class PDAllocStrategy_>
391 template <
class KeyType_,
394 unsigned RawNodeSize_,
395 unsigned RawLeafSize_,
396 class PDAllocStrategy_>
397 friend bool operator <= (const map<KeyType_, DataType_, CompareType_, RawNodeSize_, RawLeafSize_, PDAllocStrategy_>& a,
400 template <
class KeyType_,
403 unsigned RawNodeSize_,
404 unsigned RawLeafSize_,
405 class PDAllocStrategy_>
411 template <
class KeyType,
414 unsigned RawNodeSize,
415 unsigned RawLeafSize,
416 class PDAllocStrategy
424 template <
class KeyType,
427 unsigned RawNodeSize,
428 unsigned RawLeafSize,
429 class PDAllocStrategy
431 inline bool operator < (const map<KeyType, DataType, CompareType, RawNodeSize, RawLeafSize, PDAllocStrategy>& a,
434 return a.
Impl < b.Impl;
437 template <
class KeyType,
440 unsigned RawNodeSize,
441 unsigned RawLeafSize,
442 class PDAllocStrategy
450 template <
class KeyType,
453 unsigned RawNodeSize,
454 unsigned RawLeafSize,
455 class PDAllocStrategy
463 template <
class KeyType,
466 unsigned RawNodeSize,
467 unsigned RawLeafSize,
468 class PDAllocStrategy
470 inline bool operator <= (const map<KeyType, DataType, CompareType, RawNodeSize, RawLeafSize, PDAllocStrategy>& a,
473 return a.
Impl <= b.Impl;
476 template <
class KeyType,
479 unsigned RawNodeSize,
480 unsigned RawLeafSize,
481 class PDAllocStrategy
495 template <
class KeyType,
498 unsigned RawNodeSize,
499 unsigned RawLeafSize,
500 class PDAllocStrategy
511 #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