19 class CPipeReadEndPoint;
20 class CPipeWriteEndPoint;
53 template <
typename ReadPtr,
typename WritePtr>
54 static void createPipe(ReadPtr& outReadPipe, WritePtr& outWritePipe);
107 size_t Read(
void* Buffer,
size_t Count)
override;
108 size_t Write(
const void* Buffer,
size_t Count)
override;
118 !std::is_copy_constructible_v<CPipeBaseEndPoint> &&
119 !std::is_copy_assignable_v<CPipeBaseEndPoint>,
137 size_t Write(
const void* Buffer,
size_t Count)
override 139 throw std::runtime_error(
"CPipeReadEndPoint::Write() cant be called.");
160 size_t Read(
void* Buffer,
size_t Count)
override 162 throw std::runtime_error(
"CPipeWriteEndPoint::Read() cant be called.");
170 template <
typename ReadPtr,
typename WritePtr>
TSeekOrigin
Used in CStream::Seek.
size_t Read(void *Buffer, size_t Count) override
Introduces a pure virtual method responsible for reading from the stream.
uint64_t getPosition() const override
Without effect in this class.
size_t Read(void *Buffer, size_t Count) override
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
size_t Write(const void *Buffer, size_t Count) override
Read-only pipe, don't call this method.
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.
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.
uint64_t Seek(int64_t of, CStream::TSeekOrigin o=sFromBeginning) override
Without effect in this class.
The write end-point in a pipe created with mrpt::synch::CPipe.
~CPipeBaseEndPoint() override
unsigned int timeout_read_start_us
(Default=0) Timeout for read operations: microseconds (us) to wait for the first byte.
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.
unsigned int timeout_read_between_us
(Default=0) Timeout between burst reads operations: microseconds (us) to wait between two partial rea...
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.