All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
le_hashmap.h
Go to the documentation of this file.
1 
162 //--------------------------------------------------------------------------------------------------
170 //--------------------------------------------------------------------------------------------------
171 
172 #ifndef LEGATO_HASHMAP_INCLUDE_GUARD
173 #define LEGATO_HASHMAP_INCLUDE_GUARD
174 
175 //--------------------------------------------------------------------------------------------------
179 //--------------------------------------------------------------------------------------------------
180 typedef struct le_hashmap* le_hashmap_Ref_t;
181 
182 //--------------------------------------------------------------------------------------------------
186 //--------------------------------------------------------------------------------------------------
187 typedef struct le_hashmap_It* le_hashmap_It_Ref_t;
188 
189 //--------------------------------------------------------------------------------------------------
197 //--------------------------------------------------------------------------------------------------
198 typedef size_t (*le_hashmap_HashFunc_t)
199 (
200  const void* keyToHashPtr
201 );
202 
203 //--------------------------------------------------------------------------------------------------
213 //--------------------------------------------------------------------------------------------------
214 typedef bool (*le_hashmap_EqualsFunc_t)
215 (
216  const void* firstKeyPtr,
217  const void* secondKeyPtr
218 );
219 
220 
221 //--------------------------------------------------------------------------------------------------
231 //--------------------------------------------------------------------------------------------------
232 typedef bool (*le_hashmap_ForEachHandler_t)
233 (
234  const void* keyPtr,
235  const void* valuePtr,
236  void* contextPtr
237 );
238 
239 //--------------------------------------------------------------------------------------------------
250 //--------------------------------------------------------------------------------------------------
252 (
253  const char* nameStr,
254  size_t capacity,
255  le_hashmap_HashFunc_t hashFunc,
256  le_hashmap_EqualsFunc_t equalsFunc
257 );
258 
259 //--------------------------------------------------------------------------------------------------
267 //--------------------------------------------------------------------------------------------------
268 
269 void* le_hashmap_Put
270 (
271  le_hashmap_Ref_t mapRef,
272  const void* keyPtr,
273  const void* valuePtr
274 );
275 
276 //--------------------------------------------------------------------------------------------------
283 //--------------------------------------------------------------------------------------------------
284 
285 void* le_hashmap_Get
286 (
287  le_hashmap_Ref_t mapRef,
288  const void* keyPtr
289 );
290 
291 //--------------------------------------------------------------------------------------------------
298 //--------------------------------------------------------------------------------------------------
299 
300 void* le_hashmap_Remove
301 (
302  le_hashmap_Ref_t mapRef,
303  const void* keyPtr
304 );
305 
306 //--------------------------------------------------------------------------------------------------
313 //--------------------------------------------------------------------------------------------------
314 
316 (
317  le_hashmap_Ref_t mapRef
318 );
319 
320 //--------------------------------------------------------------------------------------------------
327 //--------------------------------------------------------------------------------------------------
328 
329 size_t le_hashmap_Size
330 (
331  le_hashmap_Ref_t mapRef
332 );
333 
334 //--------------------------------------------------------------------------------------------------
341 //--------------------------------------------------------------------------------------------------
342 
344 (
345  le_hashmap_Ref_t mapRef,
346  const void* keyPtr
347 );
348 
349 //--------------------------------------------------------------------------------------------------
356 //--------------------------------------------------------------------------------------------------
357 
359 (
360  le_hashmap_Ref_t mapRef
361 );
362 
363 //--------------------------------------------------------------------------------------------------
371 //--------------------------------------------------------------------------------------------------
373 (
374  le_hashmap_Ref_t mapRef,
375  le_hashmap_ForEachHandler_t forEachFn,
376  void* contextPtr
377 );
378 
379 //--------------------------------------------------------------------------------------------------
392 //--------------------------------------------------------------------------------------------------
394 (
395  le_hashmap_Ref_t mapRef
396 );
397 
398 //--------------------------------------------------------------------------------------------------
406 //--------------------------------------------------------------------------------------------------
408 (
409  le_hashmap_It_Ref_t iteratorRef
410 );
411 
412 //--------------------------------------------------------------------------------------------------
420 //--------------------------------------------------------------------------------------------------
422 (
423  le_hashmap_It_Ref_t iteratorRef
424 );
425 
426 //--------------------------------------------------------------------------------------------------
436 //--------------------------------------------------------------------------------------------------
437 void const * le_hashmap_GetKey
438 (
439  le_hashmap_It_Ref_t iteratorRef
440 );
441 
442 //--------------------------------------------------------------------------------------------------
452 //--------------------------------------------------------------------------------------------------
453 void const * le_hashmap_GetValue
454 (
455  le_hashmap_It_Ref_t iteratorRef
456 );
457 
458 //--------------------------------------------------------------------------------------------------
470 //--------------------------------------------------------------------------------------------------
472 (
473  le_hashmap_Ref_t mapRef,
474  void **firstKeyPtr,
475  void **firstValuePtr
476 );
477 
478 //--------------------------------------------------------------------------------------------------
491 //--------------------------------------------------------------------------------------------------
493 (
494  le_hashmap_Ref_t mapRef,
495  const void* keyPtr,
496  void **nextKeyPtr,
497  void **nextValuePtr
498 );
499 
500 
501 //--------------------------------------------------------------------------------------------------
509 //--------------------------------------------------------------------------------------------------
510 
512 (
513  le_hashmap_Ref_t mapRef
514 );
515 
516 //--------------------------------------------------------------------------------------------------
524 //--------------------------------------------------------------------------------------------------
525 
527 (
528  const void* stringToHashPtr
529 );
530 
531 //--------------------------------------------------------------------------------------------------
539 //--------------------------------------------------------------------------------------------------
540 
542 (
543  const void* firstStringPtr,
544  const void* secondStringPtr
545 );
546 
547 //--------------------------------------------------------------------------------------------------
555 //--------------------------------------------------------------------------------------------------
556 
558 (
559  const void* intToHashPtr
560 );
561 
562 //--------------------------------------------------------------------------------------------------
570 //--------------------------------------------------------------------------------------------------
571 
573 (
574  const void* firstIntPtr,
575  const void* secondIntPtr
576 );
577 
578 //--------------------------------------------------------------------------------------------------
586 //--------------------------------------------------------------------------------------------------
587 
589 (
590  const void* voidToHashPtr
591 );
592 
593 //--------------------------------------------------------------------------------------------------
601 //--------------------------------------------------------------------------------------------------
602 
604 (
605  const void* firstVoidPtr,
606  const void* secondVoidPtr
607 );
608 
609 
610 
611 //--------------------------------------------------------------------------------------------------
618 //--------------------------------------------------------------------------------------------------
620 (
621  le_hashmap_Ref_t mapRef
622 );
623 
624 
625 //--------------------------------------------------------------------------------------------------
629 //--------------------------------------------------------------------------------------------------
631 (
632  le_hashmap_Ref_t mapRef
633 );
634 
635 
636 #endif /* LEGATO_HASHMAP_INCLUDE_GUARD */
void le_hashmap_EnableTrace(le_hashmap_Ref_t mapRef)
le_result_t
Definition: le_basics.h:35
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:187
void const * le_hashmap_GetValue(le_hashmap_It_Ref_t iteratorRef)
struct le_hashmap * le_hashmap_Ref_t
Definition: le_hashmap.h:180
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:215
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:233
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:199
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)