Main MRPT website > C++ reference for MRPT 1.9.9
List of all members | Public Member Functions | Static Public Member Functions
mrpt::io::CPipe Class Reference

Detailed Description

A pipe, portable across different OS.

Pipes can be used as intraprocess (inter-threads) or interprocess communication mechanism. Read more on pipes here: http://www.gnu.org/software/libc/manual/html_node/Pipes-and-FIFOs.html

std::unique_ptr<CPipeReadEndPoint> read_pipe;
std::unique_ptr<CPipeWriteEndPoint> write_pipe;
CPipe::createPipe(read_pipe,write_pipe);

See also the example: MRPT/samples/threadsPipe/

Definition at line 40 of file CPipe.h.

#include <mrpt/io/CPipe.h>

Public Member Functions

 CPipe ()=delete
 Create via createPipe() instead. More...
 
 ~CPipe ()=delete
 

Static Public Member Functions

template<typename ReadPtr , typename WritePtr >
static void createPipe (ReadPtr &outReadPipe, WritePtr &outWritePipe)
 Creates a new pipe and returns the read & write end-points as newly allocated objects. More...
 
static void initializePipe (CPipeReadEndPoint &outReadPipe, CPipeWriteEndPoint &outWritePipe)
 Creates a new pipe and returns the read & write end-points as newly allocated objects. More...
 

Constructor & Destructor Documentation

◆ CPipe()

mrpt::io::CPipe::CPipe ( )
delete

Create via createPipe() instead.

◆ ~CPipe()

mrpt::io::CPipe::~CPipe ( )
delete

Member Function Documentation

◆ createPipe()

template<typename ReadPtr , typename WritePtr >
void mrpt::io::CPipe::createPipe ( ReadPtr &  outReadPipe,
WritePtr &  outWritePipe 
)
static

Creates a new pipe and returns the read & write end-points as newly allocated objects.

Exceptions
std::exceptionOn any error during the pipe creation Creates a new pipe and returns the read & write end-points as newly allocated objects.

Definition at line 172 of file CPipe.h.

References initializePipe().

◆ initializePipe()

void CPipe::initializePipe ( CPipeReadEndPoint outReadPipe,
CPipeWriteEndPoint outWritePipe 
)
static

Creates a new pipe and returns the read & write end-points as newly allocated objects.

Definition at line 30 of file CPipe.cpp.

References mrpt::io::CPipeBaseEndPoint::m_pipe_file, and THROW_EXCEPTION.

Referenced by createPipe().

mrpt::io::CPipe::createPipe
static void createPipe(ReadPtr &outReadPipe, WritePtr &outWritePipe)
Creates a new pipe and returns the read & write end-points as newly allocated objects.
Definition: CPipe.h:172



Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST