|
My Project
|
#include <Pipe.h>
Classes | |
| struct | PipeFd |
Public Member Functions | |
| Pipe () | |
| virtual | ~Pipe () |
| virtual void | readPipe (void *buffer, size_t nbyte, long timeout) |
| virtual void | writePipe (void *buffer, size_t nbyte, long timeout) |
| virtual PipeState | read (void *buffer, size_t nbyte, long timeout=PIPE_NOWAIT) |
| virtual PipeState | write (void *buffer, size_t nbyte, long timeout=PIPE_NOWAIT) |
| int | fd () |
| fd_set | rfds () |
| int | readFd () |
| int | writeFd () |
Protected Member Functions | |
| void | getTimeOfDay (struct timespec *ts) |
Protected Attributes | |
| pthread_mutex_t | guard_ |
| bool | guardIsReady_ |
| PipeFd | readfd_ |
| PipeFd | writefd_ |
| char | unread_ [PIPE_BUF] |
| size_t | nread_ |
A class to encapsulate a pipe
| Pipe::Pipe | ( | ) |
|
virtual |
| int Pipe::fd | ( | ) |
Return the file descriptor associated with this pipe.
....................................................................... Return the readable fd associated with this pipe. For use in select()
|
protected |
Get the current time of day. Used by read/writePipe() for timeouts.
| Exception | ....................................................................... Get the current time of day. Used by read/writePipe() for timeouts |
|
virtual |
Read from the pipe.
| Exception | ....................................................................... Read from the Pipe |
Reimplemented in gcp::util::PipeQueue.
|
virtual |
| fd_set Pipe::rfds | ( | ) |
Return an intialized set of readable file descriptors associated with this queue.
....................................................................... Return an intialized set of readable file descriptors associated with this pipe.
The history of this is that macros like FD_ZERO and FD_SET cannot be used in template class definitions (for instance GenericTask.h, where this method is used), because gcc 2.95 has a bug that will cause it to choke on the 'volatile' keyword in bits/select.h where these macros are defined. Not clear that this bug has been resolved, but there's one note I found indicating that it was fixed in gcc 3.3.
|
virtual |
Write to the pipe.
| Exception | ....................................................................... Write to a Pipe |
Reimplemented in gcp::util::PipeQueue.
|
virtual |
|
protected |
A mutex guard for the pipe.
|
protected |
True when the guard mutex has been initialized.
|
protected |
The number of bytes in buffer[]
|
protected |
File descriptor corresponding to the read end of the pipe.
|
protected |
File descriptor corresponding to the write end of the pipe.