8#ifndef RUNTIME_PLATFORM_SPLAY_TREE_H_
9#define RUNTIME_PLATFORM_SPLAY_TREE_H_
28template <
typename Config,
class B,
class Allocator>
32 typedef typename Config::Value
Value;
37 : root_(nullptr), allocator_(
allocator) {}
70 bool Move(
const Key& old_key,
const Key& new_key);
89 : key_(
key), value_(
value), left_(nullptr), right_(nullptr) {}
120 template <
class Callback>
130 bool FindInternal(
const Key&
key);
133 void InsertInternal(
int cmp,
Node* node);
136 void RemoveRootNode(
const Key&
key);
138 template <
class Callback>
139 class NodeToPairAdaptor :
public B {
142 void Call(
Node* node) {
callback_->Call(node->key(), node->value()); }
150 class NodeDeleter :
public B {
152 NodeDeleter() =
default;
153 void Call(
Node* node) {
delete node; }
159 template <
class Callback>
void set_value(const Value &value)
Node(const Key &key, const Value &value)
void ForEach(Callback *callback)
bool FindLeastGreaterThan(const Key &key, Locator *locator)
bool Insert(const Key &key, Locator *locator)
bool Find(const Key &key, Locator *locator)
void Splay(const Key &key)
bool FindGreatestLessThan(const Key &key, Locator *locator)
bool Move(const Key &old_key, const Key &new_key)
bool FindLeast(Locator *locator)
bool FindGreatest(Locator *locator)
bool Remove(const Key &key)
SplayTree(Allocator *allocator)
bool Contains(const Key &key)
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
void(* callback_)(Dart_Handle)
std::function< void(MTLRenderPipelineDescriptor *)> Callback