le_safeRef.h
Go to the documentation of this file.
18 * <b> Safe References </b> are designed to help protect against damaged or stale references being46 * Reference (or if the client accidentally passes in some garbage value, like a pointer or zero),47 * the API function will try to translate that into an object pointer. But it'll be told that it's186 //--------------------------------------------------------------------------------------------------190 //--------------------------------------------------------------------------------------------------195 //--------------------------------------------------------------------------------------------------197 * Reference to a "Reference Map" object, which stores mappings from Safe References to pointers.199 //--------------------------------------------------------------------------------------------------203 //--------------------------------------------------------------------------------------------------207 //--------------------------------------------------------------------------------------------------211 //--------------------------------------------------------------------------------------------------215 //--------------------------------------------------------------------------------------------------222 //--------------------------------------------------------------------------------------------------228 //--------------------------------------------------------------------------------------------------247 //--------------------------------------------------------------------------------------------------254 //--------------------------------------------------------------------------------------------------260 //--------------------------------------------------------------------------------------------------264 //--------------------------------------------------------------------------------------------------276 //--------------------------------------------------------------------------------------------------282 * @param[in] maxRefs Maximum number of Safe References expected to be kept in this Reference Map287 //--------------------------------------------------------------------------------------------------302 //--------------------------------------------------------------------------------------------------307 * @param[in] maxRefs Maximum number of Safe References expected to be kept in this Reference Map312 //--------------------------------------------------------------------------------------------------320 //--------------------------------------------------------------------------------------------------324 //--------------------------------------------------------------------------------------------------327 //--------------------------------------------------------------------------------------------------332 * @param[in] maxRefs Maximum number of Safe References expected to be kept in this Reference Map337 //--------------------------------------------------------------------------------------------------350 //--------------------------------------------------------------------------------------------------352 * Creates a Safe Reference, storing a mapping between that reference and a specified pointer for357 //--------------------------------------------------------------------------------------------------365 //--------------------------------------------------------------------------------------------------373 //--------------------------------------------------------------------------------------------------381 //--------------------------------------------------------------------------------------------------385 //--------------------------------------------------------------------------------------------------393 //--------------------------------------------------------------------------------------------------396 * controlled by the calling function using the le_ref_NextNode() function. There is one iterator400 * @return Returns A reference to a hashmap iterator which is ready for le_hashmap_NextNode() to be403 //--------------------------------------------------------------------------------------------------410 //--------------------------------------------------------------------------------------------------418 //--------------------------------------------------------------------------------------------------425 //--------------------------------------------------------------------------------------------------427 * Retrieves a pointer to the safe ref iterator is currently pointing at. If the iterator has just435 //--------------------------------------------------------------------------------------------------442 //--------------------------------------------------------------------------------------------------445 * has just been initialized and le_ref_NextNode() has not been called, or if the iterator has been448 * @return A pointer to the current value, or NULL if the iterator has been invalidated or is not451 //--------------------------------------------------------------------------------------------------458 //--------------------------------------------------------------------------------------------------462 //--------------------------------------------------------------------------------------------------le_log_TraceRef_t traceRefTrace reference for debugging.Definition: le_safeRef.h:235uint32_t mapBaseRandomized "base" for references in this map.Definition: le_safeRef.h:242le_result_t le_ref_NextNode(le_ref_IterRef_t iteratorRef)char name[LIMIT_MAX_SAFE_REF_NAME_BYTES]Descriptive name for debugging.Definition: le_safeRef.h:234Definition: le_safeRef.h:229const void * le_ref_GetSafeRef(le_ref_IterRef_t iteratorRef)le_dls_Link_t entryMap list entry, for inspection tools.Definition: le_safeRef.h:231size_t maxRefsNominal maximum number of safe references.Definition: le_safeRef.h:241void * le_ref_Lookup(le_ref_MapRef_t mapRef, void *safeRef)le_ref_IterRef_t le_ref_GetIterator(le_ref_MapRef_t mapRef)void * le_ref_CreateRef(le_ref_MapRef_t mapRef, void *ptr)void le_ref_EnableTrace(le_ref_MapRef_t mapRef)le_ref_MapRef_t le_ref_CreateMap(const char *name, size_t maxRefs)void * le_ref_GetValue(le_ref_IterRef_t iteratorRef)void le_ref_DeleteRef(le_ref_MapRef_t mapRef, void *safeRef)Definition: le_doublyLinkedList.h:200