veriblock-pop-cpp
C++11 Libraries for leveraging VeriBlock Proof-Of-Proof blockchain technology.
altintegration::adaptors::BlockBatchImpl Struct Reference

Detailed Description

Definition at line 236 of file block_provider_impl.hpp.

+ Inheritance diagram for altintegration::adaptors::BlockBatchImpl:
+ Collaboration diagram for altintegration::adaptors::BlockBatchImpl:

Public Member Functions

 BlockBatchImpl (WriteBatch &batch)
 
void writeBlock (const AltBlock::hash_t &hash, const AltBlock::prev_hash_t &prev_hash, const StoredBlockIndex< AltBlock > &blk) override
 Save BlockIndex on disk. More...
 
void writeBlock (const VbkBlock::hash_t &hash, const VbkBlock::prev_hash_t &prev_hash, const StoredBlockIndex< VbkBlock > &blk) override
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
void writeBlock (const BtcBlock::hash_t &hash, const BtcBlock::prev_hash_t &prev_hash, const StoredBlockIndex< BtcBlock > &blk) override
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
void writeTip (const AltBlock::hash_t &hash) override
 Save Tree tip on disk. More...
 
void writeTip (const VbkBlock::hash_t &hash) override
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
void writeTip (const BtcBlock::hash_t &hash) override
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
virtual void writeBlock (const AltBlock::hash_t &hash, const AltBlock::prev_hash_t &prev_hash, const StoredBlockIndex< AltBlock > &value)=0
 Save BlockIndex on disk. More...
 
virtual void writeBlock (const VbkBlock::hash_t &hash, const VbkBlock::prev_hash_t &prev_hash, const StoredBlockIndex< VbkBlock > &value)=0
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
virtual void writeBlock (const BtcBlock::hash_t &hash, const BtcBlock::prev_hash_t &prev_hash, const StoredBlockIndex< BtcBlock > &value)=0
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
virtual void writeTip (const AltBlock::hash_t &value)=0
 Save Tree tip on disk. More...
 
virtual void writeTip (const VbkBlock::hash_t &value)=0
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
virtual void writeTip (const BtcBlock::hash_t &value)=0
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 

Constructor & Destructor Documentation

◆ BlockBatchImpl()

altintegration::adaptors::BlockBatchImpl::BlockBatchImpl ( WriteBatch batch)
inline

Definition at line 239 of file block_provider_impl.hpp.

239: batch_(batch) {}

Member Function Documentation

◆ writeBlock() [1/3]

void altintegration::adaptors::BlockBatchImpl::writeBlock ( const AltBlock::hash_t &  hash,
const AltBlock::prev_hash_t &  prev_hash,
const StoredBlockIndex< AltBlock > &  value 
)
inlineoverridevirtual
Parameters
hash
prev_hash
value

Implements altintegration::BlockBatch.

Definition at line 241 of file block_provider_impl.hpp.

243 {
244 batch_.write(block_prev_key<AltBlock>(prev_hash), hash);
245 batch_.write(block_key<AltBlock>(hash), SerializeToVbkEncoding(blk));
246 }
std::vector< uint8_t > SerializeToVbkEncoding(const T &obj)
Serialize to VBK encoding.
Definition: serde.hpp:440

◆ writeBlock() [2/3]

void altintegration::adaptors::BlockBatchImpl::writeBlock ( const BtcBlock::hash_t hash,
const BtcBlock::prev_hash_t prev_hash,
const StoredBlockIndex< BtcBlock > &  value 
)
inlineoverridevirtual

Implements altintegration::BlockBatch.

Definition at line 255 of file block_provider_impl.hpp.

257 {
258 batch_.write(block_prev_key<BtcBlock>(prev_hash), hash.asVector());
259 batch_.write(block_key<BtcBlock>(hash), SerializeToVbkEncoding(blk));
260 }

◆ writeBlock() [3/3]

void altintegration::adaptors::BlockBatchImpl::writeBlock ( const VbkBlock::hash_t hash,
const VbkBlock::prev_hash_t prev_hash,
const StoredBlockIndex< VbkBlock > &  value 
)
inlineoverridevirtual

Implements altintegration::BlockBatch.

Definition at line 248 of file block_provider_impl.hpp.

250 {
251 batch_.write(block_prev_key<VbkBlock>(prev_hash), hash.asVector());
252 batch_.write(block_key<VbkBlock>(hash), SerializeToVbkEncoding(blk));
253 }

◆ writeTip() [1/3]

void altintegration::adaptors::BlockBatchImpl::writeTip ( const AltBlock::hash_t &  value)
inlineoverridevirtual
Parameters
value

Implements altintegration::BlockBatch.

Definition at line 262 of file block_provider_impl.hpp.

262 {
263 batch_.write(tip_key<AltBlock>(), hash);
264 }

◆ writeTip() [2/3]

void altintegration::adaptors::BlockBatchImpl::writeTip ( const BtcBlock::hash_t value)
inlineoverridevirtual

Implements altintegration::BlockBatch.

Definition at line 270 of file block_provider_impl.hpp.

270 {
271 batch_.write(tip_key<BtcBlock>(), hash.asVector());
272 }

◆ writeTip() [3/3]

void altintegration::adaptors::BlockBatchImpl::writeTip ( const VbkBlock::hash_t value)
inlineoverridevirtual

Implements altintegration::BlockBatch.

Definition at line 266 of file block_provider_impl.hpp.

266 {
267 batch_.write(tip_key<VbkBlock>(), hash.asVector());
268 }

The documentation for this struct was generated from the following file: