本文整理汇总了C++中BinaryRefReader::advance方法的典型用法代码示例。如果您正苦于以下问题:C++ BinaryRefReader::advance方法的具体用法?C++ BinaryRefReader::advance怎么用?C++ BinaryRefReader::advance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BinaryRefReader
的用法示例。
在下文中一共展示了BinaryRefReader::advance方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: deserialize
LedgerEntryVector LedgerEntryVector::deserialize(BinaryRefReader& brr)
{
LedgerEntryVector lev;
auto type_code = brr.get_uint8_t();
if (type_code != LEDGERENTRYVECTOR_CODE)
BtcUtils::throw_type_error(LEDGERENTRYVECTOR_CODE, type_code);
auto count = brr.get_var_int();
for (unsigned i = 0; i < count; i++)
{
auto leSize = brr.get_var_int();
if (leSize > brr.getSizeRemaining())
throw runtime_error("deser size mismatch");
auto idSize = brr.get_var_int();
if (idSize + 53 != leSize)
throw runtime_error("deser size mismatch");
string leid((char*)brr.getCurrPtr(), idSize);
brr.advance(idSize);
auto value = (int64_t*)brr.getCurrPtr();
brr.advance(8);
auto blockNum = brr.get_uint32_t();
auto txHash = brr.get_BinaryDataRef(32);
auto txindex = brr.get_uint32_t();
auto txTime = brr.get_uint32_t();
BitUnpacker<uint8_t> bit(brr.get_uint8_t());
auto coinbase = bit.getBit();
auto sts = bit.getBit();
auto change = bit.getBit();
auto rbf = bit.getBit();
LedgerEntryData led(leid, *value,
blockNum, txHash, txindex, txTime,
coinbase, sts, change, rbf);
lev.push_back(move(led));
}
return lev;
}
示例2: unserialize
void TxOut::unserialize( BinaryRefReader & brr,
uint32_t nbytes,
TxRef parent,
uint32_t idx)
{
unserialize_checked( brr.getCurrPtr(), brr.getSizeRemaining(), nbytes, parent, idx );
brr.advance(getSize());
}
示例3: unserialize
void TxRef::unserialize(BinaryRefReader & brr)
{
unserialize(brr.getCurrPtr());
brr.advance(nBytes_);
}