TreeMap< K, V, MAP, COW > Class Template Reference
#include <treemap.h>
Public Types |
|
using | KeyType = K |
using | ValueType = V |
using | Super = TreeMapParent < TreeMap < K, V, MAP, COW >, COW > |
using | Child = typename std::conditional< COW, StrongCOWRef < TreeMap >, TreeMap >::type |
using | Ref = typename std::conditional< COW, StrongCOWRef < TreeMap >, void >::type |
using | ChildrenMap = typename MAP::template Type< K, Child > |
公共成员函数 |
|
TreeMap ()=default | |
TreeMap ( TreeMap && src ) | |
MAXON_OPERATOR_MOVE_ASSIGNMENT ( TreeMap ) | |
Result < void > | CopyFrom (const TreeMap & src ) |
void | Flush () |
void | 重置 () |
Result < TreeMap & > | InsertChild (const K &key, Bool withValue=true) |
template<typename PATH , typename = typename std::enable_if<!STD_IS_REPLACEMENT(base_of, K, typename std::decay<PATH>::type)>::type> | |
Result < TreeMap & > | InsertEntry (PATH &&key, Bool withValue=true) |
template<typename PATH , typename = typename std::enable_if<!STD_IS_REPLACEMENT(base_of, K, typename std::decay<PATH>::type)>::type> | |
Result < TreeMap & > | Insert (PATH &&key, const V &value) |
template<typename PATH , typename = typename std::enable_if<!STD_IS_REPLACEMENT(base_of, K, typename std::decay<PATH>::type)>::type> | |
Result < TreeMap & > | Insert (PATH &&key, V &&value) |
template<typename PATH > | |
Result < V & > | InsertKey (PATH &&key, Bool &created= BoolLValue ()) |
const TreeMap * | FindChild (const K &key) const |
TreeMap * | FindChild (const K &key) |
template<typename PATH > | |
const TreeMap * | FindEntry (PATH &&key) const |
template<typename PATH , typename = typename std::enable_if<!COW || AlwaysFalse<PATH>::value>::type> | |
TreeMap * | FindEntry (PATH &&key) |
template<typename PATH > | |
const TreeMap * | FindFirstEntryWithValue (PATH &&key) const |
template<typename PATH > | |
const TreeMap * | FindClosestEntryWithValue (PATH &&key) const |
template<typename PATH > | |
const V * | FindValue (PATH &&key) const |
template<typename PATH , typename = typename std::enable_if<!COW || AlwaysFalse<PATH>::value>::type> | |
V * | FindValue (PATH &&key) |
template<typename PATH > | |
Bool | Contains (PATH &&key) const |
template<typename PATH > | |
std::conditional< COW, Result < void >, ResultOk < void > >::type | Erase (PATH &&key) |
String | ToString (const FormatStatement *fs=nullptr) const |
const Opt < V > & | Get () const |
Opt < V > & | Get () |
V & | MakeValid () |
void | SetValue (const V &value) |
void | SetValue (V &&value) |
Bool | IsRoot () const |
Bool | IsLeaf () const |
const ChildrenMap & | GetChildren () const |
ChildrenMap & | GetChildren () |
const K * | GetKey () const |
Bool | operator== (const TreeMap &other) const |
Bool | operator!= (const TreeMap &other) const |
Bool | IsPopulated () const |
Bool | IsEmpty () const |
Bool | HasSameStructure (const TreeMap &other) const |
template<typename OP > | |
Result < Bool > | ForEachPreOrder (OP &&callback) const |
template<typename PATH , typename OP > | |
Result < Bool > | ForEachPreOrder (OP &&callback, PATH &&path=PATH()) const |
template<typename OP > | |
Result < Bool > | ForEachPreOrder (OP &&callback) |
template<typename PATH , typename OP > | |
Result < Bool > | ForEachPreOrder (OP &&callback, PATH &&path=PATH()) |
template<typename PATH , typename OP > | |
Result < void > | ForEachPreOrderX (OP &&callback, PATH &&path=PATH()) |
template<typename OP > | |
Result < Bool > | ForEachPostOrder (OP &&callback) const |
template<typename PATH , typename OP > | |
Result < Bool > | ForEachPostOrder (OP &&callback, PATH &&path=PATH()) const |
template<typename OP > | |
Result < Bool > | ForEachPostOrder (OP &&callback) |
template<typename PATH , typename OP > | |
Result < Bool > | ForEachPostOrder (OP &&callback, PATH &&path=PATH()) |
template<typename PATH > | |
Result < void > | GetPath (PATH &path) const |
Int | GetDepth () const |
IndexIterator < const K &, const TreeMap , TreeMap > | GetPath () const |
![]() |
|
const TreeMap < K, V, HashMapSelector <>, false > * | GetParent () const |
TreeMap < K, V, HashMapSelector <>, false > * | GetParent () |
静态公共成员函数 |
|
static ResultRef < TreeMap > | MakeWritable ( StrongCOWRef < TreeMap > &ref) |
static ResultOk < TreeMap & > | MakeWritable ( TreeMap &ref) |
static const TreeMap * | GetTreeMap (const TreeMap *child) |
static const TreeMap * | GetTreeMap (const StrongCOWRef < TreeMap > *child) |
static const K & | Get (const TreeMap &map, Int index) |
私有成员函数 |
|
void | ToStringImpl ( String &s, BufferedBaseArray < K, 10 > &path, const FormatStatement *fs) const |
template<typename IT > | |
std::conditional< COW, Result < Bool >, ResultOk < Bool > >::type | EraseImpl (IT &beginIt, const IT &endIt) |
Private Attributes |
|
Opt < V > | _value |
ChildrenMap | _children |
Additional Inherited Members |
|
![]() |
|
void | SetParent ( TreeMap < K, V, HashMapSelector <>, false > *p) |
![]() |
|
Pointer < TreeMap < K, V, HashMapSelector <>, false > > | _parent |
using KeyType = K |
using ValueType = V |
using Super = TreeMapParent < TreeMap <K, V, MAP, COW>, COW> |
using Child = typename std::conditional<COW, StrongCOWRef < TreeMap >, TreeMap >::type |
using Ref = typename std::conditional<COW, StrongCOWRef < TreeMap >, void>::type |
using ChildrenMap = typename MAP::template Type<K, Child > |
|
default |
TreeMap | ( | TreeMap < K, V, MAP, COW > && | src | ) |
MAXON_OPERATOR_MOVE_ASSIGNMENT | ( | TreeMap < K, V, MAP, COW > | ) |
Result <void> CopyFrom | ( | const TreeMap < K, V, MAP, COW > & | src | ) |
void Flush | ( | ) |
void Reset | ( | ) |
Result < TreeMap &> InsertChild | ( | const K & | key , |
Bool |
withValue
=
true
|
||
) |
|
static |
|
static |
Result < TreeMap &> InsertEntry | ( | PATH && | key , |
Bool |
withValue
=
true
|
||
) |
Result < TreeMap &> Insert | ( | PATH && | key , |
const V & | value | ||
) |
Result < TreeMap &> Insert | ( | PATH && | key , |
V && | value | ||
) |
Result <V&> InsertKey | ( | PATH && | key , |
Bool & |
created
=
BoolLValue()
|
||
) |
|
static |
|
static |
const TreeMap * FindChild | ( | const K & | key | ) | const |
TreeMap * FindChild | ( | const K & | key | ) |
const TreeMap * FindEntry | ( | PATH && | key | ) | const |
TreeMap * FindEntry | ( | PATH && | key | ) |
const TreeMap * FindFirstEntryWithValue | ( | PATH && | key | ) | const |
const TreeMap * FindClosestEntryWithValue | ( | PATH && | key | ) | const |
const V* FindValue | ( | PATH && | key | ) | const |
V* FindValue | ( | PATH && | key | ) |
Bool Contains | ( | PATH && | key | ) | const |
std::conditional<COW, Result <void>, ResultOk <void> >::type Erase | ( | PATH && | key | ) |
String ToString | ( | const FormatStatement * |
fs
=
nullptr
|
) | const |
const Opt <V>& Get | ( | ) | const |
Opt <V>& Get | ( | ) |
V& MakeValid | ( | ) |
void SetValue | ( | const V & | value | ) |
void SetValue | ( | V && | value | ) |
Bool IsRoot | ( | ) | const |
Bool IsLeaf | ( | ) | const |
const ChildrenMap & GetChildren | ( | ) | const |
ChildrenMap & GetChildren | ( | ) |
const K* GetKey | ( | ) | const |
Bool operator== | ( | const TreeMap < K, V, MAP, COW > & | other | ) | const |
Bool operator!= | ( | const TreeMap < K, V, MAP, COW > & | other | ) | const |
Bool IsPopulated | ( | ) | const |
Bool IsEmpty | ( | ) | const |
Bool HasSameStructure | ( | const TreeMap < K, V, MAP, COW > & | other | ) | const |
Result < Bool > ForEachPreOrder | ( | OP && | callback | ) | const |
Result < Bool > ForEachPreOrder | ( | OP && | callback , |
PATH && |
path
=
PATH()
|
||
) | const |
Result < Bool > ForEachPreOrder | ( | OP && | callback | ) |
Result < Bool > ForEachPreOrder | ( | OP && | callback , |
PATH && |
path
=
PATH()
|
||
) |
Result <void> ForEachPreOrderX | ( | OP && | callback , |
PATH && |
path
=
PATH()
|
||
) |
Result < Bool > ForEachPostOrder | ( | OP && | callback | ) | const |
Result < Bool > ForEachPostOrder | ( | OP && | callback , |
PATH && |
path
=
PATH()
|
||
) | const |
Result < Bool > ForEachPostOrder | ( | OP && | callback | ) |
Result < Bool > ForEachPostOrder | ( | OP && | callback , |
PATH && |
path
=
PATH()
|
||
) |
Result <void> GetPath | ( | PATH & | path | ) | const |
Int GetDepth | ( | ) | const |
IndexIterator <const K&, const TreeMap , TreeMap > GetPath | ( | ) | const |
|
static |
|
private |
|
private |
|
private |
|
private |