MKObjectPipe class documentation

Authors

Generated by builder

Software documentation for the MKObjectPipe class

MKObjectPipe : NSObject

Declared in:
MKObjectPipe.h

The MKObjectPipe class encapsulates a connection between two filters.

Conceptually, the pipe provides an asynchronous request-response mechanism between two threads. The pipe is partially thread-safe. Each end must only be held by one thread, unless protected externally by a lock. One end sends requests and receives replies, the other receives requests and sends replies.

Every request must have corresponding reply sent, although this may be nil. The intended use for this is to allow a small set of buffers to be recycled between a cooperating pair of filters.


Instance Variables

Method summary

nextReply 

- (id) nextReply;

Retrieve the next reply from the buffer.


nextRequest 

- (id) nextRequest;

Retrieve the next request from the ring buffer.


sendReply: 

- (void) sendReply: (id)anObject;

Insert a reply into the ring buffer.


sendRequest: 

- (void) sendRequest: (id)anObject;

Insert anObject into the ring buffer as a request.




Instance Variables for MKObjectPipe Class

conditionVariable

@protected pthread_cond_t conditionVariable;

Condition variable used to signal a transition from locked to lockless mode.


disconnect

@protected volatile BOOL disconnect;

Flag used to interrupt the object in locked mode


mutex

@protected pthread_mutex_t mutex;

Mutex used to protect the condition variable.


queue

@protected id* queue;

The ring buffer.


replyConsumer

@protected uint32_t replyConsumer;
Description forthcoming.

replyProducer

@protected uint32_t replyProducer;

Consumer free-running counter.


requestConsumer

@protected uint32_t requestConsumer;
Description forthcoming.

requestProducer

@protected uint32_t requestProducer;

Producer free-running counter.