All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
le_hashmap.h
Go to the documentation of this file.
1 
175 #ifndef LEGATO_HASHMAP_INCLUDE_GUARD
176 #define LEGATO_HASHMAP_INCLUDE_GUARD
177 
178 //--------------------------------------------------------------------------------------------------
182 //--------------------------------------------------------------------------------------------------
183 typedef struct le_hashmap* le_hashmap_Ref_t;
184 
185 //--------------------------------------------------------------------------------------------------
189 //--------------------------------------------------------------------------------------------------
190 typedef struct le_hashmap_It* le_hashmap_It_Ref_t;
191 
192 //--------------------------------------------------------------------------------------------------
200 //--------------------------------------------------------------------------------------------------
201 typedef size_t (*le_hashmap_HashFunc_t)
202 (
203  const void* keyToHashPtr
204 );
205 
206 //--------------------------------------------------------------------------------------------------
216 //--------------------------------------------------------------------------------------------------
217 typedef bool (*le_hashmap_EqualsFunc_t)
218 (
219  const void* firstKeyPtr,
220  const void* secondKeyPtr
221 );
222 
223 
224 //--------------------------------------------------------------------------------------------------
234 //--------------------------------------------------------------------------------------------------
235 typedef bool (*le_hashmap_ForEachHandler_t)
236 (
237  const void* keyPtr,
238  const void* valuePtr,
239  void* contextPtr
240 );
241 
242 //--------------------------------------------------------------------------------------------------
253 //--------------------------------------------------------------------------------------------------
255 (
256  const char* nameStr,
257  size_t capacity,
258  le_hashmap_HashFunc_t hashFunc,
259  le_hashmap_EqualsFunc_t equalsFunc
260 );
261 
262 //--------------------------------------------------------------------------------------------------
270 //--------------------------------------------------------------------------------------------------
271 
272 void* le_hashmap_Put
273 (
274  le_hashmap_Ref_t mapRef,
275  const void* keyPtr,
276  const void* valuePtr
277 );
278 
279 //--------------------------------------------------------------------------------------------------
286 //--------------------------------------------------------------------------------------------------
287 
288 void* le_hashmap_Get
289 (
290  le_hashmap_Ref_t mapRef,
291  const void* keyPtr
292 );
293 
294 //--------------------------------------------------------------------------------------------------
301 //--------------------------------------------------------------------------------------------------
302 
303 void* le_hashmap_Remove
304 (
305  le_hashmap_Ref_t mapRef,
306  const void* keyPtr
307 );
308 
309 //--------------------------------------------------------------------------------------------------
316 //--------------------------------------------------------------------------------------------------
317 
319 (
320  le_hashmap_Ref_t mapRef
321 );
322 
323 //--------------------------------------------------------------------------------------------------
330 //--------------------------------------------------------------------------------------------------
331 
332 size_t le_hashmap_Size
333 (
334  le_hashmap_Ref_t mapRef
335 );
336 
337 //--------------------------------------------------------------------------------------------------
344 //--------------------------------------------------------------------------------------------------
345 
347 (
348  le_hashmap_Ref_t mapRef,
349  const void* keyPtr
350 );
351 
352 //--------------------------------------------------------------------------------------------------
359 //--------------------------------------------------------------------------------------------------
360 
362 (
363  le_hashmap_Ref_t mapRef
364 );
365 
366 //--------------------------------------------------------------------------------------------------
374 //--------------------------------------------------------------------------------------------------
376 (
377  le_hashmap_Ref_t mapRef,
378  le_hashmap_ForEachHandler_t forEachFn,
379  void* contextPtr
380 );
381 
382 //--------------------------------------------------------------------------------------------------
395 //--------------------------------------------------------------------------------------------------
397 (
398  le_hashmap_Ref_t mapRef
399 );
400 
401 //--------------------------------------------------------------------------------------------------
409 //--------------------------------------------------------------------------------------------------
411 (
412  le_hashmap_It_Ref_t iteratorRef
413 );
414 
415 //--------------------------------------------------------------------------------------------------
423 //--------------------------------------------------------------------------------------------------
425 (
426  le_hashmap_It_Ref_t iteratorRef
427 );
428 
429 //--------------------------------------------------------------------------------------------------
439 //--------------------------------------------------------------------------------------------------
440 void const * le_hashmap_GetKey
441 (
442  le_hashmap_It_Ref_t iteratorRef
443 );
444 
445 //--------------------------------------------------------------------------------------------------
455 //--------------------------------------------------------------------------------------------------
456 void const * le_hashmap_GetValue
457 (
458  le_hashmap_It_Ref_t iteratorRef
459 );
460 
461 //--------------------------------------------------------------------------------------------------
473 //--------------------------------------------------------------------------------------------------
475 (
476  le_hashmap_Ref_t mapRef,
477  void **firstKeyPtr,
478  void **firstValuePtr
479 );
480 
481 //--------------------------------------------------------------------------------------------------
494 //--------------------------------------------------------------------------------------------------
496 (
497  le_hashmap_Ref_t mapRef,
498  const void* keyPtr,
499  void **nextKeyPtr,
500  void **nextValuePtr
501 );
502 
503 
504 //--------------------------------------------------------------------------------------------------
512 //--------------------------------------------------------------------------------------------------
513 
515 (
516  le_hashmap_Ref_t mapRef
517 );
518 
519 //--------------------------------------------------------------------------------------------------
527 //--------------------------------------------------------------------------------------------------
528 
530 (
531  const void* stringToHashPtr
532 );
533 
534 //--------------------------------------------------------------------------------------------------
542 //--------------------------------------------------------------------------------------------------
543 
545 (
546  const void* firstStringPtr,
547  const void* secondStringPtr
548 );
549 
550 //--------------------------------------------------------------------------------------------------
558 //--------------------------------------------------------------------------------------------------
559 
561 (
562  const void* intToHashPtr
563 );
564 
565 //--------------------------------------------------------------------------------------------------
573 //--------------------------------------------------------------------------------------------------
574 
576 (
577  const void* firstIntPtr,
578  const void* secondIntPtr
579 );
580 
581 //--------------------------------------------------------------------------------------------------
589 //--------------------------------------------------------------------------------------------------
590 
592 (
593  const void* voidToHashPtr
594 );
595 
596 //--------------------------------------------------------------------------------------------------
604 //--------------------------------------------------------------------------------------------------
605 
607 (
608  const void* firstVoidPtr,
609  const void* secondVoidPtr
610 );
611 
612 
613 
614 //--------------------------------------------------------------------------------------------------
621 //--------------------------------------------------------------------------------------------------
623 (
624  le_hashmap_Ref_t mapRef
625 );
626 
627 
628 //--------------------------------------------------------------------------------------------------
632 //--------------------------------------------------------------------------------------------------
634 (
635  le_hashmap_Ref_t mapRef
636 );
637 
638 
639 #endif /* LEGATO_HASHMAP_INCLUDE_GUARD */
void le_hashmap_EnableTrace(le_hashmap_Ref_t mapRef)
le_result_t
Definition: le_basics.h:34
le_hashmap_It_Ref_t le_hashmap_GetIterator(le_hashmap_Ref_t mapRef)
struct le_hashmap_It * le_hashmap_It_Ref_t
Definition: le_hashmap.h:190
void const * le_hashmap_GetValue(le_hashmap_It_Ref_t iteratorRef)
struct le_hashmap * le_hashmap_Ref_t
Definition: le_hashmap.h:183
size_t le_hashmap_Size(le_hashmap_Ref_t mapRef)
bool le_hashmap_EqualsString(const void *firstStringPtr, const void *secondStringPtr)
size_t le_hashmap_HashUInt32(const void *intToHashPtr)
bool(* le_hashmap_EqualsFunc_t)(const void *firstKeyPtr, const void *secondKeyPtr)
Definition: le_hashmap.h:218
size_t le_hashmap_HashString(const void *stringToHashPtr)
void le_hashmap_ForEach(le_hashmap_Ref_t mapRef, le_hashmap_ForEachHandler_t forEachFn, void *contextPtr)
bool le_hashmap_isEmpty(le_hashmap_Ref_t mapRef)
bool le_hashmap_EqualsVoidPointer(const void *firstVoidPtr, const void *secondVoidPtr)
void * le_hashmap_Put(le_hashmap_Ref_t mapRef, const void *keyPtr, const void *valuePtr)
void const * le_hashmap_GetKey(le_hashmap_It_Ref_t iteratorRef)
size_t le_hashmap_CountCollisions(le_hashmap_Ref_t mapRef)
le_result_t le_hashmap_GetFirstNode(le_hashmap_Ref_t mapRef, void **firstKeyPtr, void **firstValuePtr)
size_t le_hashmap_HashVoidPointer(const void *voidToHashPtr)
void le_hashmap_MakeTraceable(le_hashmap_Ref_t mapRef)
void * le_hashmap_Remove(le_hashmap_Ref_t mapRef, const void *keyPtr)
bool le_hashmap_ContainsKey(le_hashmap_Ref_t mapRef, const void *keyPtr)
bool(* le_hashmap_ForEachHandler_t)(const void *keyPtr, const void *valuePtr, void *contextPtr)
Definition: le_hashmap.h:236
le_hashmap_Ref_t le_hashmap_Create(const char *nameStr, size_t capacity, le_hashmap_HashFunc_t hashFunc, le_hashmap_EqualsFunc_t equalsFunc)
void le_hashmap_RemoveAll(le_hashmap_Ref_t mapRef)
size_t(* le_hashmap_HashFunc_t)(const void *keyToHashPtr)
Definition: le_hashmap.h:202
void * le_hashmap_Get(le_hashmap_Ref_t mapRef, const void *keyPtr)
le_result_t le_hashmap_NextNode(le_hashmap_It_Ref_t iteratorRef)
bool le_hashmap_EqualsUInt32(const void *firstIntPtr, const void *secondIntPtr)
le_result_t le_hashmap_PrevNode(le_hashmap_It_Ref_t iteratorRef)
le_result_t le_hashmap_GetNodeAfter(le_hashmap_Ref_t mapRef, const void *keyPtr, void **nextKeyPtr, void **nextValuePtr)