ipfs-chromium
dag_headers.h
1 #ifndef IPFS_CHROMIUM_DAG_HEADERS_H
2 #define IPFS_CHROMIUM_DAG_HEADERS_H
3 
4 #include <ipfs_client/ipld/block_source.h>
5 
6 #include <map>
7 #include <string>
8 #include <vector>
9 
10 namespace ipfs::ipld {
13 class DagHeaders {
14  public:
15  void Add(BlockSource const&);
16  void Finish();
17  using HeaderList = std::vector<std::pair<std::string, std::string>>;
18 
19  HeaderList const& headers() const { return headers_; }
20 
21  private:
22  std::map<BlockSource::Category, short> individual_counts_;
23  HeaderList headers_;
24  std::size_t other_count_ = {};
25  BlockSource::Clock::duration other_sum_ = std::chrono::milliseconds(0);
26 };
27 } // namespace ipfs::ipld
28 
29 #endif // IPFS_CHROMIUM_DAG_HEADERS_H
Definition: dag_headers.h:13
Definition: block_source.h:12