ModelMap

A utility wrapper around an associative array that stores models.

Members

Functions

each
auto each(void delegate(TValue) f)

Allows applying a delegate over the values of the mapping.

filter
auto filter(bool delegate(TValue) f)

Allows using a delegate to filter the values of the mapping.

get
TValue get(TKey key)

Return the value for a key.

get
TValue get(TKey key, TValue def)

Return the value for a key, or if it doesn't exist a default value.

has
bool has(TKey key)

Returns true if the key exists within the mapping.

keys
auto keys()

Returns an array of keys from the mapping.

length
size_t length()

Returns the length of the mapping.

opCall
TValue opCall(TKey key)

Utility method that returns the value for a key.

opIndex
TValue opIndex(TKey key)
Undocumented in source. Be warned that the author may not have intended to support it.
opIndexAssign
void opIndexAssign(TValue value, TKey key)
Undocumented in source. Be warned that the author may not have intended to support it.
pick
TValue pick(bool delegate(TValue) f)

Returns a single value from the mapping, based on the return value of a delegate.

remove
void remove(TKey key)

Removes a key.

set
TValue set(TKey key, TValue value)

Set the key to a value.

values
auto values()

returns an array of values from the mapping.

Variables

data
TValue[TKey] data;
Undocumented in source.

Meta