Class QueueArray
- All Implemented Interfaces:
Proxy
GstQueueArray is an object that provides standard queue functionality
based on an array instead of linked lists. This reduces the overhead
caused by memory management by a large factor.-
Constructor Summary
ConstructorsConstructorDescriptionQueueArray(MemorySegment address) Deprecated.Create a QueueArray proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Deprecated.UseGstVecDequeinstead.@Nullable MemorySegmentdropElement(int idx) Deprecated.UseGstVecDequeinstead.booleandropStruct(int idx, @Nullable MemorySegment pStruct) Deprecated.UseGstVecDequeinstead.intfind(@Nullable CompareFunc func) Deprecated.UseGstVecDequeinstead.voidfree()Deprecated.UseGstVecDequeinstead.intDeprecated.UseGstVecDequeinstead.booleanisEmpty()Deprecated.UseGstVecDequeinstead.static QueueArraynew_(int initialSize) Deprecated.Allocates a newGstQueueArrayobject with an initial queue size ofinitialSize.static QueueArraynewForStruct(long structSize, int initialSize) Deprecated.UseGstVecDequeinstead.@Nullable MemorySegmentpeekHead()Deprecated.UseGstVecDequeinstead.@Nullable MemorySegmentDeprecated.UseGstVecDequeinstead.@Nullable MemorySegmentpeekNth(int idx) Deprecated.UseGstVecDequeinstead.@Nullable MemorySegmentpeekNthStruct(int idx) Deprecated.UseGstVecDequeinstead.@Nullable MemorySegmentpeekTail()Deprecated.UseGstVecDequeinstead.@Nullable MemorySegmentDeprecated.UseGstVecDequeinstead.@Nullable MemorySegmentpopHead()Deprecated.UseGstVecDequeinstead.@Nullable MemorySegmentDeprecated.UseGstVecDequeinstead.@Nullable MemorySegmentpopTail()Deprecated.UseGstVecDequeinstead.@Nullable MemorySegmentDeprecated.UseGstVecDequeinstead.voidpushSorted(@Nullable MemorySegment data, @Nullable CompareDataFunc func) Deprecated.UseGstVecDequeinstead.voidpushSortedStruct(@Nullable MemorySegment pStruct, @Nullable CompareDataFunc func) Deprecated.UseGstVecDequeinstead.voidpushTail(@Nullable MemorySegment data) Deprecated.UseGstVecDequeinstead.voidpushTailStruct(@Nullable MemorySegment pStruct) Deprecated.voidDeprecated.UseGstVecDequeinstead.voidsort(@Nullable CompareDataFunc compareFunc) Deprecated.UseGstVecDequeinstead.Methods inherited from class org.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
QueueArray
Deprecated.Create a QueueArray proxy instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
-
Method Details
-
new_
Deprecated.Allocates a newGstQueueArrayobject with an initial queue size ofinitialSize.- Parameters:
initialSize- Initial size of the new queue- Returns:
- a new
GstQueueArrayobject - Since:
- 1.2
-
newForStruct
Deprecated.UseGstVecDequeinstead.Allocates a newGstQueueArrayobject for elements (e.g. structures) of sizestructSize,with an initial queue size ofinitialSize.- Parameters:
structSize- Size of each element (e.g. structure) in the arrayinitialSize- Initial size of the new queue- Returns:
- a new
GstQueueArrayobject - Since:
- 1.6
-
clear
Deprecated.UseGstVecDequeinstead.Clears queue this QueueArray and frees all memory associated to it.- Since:
- 1.16
-
dropElement
Deprecated.UseGstVecDequeinstead.Drops the queue element at positionidxfrom queuearray.- Parameters:
idx- index to drop- Returns:
- the dropped element
- Since:
- 1.2
-
dropStruct
Deprecated.UseGstVecDequeinstead.Drops the queue element at positionidxfrom queue this QueueArray and copies the data of the element or structure that was removed intopStructifpStructis set (not NULL).- Parameters:
idx- index to droppStruct- address into which to store the data of the dropped structure, or NULL- Returns:
- TRUE on success, or FALSE on error
- Since:
- 1.6
-
find
Deprecated.UseGstVecDequeinstead.Finds an element in the queuearray,either by comparing every element withfuncor by looking updataif no compare functionfuncis provided, and returning the index of the found element.- Parameters:
func- comparison function, ornullto finddataby value- Returns:
- Index of the found element or -1 if nothing was found.
- Since:
- 1.2
-
free
Deprecated.UseGstVecDequeinstead.Frees queue this QueueArray and all memory associated to it.- Since:
- 1.2
-
getLength
Deprecated.UseGstVecDequeinstead.Returns the length of the queue this QueueArray- Returns:
- the length of the queue
array. - Since:
- 1.2
-
isEmpty
Deprecated.UseGstVecDequeinstead.Checks if the queue this QueueArray is empty.- Returns:
trueif the queue this QueueArray is empty- Since:
- 1.2
-
peekHead
Deprecated.UseGstVecDequeinstead.Returns the head of the queue this QueueArray and does not remove it from the queue.- Returns:
- The head of the queue
- Since:
- 1.2
-
peekHeadStruct
Deprecated.UseGstVecDequeinstead.Returns the head of the queue this QueueArray without removing it from the queue.- Returns:
- pointer to element or struct, or NULL if this QueueArray was empty. The data pointed to by the returned pointer stays valid only as long as the queue array is not modified further!
- Since:
- 1.6
-
peekNth
Deprecated.UseGstVecDequeinstead.Returns the item atidxinarray,but does not remove it from the queue.- Returns:
- The item, or
nullifidxwas out of bounds - Since:
- 1.16
-
peekNthStruct
Deprecated.UseGstVecDequeinstead.Returns the item atidxinarray,but does not remove it from the queue.- Returns:
- The item, or
nullifidxwas out of bounds - Since:
- 1.16
-
peekTail
Deprecated.UseGstVecDequeinstead.Returns the tail of the queuearray,but does not remove it from the queue.- Returns:
- The tail of the queue
- Since:
- 1.14
-
peekTailStruct
Deprecated.UseGstVecDequeinstead.Returns the tail of the queuearray,but does not remove it from the queue.- Returns:
- The tail of the queue
- Since:
- 1.14
-
popHead
Deprecated.UseGstVecDequeinstead.Returns and head of the queue this QueueArray and removes it from the queue.- Returns:
- The head of the queue
- Since:
- 1.2
-
popHeadStruct
Deprecated.UseGstVecDequeinstead.Returns the head of the queue this QueueArray and removes it from the queue.- Returns:
- pointer to element or struct, or NULL if this QueueArray was empty. The data pointed to by the returned pointer stays valid only as long as the queue array is not modified further!
- Since:
- 1.6
-
popTail
Deprecated.UseGstVecDequeinstead.Returns the tail of the queue this QueueArray and removes it from the queue.- Returns:
- The tail of the queue
- Since:
- 1.14
-
popTailStruct
Deprecated.UseGstVecDequeinstead.Returns the tail of the queue this QueueArray and removes it from the queue.- Returns:
- The tail of the queue
- Since:
- 1.14
-
pushSorted
Deprecated.UseGstVecDequeinstead.Pushesdatato the queuearray,finding the correct position by comparingdatawith each array element usingfunc.This has a time complexity of O(n), so depending on the size of the queue and expected access patterns, a different data structure might be better.
Assumes that the array is already sorted. If it is not, make sure to call gst_queue_array_sort() first.
- Parameters:
data- object to pushfunc- comparison function- Since:
- 1.24
-
pushSortedStruct
@Deprecated public void pushSortedStruct(@Nullable MemorySegment pStruct, @Nullable CompareDataFunc func) Deprecated.UseGstVecDequeinstead.Pushes the element at addresspStructinto the queue this QueueArray (copying the contents of a structure of the struct_size specified when creating the queue into the array), finding the correct position by comparing the element atpStructwith each element in the array usingfunc.This has a time complexity of O(n), so depending on the size of the queue and expected access patterns, a different data structure might be better.
Assumes that the array is already sorted. If it is not, make sure to call gst_queue_array_sort() first.
- Parameters:
pStruct- address of element or structure to push into the queuefunc- comparison function- Since:
- 1.24
-
pushTail
Deprecated.UseGstVecDequeinstead.Pushesdatato the tail of the queuearray.- Parameters:
data- object to push- Since:
- 1.2
-
pushTailStruct
Deprecated. -
setClearFunc
Deprecated.UseGstVecDequeinstead.Sets a function to clear an element ofarray.The
clearFuncwill be called when an element in the array data segment is removed and when the array is freed and data segment is deallocated as well.clearFuncwill be passed a pointer to the element to clear, rather than the element itself.Note that in contrast with other uses of
GDestroyNotifyfunctions,clearFuncis expected to clear the contents of the array element it is given, but not free the element itself.- Since:
- 1.16
-
sort
Deprecated.UseGstVecDequeinstead.Sorts the queue this QueueArray by comparing elements against each other using the providedcompareFunc.- Parameters:
compareFunc- comparison function- Since:
- 1.24
-
GstVecDequeinstead.