Report a bug
		
				If you spot a problem with this page, click here to create a Bugzilla issue.
		
			Improve this page
		
			Quickly fork, edit online, and submit a pull request for this page.
			Requires a signed-in GitHub account. This works well for small changes.
			If you'd like to make larger changes you may want to consider using
			a local clone.
		
	rt.aaA
Implementation of associative arrays.
License: 
Authors: 
Martin Nowak
Source rt/aaA.d
- immutable int_aaVersion;
- AA version for debuggers, bump whenever changing the layout
- structAA;
- Opaque AA wrapper
- Impl*_aaNew(const TypeInfo_AssociativeArrayti);
- Allocate associative array data. Called for new SomeAA expression.Parameters:TypeInfo_AssociativeArray tiTypeInfo for the associative array Returns:A new associative array.
- pure nothrow @nogc size_t_aaLen(scope const AAaa);
- Determine number of entries in associative array.
- void*_aaGetY(scope AA*paa, const TypeInfo_AssociativeArrayti, const size_tvalsz, scope const void*pkey);
- Lookup *pkey in aa. Called only from implementation of (aa[key]) expressions when value is mutable.Parameters:AA* paaassociative array opaque pointer TypeInfo_AssociativeArray tiTypeInfo for the associative array size_t valszignored void* pkeypointer 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(scope AA*paa, const TypeInfo_AssociativeArrayti, const size_tvalsz, scope const void*pkey, out boolfound);
- Lookup *pkey in aa. Called only from implementation of requireParameters:AA* paaassociative array opaque pointer TypeInfo_AssociativeArray tiTypeInfo for the associative array size_t valszignored void* pkeypointer to the key value bool foundtrue 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 AAaa, scope const TypeInfokeyti, const size_tvalsz, scope const void*pkey);
- Lookup *pkey in aa. Called only from implementation of (aa[key]) expressions when value is not mutable.Parameters:AA aaassociative array opaque pointer TypeInfo keytiTypeInfo for the key size_t valszignored void* pkeypointer to the key value Returns:pointer to value if present, null otherwise
- inout(void)*_aaInX(inout AAaa, scope const TypeInfokeyti, scope const void*pkey);
- Lookup *pkey in aa. Called only from implementation of (key in aa) expressions.Parameters:AA aaassociative array opaque pointer TypeInfo keytiTypeInfo for the key void* pkeypointer to the key value Returns:pointer to value if present, null otherwise
- bool_aaDelX(AAaa, scope const TypeInfokeyti, scope const void*pkey);
- Delete entry scope const AA, return true if it was present
- pure nothrow @safe void_aaClear(AAaa);
- Remove all elements from AA.
- pure nothrow void*_aaRehash(AA*paa, scope const TypeInfokeyti);
- Rehash AA
- pure nothrow inout(void[])_aaValues(inout AAaa, const size_tkeysz, const size_tvalsz, const TypeInfotiValueArray);
- Return a GC allocated array of all values
- pure nothrow inout(void[])_aaKeys(inout AAaa, const size_tkeysz, const TypeInfotiKeyArray);
- Return a GC allocated array of all keys
- int_aaApply(AAaa, const size_tkeysz, dg_tdg);
- foreach opApply over all values
- int_aaApply2(AAaa, const size_tkeysz, dg2_tdg);
- foreach opApply over all key/value pairs
- Impl*_d_assocarrayliteralTX(const TypeInfo_AssociativeArrayti, void[]keys, void[]vals);
- Construct an associative array of type ti from corresponding keys and values. Called for an AA literal [k1:v1, k2:v2].Parameters:TypeInfo_AssociativeArray tiTypeInfo for the associative array void[] keysarray of keys void[] valsarray of values Returns:A new associative array opaque pointer, or null ifkeysis empty.
- int_aaEqual(scope const TypeInfotiRaw, scope const AAaa1, scope const AAaa2);
- compares 2 AAs for equality
- nothrow hash_t_aaGetHash(scope const AA*paa, scope const TypeInfotiRaw);
- compute a hash
- structRange;
- aaRange implements a ForwardRange
Copyright © 1999-2025 by the D Language Foundation | Page generated by
Ddoc on Mon Mar 31 10:28:10 2025