17 class CPipeReadEndPoint;
18 class CPipeWriteEndPoint;
51 template <
typename ReadPtr,
typename WritePtr>
52 static void createPipe(ReadPtr& outReadPipe, WritePtr& outWritePipe);
105 size_t Read(
void* Buffer,
size_t Count)
override;
106 size_t Write(
const void* Buffer,
size_t Count)
override;
116 !std::is_copy_constructible_v<CPipeBaseEndPoint> &&
117 !std::is_copy_assignable_v<CPipeBaseEndPoint>,
135 size_t Write(
const void* Buffer,
size_t Count)
override 137 throw std::runtime_error(
"CPipeReadEndPoint::Write() cant be called.");
158 size_t Read(
void* Buffer,
size_t Count)
override 160 throw std::runtime_error(
"CPipeWriteEndPoint::Read() cant be called.");
168 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.