Neonode zForce(TM) SDK

Public Attributes | List of all members
Queue Struct Reference

The Queue struct. More...

`#include <Queue.h>`

Collaboration diagram for Queue:
[legend]

## Public Attributes
zForce * | zForce
| Pointer to zForce.
void * | QueuePrivate
| Private Queue data.
void(* | Destructor )(Queue *self)
| Destroys the Queue, freeing any resources but NOT contents. More...
bool(* | Enqueue )(Queue *self, void *payload)
| Add an entry to the queue. More...
void *(* | Dequeue )(Queue *self, uint32_t timeoutMilliSeconds)
| Get the first entry from the queue. More...

## Detailed Description

The Queue struct.

## Member Data Documentation

## ◆ Dequeue

void*( * Queue::Dequeue) (Queue *self, uint32_t timeoutMilliSeconds)

Get the first entry from the queue.

Gets the first payload pointer in the queue, optionally with a timeout for how long to wait for something to be put in the queue.
Timeout is specificed in milliseconds.
Using a timeout value of 0 means don't wait at all, return either a payload pointer or an error code.
On failure, errno is set.

- EDEQUEUEFAILED - Generic dequeue error.
- EBADQUEUE - Bad Queue Pointer.
- EBADSEMAPHORE - Bad Semaphore pointer.
- EBADMUTEX - Bad Mutex pointer.

Parameters

  self | Pointer to the struct itself.
  timeoutMilliSeconds | Timeout in milliseconds.

Returns
  Pointer to payload. On error, pointer is NULL. See errno.

## ◆ Destructor

void( * Queue::Destructor) (Queue *self)

Destroys the Queue, freeing any resources but NOT contents.

On failure, errno is set.

- EMUTEXNOTINITIALIZED - Mutex not initialized.
- EMUTEXLOCKFAILED - Mutex Lock failed.
- ESEMAPHORENOTINITIALIZED - Semaphore not initialized.
- ESEMAPHOREDESTROYFAILED - Destroy Semaphore failed.
- EBADQUEUE - Bad Queue pointer.

Parameters

  self | Pointer to the Queue itself.

Returns
  No return value.

## ◆ Enqueue

bool( * Queue::Enqueue) (Queue *self, void *payload)

Add an entry to the queue.

The data is not copied, the pointer is passed in the queue entry.
On failure, errno is set.

- EENQUEUEFAILED - Generic enqueue error.
- EOUTOFMEMORY - Memory allocation failed.
- EBADQUEUE - Bad Queue Pointer.
- EBADSEMAPHORE - Bad Semaphore pointer.
- EBADMUTEX - Bad Mutex pointer.

Parameters

  self | Pointer to the struct itself.
  payload | The payload pointer to add.

Returns
  True if success, False if failed. See errno.

The documentation for this struct was generated from the following file:

- Queue.h