Changeset View
Changeset View
Standalone View
Standalone View
src/radix.h
Show First 20 Lines • Show All 98 Lines • ▼ Show 20 Lines | RadixTree &operator=(RadixTree &&rhs) { | ||||
RadixElement e = rhs.root.load(); | RadixElement e = rhs.root.load(); | ||||
rhs.root = root.load(); | rhs.root = root.load(); | ||||
root = e; | root = e; | ||||
} | } | ||||
return *this; | return *this; | ||||
} | } | ||||
/** The tree is clear of node and leaf */ | |||||
bool isNull() const { | |||||
RCULock lock; | |||||
RadixElement e = root.load(); | |||||
return e.isLeaf() && e.getLeaf() == nullptr; | |||||
} | |||||
/** | /** | ||||
* Insert a value into the tree. | * Insert a value into the tree. | ||||
* Returns true if the value was inserted, false if it was already present. | * Returns true if the value was inserted, false if it was already present. | ||||
*/ | */ | ||||
bool insert(const RCUPtr<T> &value) { return insert(getId(*value), value); } | bool insert(const RCUPtr<T> &value) { return insert(getId(*value), value); } | ||||
/** | /** | ||||
* Get the value corresponding to a key. | * Get the value corresponding to a key. | ||||
▲ Show 20 Lines • Show All 284 Lines • Show Last 20 Lines |