快上网专注成都网站设计 成都网站制作 成都网站建设
成都网站建设公司服务热线:028-86922220

网站建设知识

十年网站开发经验 + 多家企业客户 + 靠谱的建站团队

量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决

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://6mz.cn/article/dsogocs.html

其他资讯