MCPcopy Create free account
hub / github.com/ElementsProject/elements / FinishImpl

Method FinishImpl

src/leveldb/table/table_test.cc:183–199  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

181 : Constructor(cmp), comparator_(cmp), block_(nullptr) {}
182 ~BlockConstructor() override { delete block_; }
183 Status FinishImpl(const Options& options, const KVMap& data) override {
184 delete block_;
185 block_ = nullptr;
186 BlockBuilder builder(&options);
187
188 for (const auto& kvp : data) {
189 builder.Add(kvp.first, kvp.second);
190 }
191 // Open the block
192 data_ = builder.Finish().ToString();
193 BlockContents contents;
194 contents.data = data_;
195 contents.cachable = false;
196 contents.heap_allocated = false;
197 block_ = new Block(contents);
198 return Status::OK();
199 }
200 Iterator* NewIterator() const override {
201 return block_->NewIterator(comparator_);
202 }

Callers

nothing calls this directly

Calls 4

OKFunction · 0.85
AddMethod · 0.45
ToStringMethod · 0.45
FinishMethod · 0.45

Tested by

no test coverage detected