yfast 0.6.1
Loading...
Searching...
No Matches
yfast::impl::YFastTrie< Leaf, H, BitExtractor, Hash, Compare, ArbitraryAllocator > Class Template Reference

#include <yfast.h>

Classes

struct  Where

Public Types

typedef Leaf::Key Key
typedef AVL< Leaf, Compare > Value
typedef internal::XFastLeaf< Key, ValueXFastLeaf

Public Member Functions

 YFastTrie (BitExtractor bx=BitExtractor(), Compare cmp=Compare(), ArbitraryAllocator alloc=ArbitraryAllocator())
 YFastTrie (YFastTrie &&other) noexcept
std::size_t size () const
unsigned int rebuilds () const
Where leftmost () const
Where rightmost () const
Where find (const Key &key) const
Where pred (const Key &key, bool strict=false) const
Where succ (const Key &key, bool strict=false) const
Where insert (Leaf *leaf)
void remove (Leaf *leaf, XFastLeaf *hint=nullptr)
void clear ()

Public Attributes

const Where nowhere = { this, nullptr, nullptr }

Detailed Description

template<typename Leaf, unsigned int H, internal::BitExtractorGeneric< typename Leaf::Key > BitExtractor = internal::BitExtractor<typename Leaf::Key>, internal::MapGeneric< typename BitExtractor::ShiftResult, std::uintptr_t > Hash = internal::DefaultHash<typename BitExtractor::ShiftResult, std::uintptr_t>, typename Compare = std::less<typename Leaf::Key>, typename ArbitraryAllocator = std::allocator<typename Leaf::Key>>
class yfast::impl::YFastTrie< Leaf, H, BitExtractor, Hash, Compare, ArbitraryAllocator >

y-fast trie implementation

Template Parameters
Leafinner binary tree leaf type
Hkey length in bits
BitExtractorhelper type to provide key shifts and bit extractions
Hashmap from shifted keys to std::uintptr_t
Comparekey comparator
ArbitraryAllocatorallocator

Member Function Documentation

◆ insert()

template<typename Leaf, unsigned int H, internal::BitExtractorGeneric< typename Leaf::Key > BitExtractor = internal::BitExtractor<typename Leaf::Key>, internal::MapGeneric< typename BitExtractor::ShiftResult, std::uintptr_t > Hash = internal::DefaultHash<typename BitExtractor::ShiftResult, std::uintptr_t>, typename Compare = std::less<typename Leaf::Key>, typename ArbitraryAllocator = std::allocator<typename Leaf::Key>>
Where yfast::impl::YFastTrie< Leaf, H, BitExtractor, Hash, Compare, ArbitraryAllocator >::insert ( Leaf * leaf)
inline

insert a new leaf

Parameters
leafleaf to insert
Returns
Where with fields: trie – this; xleaf – new leaf's x-fast trie node; leaf – NB: replaced leaf (if any)

The documentation for this class was generated from the following file: