VideoTools
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
G::FatPipeReceiver Class Reference

A class to read a fat pipe in the child process. More...

#include <gfatpipe.h>

Public Member Functions

 FatPipeReceiver (int shmem_fd, int pipe_fd)
 Constructor.
 
bool receive (std::vector< char > &buffer, std::string *type_p=nullptr, G::EpochTime *=nullptr)
 Reads a message from the fat pipe's shared memory into the supplied buffer. More...
 
int pipefd () const
 Returns the pipe fd.
 

Static Public Member Functions

static void wait (int pipe_fd)
 A convenience function that sets the pipe fd to be non-blocking and does a non-multiplexed wait for a read event. More...
 

Detailed Description

A class to read a fat pipe in the child process.

Definition at line 174 of file gfatpipe.h.

Member Function Documentation

bool G::FatPipeReceiver::receive ( std::vector< char > &  buffer,
std::string *  type_p = nullptr,
G::EpochTime time_p = nullptr 
)

Reads a message from the fat pipe's shared memory into the supplied buffer.

This is used in the child process, with the file descriptors inherited from the parent. The pipe fd must be non-blocking and it must have a pending read event (see wait()).

If the read event should be ignored then an empty buffer is returned. Throws on error, but returns false if the pipe breaks.

Definition at line 315 of file gfatpipe.cpp.

void G::FatPipeReceiver::wait ( int  pipe_fd)
static

A convenience function that sets the pipe fd to be non-blocking and does a non-multiplexed wait for a read event.

Definition at line 377 of file gfatpipe.cpp.


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