RELATEED CONSULTING
相关咨询
选择下列产品马上在线沟通
服务时间:8:30-17:00
你可能遇到了下面的问题
关闭右侧工具栏

新闻中心

这里有您想知道的互联网营销解决方案
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://scyingshan.cn/article/dsogocs.html