cheshirekow  v0.1.0
nix::NotifyPipe Class Reference

Manages a pipe which can be used as a condition variable between two threads. This is in contrast to a pthreads condition variable which can't be selected-ed or epoll-ed. More...

#include <cpp_nix/notify_pipe.h>

Public Member Functions

int Clear ()
 Read from the pipe until it's empty. More...
 
int GetReadFd ()
 Return the file descriptor for the read end of the pipe. More...
 
int GetWriteFd ()
 Return the file descriptor for the write end of the pipe. More...
 
int Notify ()
 Write a single byte to the pipe to signal all listeners. More...
 
 NotifyPipe ()
 opens pipe More...
 
 ~NotifyPipe ()
 closes pipe More...
 

Private Attributes

int m_fd [2]
 

Detailed Description

Manages a pipe which can be used as a condition variable between two threads. This is in contrast to a pthreads condition variable which can't be selected-ed or epoll-ed.

Definition at line 35 of file notify_pipe.h.

Constructor & Destructor Documentation

nix::NotifyPipe::NotifyPipe ( )

opens pipe

nix::NotifyPipe::~NotifyPipe ( )

closes pipe

Member Function Documentation

int nix::NotifyPipe::Clear ( )

Read from the pipe until it's empty.

int nix::NotifyPipe::GetReadFd ( )

Return the file descriptor for the read end of the pipe.

int nix::NotifyPipe::GetWriteFd ( )

Return the file descriptor for the write end of the pipe.

int nix::NotifyPipe::Notify ( )

Write a single byte to the pipe to signal all listeners.

Member Data Documentation

int nix::NotifyPipe::m_fd[2]
private

Definition at line 37 of file notify_pipe.h.


The documentation for this class was generated from the following file: