aboutsummaryrefslogtreecommitdiff
path: root/core/container/queue.odin
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2020-04-19 23:43:02 +0100
committergingerBill <bill@gingerbill.org>2020-04-19 23:43:02 +0100
commit52bbdefec47d31096ed72dc86ebd304e8700607f (patch)
tree3537888d15874a442f81b94a836e0eb37a9997ac /core/container/queue.odin
parent8ee67e41f44f01d2124fbd78639ec48cf7703683 (diff)
`container.Map`
Diffstat (limited to 'core/container/queue.odin')
-rw-r--r--core/container/queue.odin26
1 files changed, 25 insertions, 1 deletions
diff --git a/core/container/queue.odin b/core/container/queue.odin
index ce6e75559..6e7e79ad3 100644
--- a/core/container/queue.odin
+++ b/core/container/queue.odin
@@ -6,6 +6,31 @@ Queue :: struct(T: typeid) {
offset: int,
}
+/*
+queue_init :: proc{
+ queue_init_none,
+ queue_init_len,
+ queue_init_len_cap,
+}
+queue_delete
+queue_clear
+queue_len
+queue_cap
+queue_space
+queue_get
+queue_set
+queue_reserve
+queue_resize
+queue_push :: proc{
+ queue_push_back,
+ queue_push_elems,
+};
+queue_push_front
+queue_pop_front
+queue_pop_back
+queue_consume
+*/
+
queue_init_none :: proc(q: ^$Q/Queue($T), allocator := context.allocator) {
queue_init_len(q, 0, allocator);
}
@@ -40,7 +65,6 @@ queue_space :: proc(q: $Q/Queue($T)) -> int {
return array_len(q.data) - q.len;
}
-
queue_get :: proc(q: $Q/Queue($T), index: int) -> T {
i := (index + q.offset) % array_len(q.data);
data := array_slice(q.data);