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 //--------------------------------------------------------------------------------------------------298 //--------------------------------------------------------------------------------------------------303 * @param[in] maxRefs Maximum number of Safe References expected to be kept in this Reference Map308 //--------------------------------------------------------------------------------------------------316 //--------------------------------------------------------------------------------------------------320 //--------------------------------------------------------------------------------------------------323 //--------------------------------------------------------------------------------------------------328 * @param[in] maxRefs Maximum number of Safe References expected to be kept in this Reference Map333 //--------------------------------------------------------------------------------------------------345 //--------------------------------------------------------------------------------------------------347 * Creates a Safe Reference, storing a mapping between that reference and a specified pointer for352 //--------------------------------------------------------------------------------------------------360 //--------------------------------------------------------------------------------------------------368 //--------------------------------------------------------------------------------------------------376 //--------------------------------------------------------------------------------------------------380 //--------------------------------------------------------------------------------------------------388 //--------------------------------------------------------------------------------------------------391 * controlled by the calling function using the le_ref_NextNode() function. There is one iterator395 * @return Returns A reference to a hashmap iterator which is ready for le_hashmap_NextNode() to be398 //--------------------------------------------------------------------------------------------------405 //--------------------------------------------------------------------------------------------------413 //--------------------------------------------------------------------------------------------------420 //--------------------------------------------------------------------------------------------------422 * Retrieves a pointer to the safe ref iterator is currently pointing at. If the iterator has just430 //--------------------------------------------------------------------------------------------------437 //--------------------------------------------------------------------------------------------------440 * has just been initialized and le_ref_NextNode() has not been called, or if the iterator has been443 * @return A pointer to the current value, or NULL if the iterator has been invalidated or is not446 //--------------------------------------------------------------------------------------------------453 //--------------------------------------------------------------------------------------------------457 //--------------------------------------------------------------------------------------------------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