本文整理汇总了C++中common::Stream::get_data方法的典型用法代码示例。如果您正苦于以下问题:C++ Stream::get_data方法的具体用法?C++ Stream::get_data怎么用?C++ Stream::get_data使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类common::Stream
的用法示例。
在下文中一共展示了Stream::get_data方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: deserialize
int WriteInfoBatchMessage::deserialize(common::Stream& input)
{
int64_t pos = 0;
int32_t iret = write_data_info_.deserialize(input.get_data(), input.get_data_length(), pos);
if (common::TFS_SUCCESS == iret)
{
input.drain(write_data_info_.length());
}
int32_t have_block = 0;
if (common::TFS_SUCCESS == iret)
{
iret = input.get_int32(&have_block);
}
if (common::TFS_SUCCESS == iret)
{
if (1 == have_block)
{
pos = 0;
iret = block_info_.deserialize(input.get_data(), input.get_data_length(), pos);
if (common::TFS_SUCCESS == iret)
{
input.drain(block_info_.length());
}
}
}
int32_t size = 0;
if (common::TFS_SUCCESS == iret)
{
iret = input.get_int32(&size);
}
if (common::TFS_SUCCESS == iret)
{
for (int32_t i = 0; i < size; ++i)
{
pos = 0;
common::RawMeta raw_meta;
iret = raw_meta.deserialize(input.get_data(), input.get_data_length(), pos);
if (common::TFS_SUCCESS == iret)
{
meta_list_.push_back(raw_meta);
input.drain(raw_meta.length());
}
else
{
break;
}
}
}
if (common::TFS_SUCCESS == iret)
{
iret = input.get_int32(&cluster_);
}
return iret;
}
示例2: deserialize
int ECMarshallingMessage::deserialize(common::Stream& input)
{
int32_t ret = input.get_int64(&family_id_);
if (common::TFS_SUCCESS == ret)
{
ret = input.get_int64(&seqno_);
}
if (common::TFS_SUCCESS == ret)
{
ret = input.get_int32(&expire_time_);
}
if (common::TFS_SUCCESS == ret)
{
ret = input.get_int32(&family_aid_info_);
}
if (common::TFS_SUCCESS == ret)
{
const int32_t MEMBER_NUM = GET_DATA_MEMBER_NUM(family_aid_info_) + GET_CHECK_MEMBER_NUM(family_aid_info_);
ret = (MEMBER_NUM > 0 && MEMBER_NUM <= MAX_MARSHALLING_NUM) ? common::TFS_SUCCESS : common::EXIT_PARAMETER_ERROR;
if (TFS_SUCCESS == ret)
{
family_members_ = new (std::nothrow)FamilyMemberInfo[MEMBER_NUM];
assert(family_members_);
for (int32_t index = 0; index < MEMBER_NUM && TFS_SUCCESS == ret; ++index)
{
int64_t pos = 0;
ret = family_members_[index].deserialize(input.get_data(), input.get_data_length() , pos);
if (TFS_SUCCESS == ret)
input.drain(family_members_[index].length());
}
}
}
return ret;
}
示例3: deserialize
int ResolveBlockVersionConflictMessage::deserialize(common::Stream& input)
{
int32_t size = 0;
int32_t ret = input.get_int32(reinterpret_cast<int32_t*>(&block_));
if (common::TFS_SUCCESS == ret)
{
ret = input.get_int32(&size);
}
if (common::TFS_SUCCESS == ret)
{
std::pair<uint64_t, common::BlockInfo> item;
for (int32_t index = 0; index < size && common::TFS_SUCCESS == ret; ++index)
{
ret = input.get_int64(reinterpret_cast<int64_t*>(&item.first));
if (common::TFS_SUCCESS == ret)
{
int64_t pos = 0;
ret = item.second.deserialize(input.get_data(), input.get_data_length(), pos);
if (common::TFS_SUCCESS == ret)
input.drain(item.second.length());
}
if (common::TFS_SUCCESS == ret)
{
members_.push_back(item);
}
}
}
return ret;
}
示例4: deserialize
int BlockFileInfoMessage::deserialize(common::Stream& input)
{
int32_t size = 0;
int32_t iret = input.get_int32(reinterpret_cast<int32_t*> (&block_id_));
if (common::TFS_SUCCESS == iret)
{
iret = input.get_int32(&size);
}
if (common::TFS_SUCCESS == iret)
{
common::FileInfo info;
for (int32_t i = 0; i < size; ++i)
{
int64_t pos = 0;
iret = info.deserialize(input.get_data(), input.get_data_length(), pos);
if (common::TFS_SUCCESS == iret)
{
input.drain(info.length());
fileinfo_list_.push_back(info);
}
else
{
break;
}
}
}
return iret;
}
示例5: deserialize
int DsCommitCompactBlockCompleteToNsMessage::deserialize(common::Stream& input)
{
int32_t ret = input.get_int64(&seqno_);
if (common::TFS_SUCCESS == ret)
{
int64_t pos = 0;
ret = block_info_.deserialize(input.get_data(), input.get_data_length(), pos);
}
int8_t size = 0;
if (common::TFS_SUCCESS == ret)
{
input.drain(block_info_.length());
ret = input.get_int8(&size);
}
if (common::TFS_SUCCESS == ret)
{
for (int8_t index = 0; index < size && common::TFS_SUCCESS == ret; ++index)
{
std::pair<uint64_t, int8_t> item;
ret = input.get_int64(reinterpret_cast<int64_t*>(&item.first));
if (common::TFS_SUCCESS == ret)
{
ret = input.get_int8(&item.second);
}
if (common::TFS_SUCCESS == ret)
{
result_.push_back(item);
}
}
}
return ret;
}
示例6: get_counter_map
int AccessStatInfoMessage::get_counter_map(common::Stream& input, COUNTER_TYPE & map)
{
int32_t size = 0;
int32_t iret = input.get_int32(&size);
if (common::TFS_SUCCESS == iret)
{
common::Throughput t;
int64_t pos = 0;
int32_t id = 0;
for (int32_t i = 0; i < size; ++i)
{
iret = input.get_int32(&id);
if (common::TFS_SUCCESS != iret)
break;
pos = 0;
iret = t.deserialize(input.get_data(), input.get_data_length(), pos);
if (common::TFS_SUCCESS != iret)
break;
else
{
input.drain(t.length());
map.insert(COUNTER_TYPE::value_type(id, t));
}
}
}
return iret;
}
示例7: deserialize
int ReportCheckBlockResponseMessage::deserialize(common::Stream& input)
{
int ret = input.get_int64(reinterpret_cast<int64_t*>(&server_id_));
if (TFS_SUCCESS == ret)
{
ret = input.get_int64(&seqno_);
}
int32_t size = 0;
if (TFS_SUCCESS == ret)
{
ret = input.get_int32(&size);
}
for (int32_t index = 0; index < size && TFS_SUCCESS == ret; index++)
{
CheckResult item;
int64_t pos = 0;
ret = item.deserialize(input.get_data(), input.get_data_length(), pos);
if (TFS_SUCCESS == ret)
{
input.drain(result_[index].length());
result_.push_back(item);
}
}
return ret;
}
示例8: deserialize
int DumpPlanResponseMessage::deserialize(common::Stream& input)
{
int32_t iret = common::TFS_SUCCESS;
if (input.get_data_length() > 0)
{
data_.writeBytes(input.get_data(), input.get_data_length());
}
return iret;
}
示例9: deserialize
int MasterAndSlaveHeartMessage::deserialize(common::Stream& input)
{
int64_t pos = 0;
int32_t iret = ns_identity_.deserialize(input.get_data(), input.get_data_length(), pos);
if (common::TFS_SUCCESS == iret)
{
input.drain(ns_identity_.length());
}
return iret;
}
示例10: deserialize
int ShowServerInformationMessage::deserialize(common::Stream& input)
{
int64_t pos = 0;
int32_t iret = param.deserialize(input.get_data(), input.get_data_length(), pos);
if (common::TFS_SUCCESS == iret)
{
input.drain(pos);
}
return iret;
}
示例11: deserialize
int ClientCmdMessage::deserialize(common::Stream& input)
{
int64_t pos = 0;
int32_t iret = info_.deserialize(input.get_data(), input.get_data_length(), pos);
if (common::TFS_SUCCESS == iret)
{
input.drain(info_.length());
}
return iret;
}
示例12: deserialize
int WriteRawDataMessage::deserialize(common::Stream& input)
{
int64_t pos = 0;
int32_t iret = write_data_info_.deserialize(input.get_data(), input.get_data_length(), pos);
if (common::TFS_SUCCESS == iret)
{
input.drain(write_data_info_.length());
if (write_data_info_.length_ > 0)
{
data_ = input.get_data();
input.drain( write_data_info_.length_);
}
}
if (common::TFS_SUCCESS == iret)
{
iret = input.get_int32(&flag_);
}
return iret;
}
示例13:
int ReadRawdataRespMessageV2::deserialize(common::Stream& input)
{
int ret = input.get_int32(&length_);
if (TFS_SUCCESS == ret)
{
if (length_ > 0)
{
data_ = input.get_data();
input.drain(length_);
}
}
return ret;
}
示例14: deserialize
int UnlinkFileMessage::deserialize(common::Stream& input)
{
int64_t pos = 0;
int32_t ret = unlink_file_info_.deserialize(input.get_data(), input.get_data_length(), pos);
if (common::TFS_SUCCESS == ret)
{
input.drain(unlink_file_info_.length());
}
if (common::TFS_SUCCESS == ret)
{
ret = input.get_vint64(dataservers_);
}
if (common::TFS_SUCCESS == ret)
{
input.get_int32(&option_flag_);
}
if (common::TFS_SUCCESS == ret)
{
BasePacket::parse_special_ds(dataservers_, version_, lease_id_);
}
if ((common::TFS_SUCCESS == ret) && input.get_data_length() > 0)
{
ret = input.get_int64(reinterpret_cast<int64_t*>(&lease_id_ext_));
}
if (common::TFS_SUCCESS == ret && input.get_data_length() > 0)
{
int64_t pos = 0;
ret = family_info_.deserialize(input.get_data(), input.get_data_length(), pos);
if (common::TFS_SUCCESS == ret)
{
input.drain(family_info_.length());
}
}
return ret;
}
示例15: deserialize
int WriteRawIndexMessage::deserialize(common::Stream& input)
{
uint32_t index_count = 0;
int32_t iret = input.get_int32((int32_t*)&block_id_);
if (common::TFS_SUCCESS == iret)
{
iret = input.get_int64(&family_id_);
}
if (common::TFS_SUCCESS == iret)
{
iret = input.get_int32(reinterpret_cast<int32_t*>(&index_op_));
}
if (common::TFS_SUCCESS == iret)
{
iret = input.get_int32((int32_t*)&index_count);
}
index_vec_.clear();
for (uint32_t i = 0; i < index_count && common::TFS_SUCCESS == iret; i++)
{
common::RawIndex index;
if (common::TFS_SUCCESS == iret)
{
iret = input.get_int32((int32_t*)&index.block_id_);
}
if (common::TFS_SUCCESS == iret)
{
iret = input.get_int32((int32_t*)&index.size_);
}
if (index.size_ > 0)
{
index.data_ = input.get_data();
input.drain(index.size_);
}
index_vec_.push_back(index);
}
return iret;
}