libHartwer - Documentation
Enumerations | Functions

bcs_queue.h File Reference

Simple fifo command queue. More...

Go to the source code of this file.

Enumerations

enum  BCS_Q_Flag { BCS_Q_NONE, BCS_Q_NOWAIT, BCS_Q_NONE, BCS_Q_NOWAIT }
 

Flags for controlling methods behaviour.

More...

Functions

BCS_ERROR BCS_FF_addItem (BCS_FF_queue *q, void *data)
 Adds the given data to the queue.
void BCS_FF_deleteQueue (BCS_FF_queue *q)
 Call this function to delete a queue.
BCS_ERROR BCS_FF_getItem (BCS_FF_queue *q, void **data, BCS_Q_Flag f)
 Gets the next item from the given queue.
void BCS_FF_getQueue (BCS_FF_queue *q)
 Call this function before adding an item to the queue for the first time.

Detailed Description

Date:
28.02.2010
Author:
Marius Generic fifo queue for use between threads within the same process. Is a lot more flexible and speedy than bcs_ipc_queue. As messages are kept within the same virtual adress space there's theoretical no limit for the number of messages on the queue except the memory space of course.

Enumeration Type Documentation

enum BCS_Q_Flag
Enumerator:
BCS_Q_NONE 

blocking call, method will return only if message could be sent or received

BCS_Q_NOWAIT 

non blocking, method will always return and return BCS_ERR_EMPTY or BCS_ERR_NOTSENT if operation failed

BCS_Q_NONE 

blocking call, method will return only if message could be sent or received

BCS_Q_NOWAIT 

non blocking, method will always return and return BCS_ERR_EMPTY or BCS_ERR_NOTSENT if operation failed


Function Documentation

BCS_ERROR BCS_FF_addItem ( BCS_FF_queue q,
void *  data 
)
Parameters:
qpointer to a queue you want to add an item to
datayour data
Returns:
Error codes
void BCS_FF_deleteQueue ( BCS_FF_queue q)

All waiting messages will be removed and your queue reset as if it just had been declared.

Parameters:
qpointer to a used queue
BCS_ERROR BCS_FF_getItem ( BCS_FF_queue q,
void **  data,
BCS_Q_Flag  f 
)
Parameters:
qpointer to a queue you want to get an item from
dataPointer that will point to your data when an item was received sucessfully
fuse this to select if the function should work blocking or non-blocking
Returns:
Error codes
void BCS_FF_getQueue ( BCS_FF_queue q)

A new queue will be set up to be filled with items.

Only use this function on queues that have not been used yet or were deleted in the past!

Parameters:
qpointer to an unused or deleted queue

Generated on Fri Feb 11 2011 18:25:46 for libHartwer by Doxygen 1.7.3
Content © 2009-2011 Elefant Racing Bayreuth & MLBA (About) – Design © 2010 Emzeat. All Rights reserved.