void fiftyoneDegreesWeightedItemListFree(fiftyoneDegreesWeightedItemList *list)
Frees the items array and resets the list to empty state.
void fiftyoneDegreesWeightedItemListExtend(fiftyoneDegreesWeightedItemList *list, uint32_t newCapacity, fiftyoneDegreesException *exception)
Extends the capacity of the list to the new capacity.
void fiftyoneDegreesWeightedItemListInit(fiftyoneDegreesWeightedItemList *list, uint32_t initialCapacity, float loadFactor)
Initializes a weighted item list with the specified initial capacity.
void fiftyoneDegreesWeightedItemListAdd(fiftyoneDegreesWeightedItemList *list, const fiftyoneDegreesWeightedItem *item, fiftyoneDegreesException *exception)
Adds a copy of the item to the list, extending capacity if needed based on the load factor.
void fiftyoneDegreesWeightedItemListRelease(fiftyoneDegreesWeightedItemList *list)
Releases all collection items in the list and resets the count to zero.
Used to store a handle to the underlying item that could be used to release the item when it's finish...
Definition collection.h:315
Structure used to represent a 51Degrees exception and passed into methods that might generate excepti...
Definition exceptions.h:115
fiftyoneDegreesCollectionItem item
The collection item containing the value.
Definition weightedItem.h:77
uint32_t rawWeighting
Weight as uint32_t (0-65535^2, representing 0.0-1.0).
Definition weightedItem.h:78
fiftyoneDegreesWeightedItem * items
Array of weighted items.
Definition weightedItem.h:91
uint32_t count
Number of items currently in use.
Definition weightedItem.h:92
float loadFactor
Load factor threshold for auto-extension.
Definition weightedItem.h:94
uint32_t capacity
Allocated capacity of the items array.
Definition weightedItem.h:93
