rt.aaA

Implementation of associative arrays.

License:
Boost License 1.0.
Authors:
Martin Nowak
immutable int _aaVersion;

AA version for debuggers, bump whenever changing the layout

struct AA;

Opaque AA wrapper

pure nothrow @nogc size_t _aaLen(scope const AA aa);

Determine number of entries in associative array.

void* _aaGetY(AA* paa, const TypeInfo_AssociativeArray ti, const size_t valsz, scope const void* pkey);

Lookup *pkey in aa. Called only from implementation of (aa[key]) expressions when value is mutable.

Parameters:
AA* paa associative array opaque pointer
TypeInfo_AssociativeArray ti TypeInfo for the associative array
size_t valsz ignored
void* pkey pointer to the key value
Returns:
if key was in the aa, a mutable pointer to the existing value. If key was not in the aa, a mutable pointer to newly inserted value which is set to all zeros
void* _aaGetX(AA* paa, const TypeInfo_AssociativeArray ti, const size_t valsz, scope const void* pkey, out bool found);

Lookup *pkey in aa. Called only from implementation of require

Parameters:
AA* paa associative array opaque pointer
TypeInfo_AssociativeArray ti TypeInfo for the associative array
size_t valsz ignored
void* pkey pointer to the key value
bool found true if the value was found
Returns:
if key was in the aa, a mutable pointer to the existing value. If key was not in the aa, a mutable pointer to newly inserted value which is set to all zeros
inout(void)* _aaGetRvalueX(inout AA aa, scope const TypeInfo keyti, const size_t valsz, scope const void* pkey);

Lookup *pkey in aa. Called only from implementation of (aa[key]) expressions when value is not mutable.

Parameters:
AA aa associative array opaque pointer
TypeInfo keyti TypeInfo for the key
size_t valsz ignored
void* pkey pointer to the key value
Returns:
pointer to value if present, null otherwise
inout(void)* _aaInX(inout AA aa, scope const TypeInfo keyti, scope const void* pkey);

Lookup *pkey in aa. Called only from implementation of (key in aa) expressions.

Parameters:
AA aa associative array opaque pointer
TypeInfo keyti TypeInfo for the key
void* pkey pointer to the key value
Returns:
pointer to value if present, null otherwise
bool _aaDelX(AA aa, scope const TypeInfo keyti, scope const void* pkey);

Delete entry scope const AA, return true if it was present

pure nothrow void _aaClear(AA aa);

Remove all elements from AA.

pure nothrow void* _aaRehash(AA* paa, scope const TypeInfo keyti);

Rehash AA

pure nothrow inout(void[]) _aaValues(inout AA aa, const size_t keysz, const size_t valsz, const TypeInfo tiValueArray);

Return a GC allocated array of all values

pure nothrow inout(void[]) _aaKeys(inout AA aa, const size_t keysz, const TypeInfo tiKeyArray);

Return a GC allocated array of all keys

int _aaApply(AA aa, const size_t keysz, dg_t dg);

foreach opApply over all values

int _aaApply2(AA aa, const size_t keysz, dg2_t dg);

foreach opApply over all key/value pairs

Impl* _d_assocarrayliteralTX(const TypeInfo_AssociativeArray ti, void[] keys, void[] vals);

Construct an associative array of type ti from keys and value

int _aaEqual(scope const TypeInfo tiRaw, scope const AA aa1, scope const AA aa2);

compares 2 AAs for equality

nothrow hash_t _aaGetHash(scope const AA* paa, scope const TypeInfo tiRaw);

compute a hash

struct Range;

aaRange implements a ForwardRange

© 1999–2021 The D Language Foundation
Licensed under the Boost License 1.0.
https://dlang.org/phobos/rt_aaA.html