OrderedIndex

ordered index implementation

mixin template OrderedIndex (
size_t N
bool allowDuplicates
alias KeyFromValue
alias Compare
ThisContainer
) {}

Members

Aliases

ConstOrderedRange
alias ConstOrderedRange = OrderedRangeT!true
Undocumented in source.
Elem
alias Elem = ValueView

Element type for the tree

KeyType
alias KeyType = typeof(key(Value.init))
Undocumented in source.
Node
alias Node = ThisNode*
Undocumented in source.
OrderedRange
alias OrderedRange = OrderedRangeT!false
Undocumented in source.
_Insert
alias _Insert = _add
Undocumented in source.
_less
alias _less = binaryFun!Compare
Undocumented in source.
key
alias key = unaryFun!KeyFromValue
Undocumented in source.

Functions

_Check
void _Check()
Undocumented in source. Be warned that the author may not have intended to support it.
_ClearIndex
void _ClearIndex()
Undocumented in source. Be warned that the author may not have intended to support it.
_DenyInsertion
bool _DenyInsertion(Node n, Node cursor)
Undocumented in source. Be warned that the author may not have intended to support it.
_FixPosition
void _FixPosition(ThisNode* node, KeyType oldPosition, ThisNode* cursor)
Undocumented in source.
_Insert
void _Insert(Node n, Node cursor)
Undocumented in source. Be warned that the author may not have intended to support it.
_NodePosition
KeyType _NodePosition(ThisNode* node)
Undocumented in source. Be warned that the author may not have intended to support it.
_NodeReplace
void _NodeReplace(ThisNode* old, ThisNode* newnode)
Undocumented in source. Be warned that the author may not have intended to support it.
_NotifyChange
bool _NotifyChange(Node node)
Undocumented in source.
_PositionFixable
bool _PositionFixable(ThisNode* node, KeyType oldPosition, ThisNode* cursor)
Undocumented in source. Be warned that the author may not have intended to support it.
_Remove
Node _Remove(Node n)
Undocumented in source.
_add
auto _add(Node n)
Undocumented in source. Be warned that the author may not have intended to support it.
bounds
auto bounds(U lower, U upper)

Get a range of values bounded below by lower and above by upper, with inclusiveness defined by boundaries. Complexity: O(log(n))

cEqualRange
OrderedRange cEqualRange(CompatibleKey k)
Undocumented in source. Be warned that the author may not have intended to support it.
cEqualRange
ConstOrderedRange cEqualRange(CompatibleKey k)
Undocumented in source. Be warned that the author may not have intended to support it.
cbounds
auto cbounds(CompatibleKey lower, CompatibleKey upper)
Undocumented in source.
clear
void clear()

Removes all elements from the container.

equalRange
auto equalRange(U k)

Get a range from the container with all elements that are == k according to the less comparator

equalRange
auto equalRange(U k)
Undocumented in source. Be warned that the author may not have intended to support it.
insert
size_t insert(Stuff stuff)

Insert a single element in the container. Note that this does not invalidate any ranges currently iterating the container.

insert
size_t insert(Stuff stuff)

Insert a range of elements in the container. Note that this does not invalidate any ranges currently iterating the container.

lowerBound
auto lowerBound(U k)

Get a range from the container with all elements that are < k according to the less comparator

lowerBound
auto lowerBound(U k)
Undocumented in source. Be warned that the author may not have intended to support it.
lowerBound
auto lowerBound(CompatibleKey k)
Undocumented in source. Be warned that the author may not have intended to support it.
lowerBound
auto lowerBound(CompatibleKey k)
Undocumented in source. Be warned that the author may not have intended to support it.
modify
void modify(SomeRange r, Modifier mod)

Perform mod on r.front and performs any necessary fixups to container's indices. If the result of mod violates any index' invariant, r.front is removed from the container. Preconditions: !r.empty,
mod is a callable of the form void mod(ref Value) Complexity: O(m(n)),
O(log(n)) for this index

opBinaryRight
bool opBinaryRight(Elem e)

in operator. Check to see if the given element exists in the container.

opBinaryRight
bool opBinaryRight(K k)

in operator. Check to see if the given element exists in the container.

opIndex
ValueView opIndex(KeyType k)

Available for Unique variant. Complexity: O(log(n))

opSlice
OrderedRange opSlice()

Fetch a range that spans all the elements in the container.

opSlice
ConstOrderedRange opSlice()
Undocumented in source. Be warned that the author may not have intended to support it.
printTree
void printTree(Node n, int indent)
Undocumented in source. Be warned that the author may not have intended to support it.
remove
OrderedRange remove(R r)

Removes the given range from the container.

removeAny
Elem removeAny()

Remove an element from the container and return its value.

removeBack
void removeBack()

Remove the back element from the container.

removeFront
void removeFront()

Remove the front element from the container.

removeKey
size_t removeKey(Keys keys)

Removes elements from the container that are equal to the given values according to the less comparator. One element is removed for each value given which is in the container. If allowDuplicates is true, duplicates are removed only if duplicate values are given.

removeKey
size_t removeKey(Key[] keys)
Undocumented in source.
removeKey
size_t removeKey(Stuff stuff)

Removes elements from the container that are equal to the given values according to the less comparator. One element is removed for each value given which is in the container. If allowDuplicates is true, duplicates are removed only if duplicate values are given.

replace
bool replace(Position!ThisNode r, ValueView value)

Replaces r.front with value

toString0
string toString0()
Undocumented in source. Be warned that the author may not have intended to support it.
upperBound
auto upperBound(U k)

Get a range from the container with all elements that are > k according to the less comparator

upperBound
auto upperBound(U k)
Undocumented in source. Be warned that the author may not have intended to support it.
upperBound
auto upperBound(CompatibleKey k)
Undocumented in source. Be warned that the author may not have intended to support it.
upperBound
auto upperBound(CompatibleKey k)
Undocumented in source. Be warned that the author may not have intended to support it.

Properties

back
back [@property getter]

The last element in the container

empty
bool empty [@property getter]

Check if any elements exist in the container. Returns true if at least one element exists. Complexity: O(1)

front
front [@property getter]

The front element in the container

length
size_t length [@property getter]

Returns the number of elements in the container.

Structs

OrderedRangeT
struct OrderedRangeT(bool is_const)

The range type for this index, which embodies a bidirectional range

Templates

IsMyRange
template IsMyRange(T)
Undocumented in source.

Variables

_end
Node _end;
Undocumented in source.

Meta