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 //--------------------------------------------------------------------------------------------------
299 //--------------------------------------------------------------------------------------------------
301 (
302  le_hashmap_Ref_t mapRef,
303  const void* keyPtr
304 );
305 
306 //--------------------------------------------------------------------------------------------------
313 //--------------------------------------------------------------------------------------------------
314 
315 void* le_hashmap_Remove
316 (
317  le_hashmap_Ref_t mapRef,
318  const void* keyPtr
319 );
320 
321 //--------------------------------------------------------------------------------------------------
328 //--------------------------------------------------------------------------------------------------
329 
331 (
332  le_hashmap_Ref_t mapRef
333 );
334 
335 //--------------------------------------------------------------------------------------------------
342 //--------------------------------------------------------------------------------------------------
343 
344 size_t le_hashmap_Size
345 (
346  le_hashmap_Ref_t mapRef
347 );
348 
349 //--------------------------------------------------------------------------------------------------
356 //--------------------------------------------------------------------------------------------------
357 
359 (
360  le_hashmap_Ref_t mapRef,
361  const void* keyPtr
362 );
363 
364 //--------------------------------------------------------------------------------------------------
371 //--------------------------------------------------------------------------------------------------
372 
374 (
375  le_hashmap_Ref_t mapRef
376 );
377 
378 //--------------------------------------------------------------------------------------------------
386 //--------------------------------------------------------------------------------------------------
388 (
389  le_hashmap_Ref_t mapRef,
390  le_hashmap_ForEachHandler_t forEachFn,
391  void* contextPtr
392 );
393 
394 //--------------------------------------------------------------------------------------------------
407 //--------------------------------------------------------------------------------------------------
409 (
410  le_hashmap_Ref_t mapRef
411 );
412 
413 //--------------------------------------------------------------------------------------------------
421 //--------------------------------------------------------------------------------------------------
423 (
424  le_hashmap_It_Ref_t iteratorRef
425 );
426 
427 //--------------------------------------------------------------------------------------------------
435 //--------------------------------------------------------------------------------------------------
437 (
438  le_hashmap_It_Ref_t iteratorRef
439 );
440 
441 //--------------------------------------------------------------------------------------------------
451 //--------------------------------------------------------------------------------------------------
452 void const * le_hashmap_GetKey
453 (
454  le_hashmap_It_Ref_t iteratorRef
455 );
456 
457 //--------------------------------------------------------------------------------------------------
467 //--------------------------------------------------------------------------------------------------
468 void const * le_hashmap_GetValue
469 (
470  le_hashmap_It_Ref_t iteratorRef
471 );
472 
473 //--------------------------------------------------------------------------------------------------
485 //--------------------------------------------------------------------------------------------------
487 (
488  le_hashmap_Ref_t mapRef,
489  void **firstKeyPtr,
490  void **firstValuePtr
491 );
492 
493 //--------------------------------------------------------------------------------------------------
506 //--------------------------------------------------------------------------------------------------
508 (
509  le_hashmap_Ref_t mapRef,
510  const void* keyPtr,
511  void **nextKeyPtr,
512  void **nextValuePtr
513 );
514 
515 
516 //--------------------------------------------------------------------------------------------------
524 //--------------------------------------------------------------------------------------------------
525 
527 (
528  le_hashmap_Ref_t mapRef
529 );
530 
531 //--------------------------------------------------------------------------------------------------
539 //--------------------------------------------------------------------------------------------------
540 
542 (
543  const void* stringToHashPtr
544 );
545 
546 //--------------------------------------------------------------------------------------------------
554 //--------------------------------------------------------------------------------------------------
555 
557 (
558  const void* firstStringPtr,
559  const void* secondStringPtr
560 );
561 
562 //--------------------------------------------------------------------------------------------------
570 //--------------------------------------------------------------------------------------------------
571 
573 (
574  const void* intToHashPtr
575 );
576 
577 //--------------------------------------------------------------------------------------------------
585 //--------------------------------------------------------------------------------------------------
586 
588 (
589  const void* firstIntPtr,
590  const void* secondIntPtr
591 );
592 
593 //--------------------------------------------------------------------------------------------------
601 //--------------------------------------------------------------------------------------------------
602 
604 (
605  const void* voidToHashPtr
606 );
607 
608 //--------------------------------------------------------------------------------------------------
616 //--------------------------------------------------------------------------------------------------
617 
619 (
620  const void* firstVoidPtr,
621  const void* secondVoidPtr
622 );
623 
624 
625 
626 //--------------------------------------------------------------------------------------------------
633 //--------------------------------------------------------------------------------------------------
635 (
636  le_hashmap_Ref_t mapRef
637 );
638 
639 
640 //--------------------------------------------------------------------------------------------------
644 //--------------------------------------------------------------------------------------------------
646 (
647  le_hashmap_Ref_t mapRef
648 );
649 
650 
651 #endif /* LEGATO_HASHMAP_INCLUDE_GUARD */
void le_hashmap_EnableTrace(le_hashmap_Ref_t mapRef)
void * le_hashmap_GetStoredKey(le_hashmap_Ref_t mapRef, const void *keyPtr)
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
size_t(* le_hashmap_HashFunc_t)(const void *keyToHashPtr)
Definition: le_hashmap.h:199
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)
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)
bool(* le_hashmap_EqualsFunc_t)(const void *firstKeyPtr, const void *secondKeyPtr)
Definition: le_hashmap.h:215
bool(* le_hashmap_ForEachHandler_t)(const void *keyPtr, const void *valuePtr, void *contextPtr)
Definition: le_hashmap.h:233
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)
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)
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)