Pipe Class Reference

[APE Index] [APE Hierarchy] [Headers]


kernel buffering between processes and/or threads. More...

#include <thread.h>

Public Members

Protected Members


Detailed Description

The Pipe uses system kernel buffering to hold data being passed either between two execution contexts within the same process, or between different processes. Unlike Buffer, Pipe uses system descriptors and kernel memory. Under Posix, the size of the pipe and associated kernel memory is always a fixed constant as defined by _PC_PIPE_BUF. Since the pipe does not deal with fixed objects, any data can be read from or written to the kernel pipe buffer.


Pipe() [public]

Create a kernel pipe descriptor set using pipe().

~Pipe() [public]

Destroy the pipe and kernel descriptor resources.

Pipe(const Pipe &orig) [public]

Create a pipe as a duplicate of an existing pipe.

Parameters:
orig pipe to duplicate.

inline int Read(void *addr, size_t len) [public]

Read an arbitrary number of bytes from the pipe buffer.

Parameters:
addr pointer to store read data.
len number of bytes to read.
Returns:
number of bytes actually read if successful.

inline int Write(void *addr, size_t len) [public]

Write an arbitrary number of butes to the pipe buffer.

Parameters:
addr pointer to write data from.
len number of butes to write.
Returns:
number of bytes read if successful.

inline void Sender(void) [protected]

Sender is often used for implementing a fork()'d message port between processes. By defining the current pipe as only used for sending, the receiver is presumed to be in the other half of a fork()'d process.

See Also:
Receiver

inline void Receiver(void) [protected]

Receiver is often used for implementing a fork()'d message port between processes. By defining the current pipe as only used for receiving, the sender is presumed to be in the other half of a fork()'d process.

See Also:
Sender

  • Author: David Sugar <dyfet@ostel.com>.
  • Documentation generated by dyfet@home.sys on Thu Dec 16 09:54:26 EST 1999
Kdoc