這個叫什么?Write Up嗎
10年積累的網(wǎng)站制作、成都做網(wǎng)站經(jīng)驗,可以快速應對客戶對網(wǎng)站的新想法和需求。提供各種問題對應的解決方案。讓選擇我們的客戶得到更好、更有力的網(wǎng)絡服務。我雖然不認識你,你也不認識我。但先建設網(wǎng)站后付款的網(wǎng)站建設流程,更有平壩免費網(wǎng)站建設讓你可以放心的選擇與我們合作。
lab0要做的事,實現(xiàn)buffer部分的功能,要自己寫變量以及實現(xiàn)接口。
成員函數(shù) write()向buffer內(nèi)寫數(shù)據(jù),peek_out() pop_out() read() 函數(shù)從buffer內(nèi)讀數(shù)據(jù),
buffer長度capacity,需要變量記錄向buffer內(nèi)一共寫入和讀取過多長的數(shù)據(jù)。
有些變量在后面的lab會用上,第一次寫真不容易想,好些都是參照別人的博客寫的。
// Construct a `StreamReassembler` that will store up to `capacity` bytes. StreamReassembler(const size_t capacity); // Receive a substring and write any newly contiguous bytes into the stream, // while staying within the memory limits of the `capacity`. Bytes that would // exceed the capacity are silently discarded. // // `data`: the substring // `index` indicates the index (place in sequence) of the first byte in `data` // `eof`: the last byte of this substring will be the last byte in the entire stream void push_substring(const string &data, const uint64_t index, const bool eof); // Access the reassembled ByteStream (your code from Lab 0) ByteStream &stream_out(); // The number of bytes in the substrings stored but not yet reassembled size_t unassembled_bytes() const; // Is the internal state empty (other than the output stream)? bool empty() const;