ONPOSIX
2.0
Main Page
Namespaces
Classes
Files
File List
File Members
ONPOSIX
OnPosix Library
Namespaces
Classes
Files
File List
include
src
AbstractThread.cpp
Buffer.cpp
DescriptorsMonitor.cpp
DgramSocketClientDescriptor.cpp
DgramSocketServerDescriptor.cpp
FifoDescriptor.cpp
FileDescriptor.cpp
Logger.cpp
main.cpp
Pipe.cpp
PosixCondition.cpp
PosixDescriptor.cpp
PosixMutex.cpp
Process.cpp
StreamSocketClientDescriptor.cpp
StreamSocketServer.cpp
StreamSocketServerDescriptor.cpp
Time.cpp
File Members
•
All
Classes
Namespaces
Files
Functions
Variables
Enumerator
Friends
Macros
Pages
Pipe.cpp
Go to the documentation of this file.
1
/*
2
* Pipe.cpp
3
*
4
* Created on: 05/set/2012
5
* Author: cloud
6
*/
7
8
#include <stdexcept>
9
#include <unistd.h>
10
11
#include "
Pipe.hpp
"
12
#include "
Logger.hpp
"
13
14
namespace
onposix {
15
16
/**
17
* \brief Constructor for the pipe
18
*
19
* @exception runtime_error in case of error
20
*/
21
Pipe::Pipe
(): read_(0), write_(0)
22
{
23
int
fd[2];
24
if
(pipe(fd) != 0) {
25
ERROR
(
"Opening pipe"
);
26
throw
std::runtime_error (
"Open pipe error"
);
27
}
28
read_
=
new
PosixDescriptor
(fd[0]);
29
write_
=
new
PosixDescriptor
(fd[1]);
30
}
31
32
33
}
/* onposix */
src
Pipe.cpp
Generated on Wed Apr 30 2014 15:27:24 for ONPOSIX by
1.8.1.2