9#ifndef mrpt_synch_pipe_H
10#define mrpt_synch_pipe_H
22 class CPipeReadEndPoint;
23 class CPipeWriteEndPoint;
47 static void createPipe(std::auto_ptr<CPipeReadEndPoint>& outReadPipe,std::auto_ptr<CPipeWriteEndPoint>& outWritePipe);
77 inline bool isOpen()
const {
return m_pipe_file!=0; }
91 virtual uint64_t
Seek(uint64_t Offset, CStream::TSeekOrigin Origin = sFromBeginning)
MRPT_OVERRIDE;
Common interface of read & write pipe end-points.
unsigned int timeout_read_between_us
(Default=0) Timeout between burst reads operations: microseconds (us) to wait between two partial rea...
virtual size_t Read(void *Buffer, size_t Count) MRPT_OVERRIDE
Introduces a pure virtual method responsible for reading from the stream.
unsigned int timeout_read_start_us
(Default=0) Timeout for read operations: microseconds (us) to wait for the first byte....
CPipeBaseEndPoint(const std::string &serialized)
De-serializes one end-point description, for example, from a parent process.
virtual uint64_t Seek(uint64_t Offset, CStream::TSeekOrigin Origin=sFromBeginning) MRPT_OVERRIDE
Without effect in this class.
virtual ~CPipeBaseEndPoint()
virtual uint64_t getTotalBytesCount() MRPT_OVERRIDE
Without effect in this class.
virtual size_t Write(const void *Buffer, size_t Count) MRPT_OVERRIDE
Introduces a pure virtual method responsible for writing to the stream.
void close()
Closes the pipe (normally not needed to be called by users, automatically done at destructor)
bool isOpen() const
Returns false if the pipe was closed due to some error.
std::string serialize()
Converts the end-point into a string suitable for reconstruction at a child process.
A pipe, portable across different OS.
static void createPipe(std::auto_ptr< CPipeReadEndPoint > &outReadPipe, std::auto_ptr< CPipeWriteEndPoint > &outWritePipe)
Creates a new pipe and returns the read & write end-points as newly allocated objects.
CPipe()
No need to create any object of this class.
The read end-point in a pipe created with mrpt::synch::CPipe.
CPipeReadEndPoint(const std::string &serialized)
De-serializes one end-point description, for example, from a parent process.
void WriteBuffer(const void *Buffer, size_t Count)
Hide the write method in this read-only pipe.
The write end-point in a pipe created with mrpt::synch::CPipe.
CPipeWriteEndPoint(const std::string &serialized)
De-serializes one end-point description, for example, from a parent process.
size_t ReadBuffer(void *Buffer, size_t Count)
Hide the read method in this write-only pipe.
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
The base class of classes that cannot be copied: compile-time errors will be issued on any copy opera...
#define MRPT_OVERRIDE
C++11 "override" for virtuals:
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.