#include <qchannel.h>
Inheritance diagram for PQueueChannel:
Public Member Functions | |
Construction | |
PQueueChannel (PINDEX queueSize=0) | |
~PQueueChannel () | |
Overrides from class PChannel | |
virtual BOOL | Read (void *buf, PINDEX len) |
virtual BOOL | Write (const void *buf, PINDEX len) |
virtual BOOL | Close () |
Queue manipulation functions | |
virtual BOOL | Open (PINDEX queueSize) |
PINDEX | GetSize () const |
Get the queue size. | |
PINDEX | GetLength () const |
Get the current queue length. | |
Protected Attributes | |
PMutex | mutex |
BYTE * | queueBuffer |
PINDEX | queueSize |
PINDEX | queueLength |
PINDEX | enqueuePos |
PINDEX | dequeuePos |
PSyncPoint | unempty |
PSyncPoint | unfull |
The queue will block the read for the Read Timeout if the queue is empty. Similarly a write will be clocked for Write Timeout if the queue is full.
If there is any data to be read then it returns immediately with those bytes, so you must check the GetLastReadCount() to determine the actual number of bytes read and not rely on the count being passed into the read function.
|
Create a new queue channel with the specified maximum size.
|
|
Delete queue and release memory used. |
|
Close the file channel.
Reimplemented from PChannel. |
|
Get the current queue length.
|
|
Get the queue size.
|
|
Open a queue, allocating the queueSize bytes.
|
|
Low level read from the file channel. The read timeout is ignored for file I/O. The GetLastReadCount() function returns the actual number of bytes read. The GetErrorCode() function should be consulted after Read() returns FALSE to determine what caused the failure.
Reimplemented from PChannel. |
|
Low level write to the file channel. The write timeout is ignored for file I/O. The GetLastWriteCount() function returns the actual number of bytes written. The GetErrorCode() function should be consulted after Write() returns FALSE to determine what caused the failure.
Reimplemented from PChannel. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|