新网创想网站建设,新征程启航

为企业提供网站建设、域名注册、服务器等服务

cs144 lab0 lab1记录

这个叫什么?Write Up吗

10年积累的网站制作、成都做网站经验,可以快速应对客户对网站的新想法和需求。提供各种问题对应的解决方案。让选择我们的客户得到更好、更有力的网络服务。我虽然不认识你,你也不认识我。但先建设网站后付款的网站建设流程,更有平坝免费网站建设让你可以放心的选择与我们合作。

lab0

lab0要做的事,实现buffer部分的功能,要自己写变量以及实现接口。

成员函数 write()向buffer内写数据,peek_out() pop_out() read() 函数从buffer内读数据,

buffer长度capacity,需要变量记录向buffer内一共写入和读取过多长的数据。

有些变量在后面的lab会用上,第一次写真不容易想,好些都是参照别人的博客写的。

lab1

// 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;

分享名称:cs144 lab0 lab1记录
网站网址:http://www.wjwzjz.com/article/dsogocs.html
在线咨询
服务热线
服务热线:028-86922220
TOP