#include <file.h>
Public Methods | |
bool | operator! () |
Used to see if the pipe has any open entities. More... | |
int | Recv (void *addr) |
Perform an object atomic transfer of data from a pipe. More... | |
int | Send (void *addr) |
Perform an object atomic transfer of data to a pipe. More... | |
bool | isValid (void) |
Verify this object is "valid". More... | |
Protected Methods | |
int | getSize (void) |
Get the object size for atomic operations. More... | |
void | endSender (void) |
Sender is often used for implementing a fork()'d message port between processes. More... | |
void | endReceiver (void) |
Receiver is often used for implementing a fork()'d message port between processes. More... | |
Pipe (int size=512, int count=1) | |
Create a kernel pipe descriptor set using pipe(). More... | |
virtual | ~Pipe () |
Destroy the pipe and kernel descriptor resources. More... | |
Pipe (const Pipe &orig) | |
Create a pipe as a duplicate of an existing pipe. More... | |
Pipe & | operator= (const Pipe &orig) |
void | Sender (void) |
void | Receiver (void) |
int | Read (void *buf, int len) |
int | Write (void *buf, int len) |
Unlike thread's "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. The Common C++ "pipe" class primarily deals with "atomic" transfers of fixed sized objects through pipes. Pipes may pass data arbitrarily and can also be used through the "pipestream" class.
The "Pipe" class is not meant to be a true "public" class, but as a builder class for deriving other classes.
|
Create a kernel pipe descriptor set using pipe(). On systems which allow the pipe kernel buffer to be defined, a size for aligned atomic transfers can be set, as well as the number of atomic objects the kernel will buffer. On Posix systems, these options are ignored.
|
|
Destroy the pipe and kernel descriptor resources.
|
|
Create a pipe as a duplicate of an existing pipe.
|
|
|
|
|
|
Perform an object atomic transfer of data from a pipe.
|
|
Perform an object atomic transfer of data to a pipe.
|
|
|
|
|
|
Receiver is often used for implementing a fork()'d message port between processes. By stopping the receiver, the current pipe can then only be used for sending, and the receiver is presumed to be in the other half of a fork()'d process.
|
|
Sender is often used for implementing a fork()'d message port between processes. By stopping the sender, the current pipe can then only be used for receiving, and the sender is presumed to be in the other half of a fork()'d process.
|
|
Get the object size for atomic operations.
|
|
Verify this object is "valid".
|
|
Used to see if the pipe has any open entities.
|
|
|