MCPcopy Create free account
hub / github.com/apache/mesos / Reader

Class Reader

3rdparty/libprocess/include/process/http.hpp:315–352  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

313
314public:
315 class Reader
316 {
317 public:
318 // Returns data written to the pipe.
319 // Returns an empty read when end-of-file is reached.
320 // Returns Failure if the writer failed, or the read-end
321 // is closed.
322 Future<std::string> read();
323
324 // Performs a series of asynchronous reads, until EOF is reached.
325 // Returns the concatenated result of the reads.
326 // Returns Failure if the writer failed, or the read-end
327 // is closed.
328 Future<std::string> readAll();
329
330 // Closing the read-end of the pipe before the write-end closes
331 // or fails will notify the writer that the reader is no longer
332 // interested. Returns false if the read-end was already closed.
333 bool close();
334
335 // Comparison operators useful for checking connection equality.
336 bool operator==(const Reader& other) const { return data == other.data; }
337 bool operator!=(const Reader& other) const { return !(*this == other); }
338
339 private:
340 friend class Pipe;
341
342 enum State
343 {
344 OPEN,
345 CLOSED,
346 };
347
348 explicit Reader(const std::shared_ptr<Data>& _data)
349 : data(_data) {}
350
351 std::shared_ptr<Data> data;
352 };
353
354 class Writer
355 {

Callers 1

readerMethod · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected