MLT
7.28.0
|
Double-Ended Queue (deque) class. More...
Public Types | |
typedef int(* | mlt_deque_compare) (void *a, void *b) |
The callback function used to compare items for insert sort. More... | |
Public Member Functions | |
void | mlt_deque_close (mlt_deque self) |
Destroy the queue. More... | |
int | mlt_deque_count (mlt_deque self) |
Return the number of items in the deque. More... | |
mlt_deque | mlt_deque_init () |
Create a deque. More... | |
int | mlt_deque_insert (mlt_deque self, void *item, mlt_deque_compare cmp) |
Insert an item in a sorted fashion. More... | |
void * | mlt_deque_peek (mlt_deque self, int index) |
Inquire on item in deque but don't remove. More... | |
void * | mlt_deque_peek_back (mlt_deque self) |
Inquire on item at back of deque but don't remove. More... | |
double | mlt_deque_peek_back_double (mlt_deque self) |
Inquire on a double float at back of deque but don't remove. More... | |
int | mlt_deque_peek_back_int (mlt_deque self) |
Inquire on an integer at back of deque but don't remove. More... | |
void * | mlt_deque_peek_front (mlt_deque self) |
Inquire on item at front of deque but don't remove. More... | |
double | mlt_deque_peek_front_double (mlt_deque self) |
Inquire on a double float at front of deque but don't remove. More... | |
int | mlt_deque_peek_front_int (mlt_deque self) |
Inquire on an integer at front of deque but don't remove. More... | |
void * | mlt_deque_pop_back (mlt_deque self) |
Pop an item. More... | |
double | mlt_deque_pop_back_double (mlt_deque self) |
Pop a double float. More... | |
int | mlt_deque_pop_back_int (mlt_deque self) |
Pop an integer. More... | |
void * | mlt_deque_pop_front (mlt_deque self) |
Remove an item from the start. More... | |
double | mlt_deque_pop_front_double (mlt_deque self) |
Remove a double float from the start. More... | |
int | mlt_deque_pop_front_int (mlt_deque self) |
Remove an integer from the start. More... | |
int | mlt_deque_push_back (mlt_deque self, void *item) |
Push an item to the end. More... | |
int | mlt_deque_push_back_double (mlt_deque self, double item) |
Push a double float to the end. More... | |
int | mlt_deque_push_back_int (mlt_deque self, int item) |
Push an integer to the end. More... | |
int | mlt_deque_push_front (mlt_deque self, void *item) |
Queue an item at the start. More... | |
int | mlt_deque_push_front_double (mlt_deque self, double item) |
Queue a double float at the start. More... | |
int | mlt_deque_push_front_int (mlt_deque self, int item) |
Queue an integer at the start. More... | |
Data Fields | |
atomic_int | count |
deque_entry * | list |
int | size |
Private Member Functions | |
static int | mlt_deque_allocate (mlt_deque self) |
Allocate space on the deque. More... | |
Double-Ended Queue (deque) class.
The double-ended queue is a very versatile data structure. MLT uses it as list, stack, and circular queue.
typedef int(* mlt_deque_compare) (void *a, void *b) |
The callback function used to compare items for insert sort.
a | the first object |
b | the second object |
|
private |
Allocate space on the deque.
self | a deque |
void mlt_deque_close | ( | mlt_deque | self | ) |
Destroy the queue.
self | a deque |
int mlt_deque_count | ( | mlt_deque | self | ) |
Return the number of items in the deque.
self | a deque |
mlt_deque mlt_deque_init | ( | ) |
Create a deque.
int mlt_deque_insert | ( | mlt_deque | self, |
void * | item, | ||
mlt_deque_compare | cmp | ||
) |
Insert an item in a sorted fashion.
Optimized for the equivalent of mlt_deque_push_back
.
self | a deque |
item | an opaque pointer |
cmp | a function pointer to the comparison function |
void * mlt_deque_peek | ( | mlt_deque | self, |
int | index | ||
) |
Inquire on item in deque but don't remove.
self | a deque |
index | the position in the deque |
void * mlt_deque_peek_back | ( | mlt_deque | self | ) |
Inquire on item at back of deque but don't remove.
self | a deque |
double mlt_deque_peek_back_double | ( | mlt_deque | self | ) |
Inquire on a double float at back of deque but don't remove.
self | a deque |
int mlt_deque_peek_back_int | ( | mlt_deque | self | ) |
Inquire on an integer at back of deque but don't remove.
self | a deque |
void * mlt_deque_peek_front | ( | mlt_deque | self | ) |
Inquire on item at front of deque but don't remove.
self | a deque |
double mlt_deque_peek_front_double | ( | mlt_deque | self | ) |
Inquire on a double float at front of deque but don't remove.
self | a deque |
int mlt_deque_peek_front_int | ( | mlt_deque | self | ) |
Inquire on an integer at front of deque but don't remove.
self | a deque |
void * mlt_deque_pop_back | ( | mlt_deque | self | ) |
Pop an item.
self | a pointer |
double mlt_deque_pop_back_double | ( | mlt_deque | self | ) |
Pop a double float.
self | a deque |
int mlt_deque_pop_back_int | ( | mlt_deque | self | ) |
Pop an integer.
self | a deque |
void * mlt_deque_pop_front | ( | mlt_deque | self | ) |
Remove an item from the start.
self | a pointer |
double mlt_deque_pop_front_double | ( | mlt_deque | self | ) |
Remove a double float from the start.
self | a deque |
int mlt_deque_pop_front_int | ( | mlt_deque | self | ) |
Remove an integer from the start.
self | a deque |
int mlt_deque_push_back | ( | mlt_deque | self, |
void * | item | ||
) |
Push an item to the end.
self | a deque |
item | an opaque pointer |
int mlt_deque_push_back_double | ( | mlt_deque | self, |
double | item | ||
) |
Push a double float to the end.
self | a deque |
item | a double float |
int mlt_deque_push_back_int | ( | mlt_deque | self, |
int | item | ||
) |
Push an integer to the end.
self | a deque |
item | an integer |
int mlt_deque_push_front | ( | mlt_deque | self, |
void * | item | ||
) |
Queue an item at the start.
self | a deque |
item | an opaque pointer |
int mlt_deque_push_front_double | ( | mlt_deque | self, |
double | item | ||
) |
Queue a double float at the start.
self | a deque |
item | a double float |
int mlt_deque_push_front_int | ( | mlt_deque | self, |
int | item | ||
) |
Queue an integer at the start.
self | a deque |
item | an integer |
atomic_int mlt_deque_s::count |
deque_entry* mlt_deque_s::list |
int mlt_deque_s::size |