file
request_queue.h
Classes
- struct Queue_Node_s
- Queue_
Node_ s - A queue node.
Enums
- enum RequestQueueErrorCode { OPERATION_SUCCESS = 0, OPERATION_ERROR_FULL = 1, OPERATION_ERROR_INVALID_PARAMETER = 2, OPERATION_ERROR_FAULT = 3 }
Typedefs
-
using request_queue = struct request_
queue
Functions
-
auto request_queue_new(TALLOC_CTX* ctx,
unsigned int capacity) -> request_
queue* - request_queue_new Creates new request_
queue. -
auto request_queue_push(request_
queue* queue, struct Queue_ Node_ s* node) -> enum RequestQueueErrorCode -
auto request_queue_pop(request_
queue* queue) -> struct Queue_ Node_ s* - request_queue_pop Get node from the top of queue and remove it.
-
auto request_queue_peek(request_
queue* queue) -> struct Queue_ Node_ s* - request_queue_peek Get pointer to the head of queue.
-
auto request_queue_empty(request_
queue* queue) -> bool - request_queue_empty Returns true if queue is empty.
-
auto request_queue_move(request_
queue* from, request_ queue* to) -> enum RequestQueueErrorCode
Enum documentation
enum RequestQueueErrorCode
Enumerators | |
---|---|
OPERATION_SUCCESS |
Queue operation was successful. |
OPERATION_ERROR_FULL |
Underlying storage is full and we were unable to add node to queue. |
OPERATION_ERROR_INVALID_PARAMETER |
Invalid parameter were passed to a function. |
OPERATION_ERROR_FAULT |
Queue internal logic error. |
Function documentation
request_ queue* request_queue_new(TALLOC_CTX* ctx,
unsigned int capacity)
request_queue_new Creates new request_
Parameters | |
---|---|
ctx in | Memory context to operate upon. |
capacity in | Maximum size of the queue. |
Returns |
|
struct Queue_ Node_ s* request_queue_pop(request_ queue* queue)
request_queue_pop Get node from the top of queue and remove it.
Parameters | |
---|---|
queue in | Current queue to receive element from. |
Returns |
|
struct Queue_ Node_ s* request_queue_peek(request_ queue* queue)
request_queue_peek Get pointer to the head of queue.
Parameters | |
---|---|
queue in | Current queue to receive element from. |
Returns |
|
bool request_queue_empty(request_ queue* queue)
request_queue_empty Returns true if queue is empty.
Parameters | |
---|---|
queue in | Current queue to operate upon. |
Returns |
|