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 58 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 57 of file Pipe.cpp.

57 {
58 const int ret = core::system::pipe2(pipeFd, O_NONBLOCK);
59
60 if (ret == 0) {
61 onSuccess(*(new PipeSource(pipeFd[1])), *(new PipeSink(pipeFd[0])));
62 } else {
63 onError(errno);
64 }
65 }
int pipeFd[2]
Definition Pipe.h:67
int pipe2(int pipefd[2], int flags)
Definition unistd.cpp:72

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

Referenced by main().

Here is the call graph for this function:
Here is the caller 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 67 of file Pipe.h.

67{};

Referenced by Pipe().


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