Deque
Parameters
[DType]
This is double ended queue with methods to add and pop items from either end. It is implemented using a variable sized ring buffer of fixed sized blocks each capable of holding 16 items.
graph BT
N1["Deque[DType]"] -->|inherits| N2["RandomIterable[DType]"];
Characteristics
Quality | Value |
---|---|
Inherits | RandomIterable[DType] |
Extends | N/A |
Decorators | #sealed; |
Is enum | false |
Is sealed | true |
Is extern | false |
Const Expressions
kInitialListSize
const! kInitialListSize = 2
kMultiplyFactor
const! kMultiplyFactor = 2
Subscript
[s Self, index Len] -> @DType
Methods
construct
#default
#Gambol.function.alwaysinline
construct (s Self) -> Self
copy
copy (s Self) -> strictly SelfType
slice
slice (s Self, range IndexRange) -> SelfType
range
fill_with
fill_with (s Self, value @DType, range IndexRange) -> Nil
range
to the given value
add
add (s Self, val @DType) -> Nil
pop
pop (s Self) -> @DType?
extend
extend (s Self, other nom Iterable[DType]) -> Nil
other
to the tail of this deque
clear
clear (s Self) -> Nil
add_tail
add_tail (s Self, val @DType) -> Nil
add_head
add_head (s Self, val @DType) -> Nil
peek_head
peek_head (s Self) -> @DType?
pop_head
pop_head (s Self) -> DType?
pop_tail
pop_tail (s Self) -> DType?
rotate
rotate (s Self, n Len) -> Nil
n
items from the head to the tail if n is positive and from the tail to the head if n is negative
len
#strict
len (s Self) -> Len
get_element_ptr_unchecked
get_element_ptr_unchecked (s Self, index Len) -> PointerToVariable[DType]
index
without checking if index is in range
get_element_ptr
get_element_ptr (s Self, index Len) -> PointerToVariable[DType]
index
get_unchecked
get_unchecked (s Self, index Len) -> @DType
index
without checking if index is in range
set_unchecked
set_unchecked (s Self, val @DType, index Len) -> Nil
index
without checking if index is in range
swap_unchecked
swap_unchecked (s Self, a_index Len, b_index Len) -> Nil
str
str (s Self, delimiter: String = `, `, quote_begin: String = ```, quote_end: String = ```, enclose_begin: String = `[`, enclose_end: String = `]`) -> String
get_iterator
get_iterator (s Self) -> ListBidirectionalIterator[Self]
get_reverse_iterator
get_reverse_iterator (s Self) -> ListBidirectionalIterator[Self, -1]
get_random_iterator
get_random_iterator (s Self) -> ListRandomIterator[Self]
__get_block_item_indicies
__get_block_item_indicies (s Self, index Len) -> Len, Len
__range_check
__range_check (s Self, index Len) -> Nil
__get_tail_block
__get_tail_block (s Self) -> @DequeBlock__[DType]
__get_head_block
__get_head_block (s Self) -> @DequeBlock__[DType]
__allocate
__allocate (s Self, is_tail Bool) -> Nil
__deallocate
__deallocate (s Self, is_tail Bool) -> Nil
Binary Operators
is in
is in (s Self, value @DType) -> Bool
==
== (s Self, o Self) -> Bool
Properties
__head
__head Len
__tail
__tail Len
__num_blocks
__num_blocks Len
__len
__len Len
__blocks
__blocks List[DequeBlock__[DType]?]