Queue
A FIFO queue.
Namespace: | Queue |
---|---|
Source File: | /scripts/base/utils/queue.bro |
Queue::Queue : record |
The internal data structure for the queue. |
Queue::Settings : record |
Settings for initializing the queue. |
Queue::Queue : record |
Queue::get : function |
Get a value from the end of a queue. |
Queue::get_vector : function |
Get the contents of the queue as a vector. |
Queue::init : function |
Initialize a queue record structure. |
Queue::len : function |
Get the number of items in a queue. |
Queue::merge : function |
Merge two queues together. |
Queue::peek : function |
Peek at the value at the end of the queue without removing it. |
Queue::put : function |
Put a value onto the beginning of a queue. |
Queue::get
Type: | function (q: Queue::Queue ) : any |
---|
Get a value from the end of a queue.
Q: | The queue to get the value from. |
---|---|
Returns: | The value gotten from the queue. |
Queue::get_vector
Type: | function (q: Queue::Queue , ret: vector of any ) : void |
---|
Get the contents of the queue as a vector.
Q: | The queue. |
---|---|
Ret: | A vector containing the current contents of the queue as the type of ret. |
Queue::init
Type: | function (s: Queue::Settings &default = [] &optional ) : Queue::Queue |
---|
Initialize a queue record structure.
S: | A record which configures the queue. |
---|---|
Returns: | An opaque queue record. |
Queue::len
Type: | function (q: Queue::Queue ) : count |
---|
Get the number of items in a queue.
Q: | The queue. |
---|---|
Returns: | The length of the queue. |
Queue::merge
Type: | function (q1: Queue::Queue , q2: Queue::Queue ) : Queue::Queue |
---|
Merge two queues together. If any settings are applied to the queues, the settings from q1 are used for the new merged queue.
Q1: | The first queue. Settings are taken from here. |
---|---|
Q2: | The second queue. |
Returns: | A new queue from merging the other two together. |
Queue::peek
Type: | function (q: Queue::Queue ) : any |
---|
Peek at the value at the end of the queue without removing it.
Q: | The queue to get the value from. |
---|---|
Returns: | The value at the end of the queue. |
Queue::put
Type: | function (q: Queue::Queue , val: any ) : void |
---|
Put a value onto the beginning of a queue.
Q: | The queue to put the value into. |
---|---|
Val: | The value to insert into the queue. |