17 class CPipeReadEndPoint;
18 class CPipeWriteEndPoint;
51 template <
typename ReadPtr,
typename WritePtr>
52 static void createPipe(ReadPtr& outReadPipe, WritePtr& outWritePipe);
105 virtual size_t Read(
void* Buffer,
size_t Count)
override;
106 virtual size_t Write(
const void* Buffer,
size_t Count)
override;
136 size_t Write(
const void* Buffer,
size_t Count)
138 throw std::runtime_error(
"CPipeReadEndPoint::Write() cant be called.");
159 size_t Read(
void* Buffer,
size_t Count)
161 throw std::runtime_error(
"CPipeWriteEndPoint::Read() cant be called.");
169 template <
typename ReadPtr,
typename WritePtr>
TSeekOrigin
Used in CStream::Seek.
virtual size_t Read(void *Buffer, size_t Count) override
Introduces a pure virtual method responsible for reading from the stream.
virtual ~CPipeBaseEndPoint()
virtual uint64_t getPosition() const override
Without effect in this class.
size_t Read(void *Buffer, size_t Count)
Write-only pipe: read launches exception.
void close()
Closes the pipe (normally not needed to be called by users, automatically done at destructor) ...
CPipeBaseEndPoint & operator=(const CPipeBaseEndPoint &)=delete
CPipe()=delete
Create via createPipe() instead.
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
bool isOpen() const
Returns false if the pipe was closed due to some error.
virtual size_t Write(const void *Buffer, size_t Count) override
Introduces a pure virtual method responsible for writing to the stream.
std::string serialize()
Converts the end-point into a string suitable for reconstruction at a child process.
A pipe, portable across different OS.
virtual uint64_t Seek(int64_t of, CStream::TSeekOrigin o=sFromBeginning) override
Without effect in this class.
GLsizei const GLchar ** string
The write end-point in a pipe created with mrpt::synch::CPipe.
unsigned __int64 uint64_t
unsigned int timeout_read_start_us
(Default=0) Timeout for read operations: microseconds (us) to wait for the first byte.
virtual uint64_t getTotalBytesCount() const override
Without effect in this class.
static void createPipe(ReadPtr &outReadPipe, WritePtr &outWritePipe)
Creates a new pipe and returns the read & write end-points as newly allocated objects.
The read end-point in a pipe created with mrpt::synch::CPipe.
GLsizei const GLfloat * value
unsigned int timeout_read_between_us
(Default=0) Timeout between burst reads operations: microseconds (us) to wait between two partial rea...
size_t Write(const void *Buffer, size_t Count)
Read-only pipe, don't call this method.
static void initializePipe(CPipeReadEndPoint &outReadPipe, CPipeWriteEndPoint &outWritePipe)
Creates a new pipe and returns the read & write end-points as newly allocated objects.
Common interface of read & write pipe end-points.