OpenSync Queue
[OpenSync IPC Module]

A Queue used for asynchronous communication between thread. More...


Enumerations

enum  OSyncQueueEvent { OSYNC_QUEUE_EVENT_NONE, OSYNC_QUEUE_EVENT_READ, OSYNC_QUEUE_EVENT_ERROR, OSYNC_QUEUE_EVENT_HUP }
 The type of a queue event.
enum  OSyncQueueType { OSYNC_QUEUE_SENDER, OSYNC_QUEUE_RECEIVER }
 The queue type. More...

Functions

OSYNC_EXPORT OSyncQueueosync_queue_new (const char *name, OSyncError **error)
 Creates a new asynchronous queue.
OSYNC_EXPORT OSyncQueueosync_queue_new_from_fd (int fd, OSyncError **error)
 Creates a new asynchronous queue.
OSYNC_EXPORT osync_bool osync_queue_create (OSyncQueue *queue, OSyncError **error)
 Initializes and creates a new FIFO Queue.
OSYNC_EXPORT OSyncQueueosync_queue_ref (OSyncQueue *queue)
 Increase the reference count on an OSyncQueue.
OSYNC_EXPORT void osync_queue_unref (OSyncQueue *queue)
 Decrements the reference count on an OSyncQueue.
OSYNC_EXPORT osync_bool osync_queue_connect (OSyncQueue *queue, OSyncQueueType type, OSyncError **error)
 Connects a Queue.
OSYNC_EXPORT osync_bool osync_queue_disconnect (OSyncQueue *queue, OSyncError **error)
 Disconnects a Queue.


Detailed Description

A Queue used for asynchronous communication between thread.

Enumeration Type Documentation

The queue type.

Enumerator:
OSYNC_QUEUE_SENDER  Queue Sender
OSYNC_QUEUE_RECEIVER  Queue Receiver

Definition at line 49 of file opensync_queue.h.


Function Documentation

OSYNC_EXPORT OSyncQueue* osync_queue_new ( const char *  name,
OSyncError **  error 
)

Creates a new asynchronous queue.

Parameters:
name Name of the queue
error An OpenSync Error
This function return the pointer to a newly created OSyncQueue

Definition at line 770 of file opensync_queue.c.

Referenced by osync_queue_new_from_fd().

OSYNC_EXPORT OSyncQueue* osync_queue_new_from_fd ( int  fd,
OSyncError **  error 
)

Creates a new asynchronous queue.

Parameters:
fd A file descriptor
error An OpenSync Error
This function return the pointer to a newly created OSyncQueue

Definition at line 805 of file opensync_queue.c.

Referenced by osync_queue_new_pipes().

OSYNC_EXPORT osync_bool osync_queue_create ( OSyncQueue queue,
OSyncError **  error 
)

Initializes and creates a new FIFO Queue.

Parameters:
queue OpenSync Queue that should be used to create a Queue
error An OpenSync Error
Returns:
TRUE if the queue could be created

Definition at line 926 of file opensync_queue.c.

OSYNC_EXPORT OSyncQueue* osync_queue_ref ( OSyncQueue queue  ) 

Increase the reference count on an OSyncQueue.

Use when storing a reference to the group environment. When the reference is no longer needed use osync_queue_unref

Parameters:
queue Pointer to the queue to reference
Returns:
the passed queue

Definition at line 859 of file opensync_queue.c.

Referenced by osync_queue_cross_link().

OSYNC_EXPORT void osync_queue_unref ( OSyncQueue queue  ) 

Decrements the reference count on an OSyncQueue.

If the reference count reaches zero then the queue is freed and all resources are freed or unrefed

Parameters:
queue Pointer to the queue to unreference

Todo:
Refcounting for OSyncPendingMessage

Definition at line 870 of file opensync_queue.c.

Referenced by osync_queue_new_pipes(), and osync_queue_remove_cross_link().

OSYNC_EXPORT osync_bool osync_queue_connect ( OSyncQueue queue,
OSyncQueueType  type,
OSyncError **  error 
)

Connects a Queue.

Parameters:
queue Queue that should be connected
type Type of the Queue (Sender or Receiver)
error An OpenSync Error
Returns:
TRUE if successful

Definition at line 964 of file opensync_queue.c.

OSYNC_EXPORT osync_bool osync_queue_disconnect ( OSyncQueue queue,
OSyncError **  error 
)

Disconnects a Queue.

Parameters:
queue Queue that should be disconnected
error An OpenSync Error
Returns:
TRUE if successful

Definition at line 1066 of file opensync_queue.c.

Referenced by osync_queue_is_alive().


Generated on Fri Feb 13 13:33:29 2009 for OpenSync by  doxygen 1.5.7.1