SNode.C
Loading...
Searching...
No Matches
core::pipe::Pipe Class Reference

#include <Pipe.h>

Collaboration diagram for core::pipe::Pipe:

Public Member Functions

 Pipe (const Pipe &pipe)=delete
 
Pipeoperator= (const Pipe &pipe)=delete
 
 Pipe (const std::function< void(PipeSource &, PipeSink &)> &onSuccess, const std::function< void(int)> &onError)
 

Private Attributes

int pipeFd [2] {}
 

Detailed Description

Definition at line 36 of file Pipe.h.

Constructor & Destructor Documentation

◆ Pipe() [1/2]

core::pipe::Pipe::Pipe ( const Pipe & pipe)
delete

◆ Pipe() [2/2]

core::pipe::Pipe::Pipe ( const std::function< void(PipeSource &, PipeSink &)> & onSuccess,
const std::function< void(int)> & onError )

Definition at line 35 of file Pipe.cpp.

35 {
36 const int ret = core::system::pipe2(pipeFd, O_NONBLOCK);
37
38 if (ret == 0) {
39 onSuccess(*(new PipeSource(pipeFd[1])), *(new PipeSink(pipeFd[0])));
40 } else {
41 onError(errno);
42 }
43 }
int pipeFd[2]
Definition Pipe.h:45
int pipe2(int pipefd[2], int flags)
Definition unistd.cpp:50

References core::system::pipe2(), pipeFd, core::pipe::PipeSink::PipeSink(), and core::pipe::PipeSource::PipeSource().

Here is the call graph for this function:

Member Function Documentation

◆ operator=()

Pipe & core::pipe::Pipe::operator= ( const Pipe & pipe)
delete

Member Data Documentation

◆ pipeFd

int core::pipe::Pipe::pipeFd[2] {}
private

Definition at line 45 of file Pipe.h.

45{};

Referenced by Pipe().


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