本文整理汇总了C++中ObObj::get_serialize_size方法的典型用法代码示例。如果您正苦于以下问题:C++ ObObj::get_serialize_size方法的具体用法?C++ ObObj::get_serialize_size怎么用?C++ ObObj::get_serialize_size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObObj
的用法示例。
在下文中一共展示了ObObj::get_serialize_size方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: get_reserve_param_serialize_size
int64_t ObReadParam::get_reserve_param_serialize_size(void) const
{
ObObj obj;
// reserve for read master
obj.set_ext(ObActionFlag::RESERVE_PARAM_FIELD);
int64_t total_size = obj.get_serialize_size();
obj.set_int(get_is_read_consistency());
total_size += obj.get_serialize_size();
return total_size;
}
示例2: free
TEST(ObObj,Serialize_int_add)
{
ObObj t;
t.set_int(9900);
int64_t len = t.get_serialize_size();
ASSERT_EQ(len,3);
char *buf = (char *)malloc(len);
int64_t pos = 0;
ASSERT_EQ(t.serialize(buf,len,pos),OB_SUCCESS);
ASSERT_EQ(pos,len);
ObObj f;
pos = 0;
ASSERT_EQ(f.deserialize(buf,len,pos),OB_SUCCESS);
ASSERT_EQ(pos,len);
int64_t r = 0;
int64_t l = 0;
ASSERT_EQ(f.get_type(),t.get_type());
f.get_int(r);
t.get_int(l);
ASSERT_EQ(r,l);
free(buf);
}
示例3: get_basic_param_serialize_size
int64_t ObSqlScanParam::get_basic_param_serialize_size(void) const
{
int64_t total_size = 0;
ObObj obj;
// BASIC_PARAM_FIELD
obj.set_ext(ObActionFlag::BASIC_PARAM_FIELD);
total_size += obj.get_serialize_size();
// scan range
obj.set_int(range_.table_id_);
total_size += obj.get_serialize_size();
obj.set_int(range_.border_flag_.get_data());
total_size += obj.get_serialize_size();
// start_key_
total_size += get_rowkey_obj_array_size(
range_.start_key_.get_obj_ptr(), range_.start_key_.get_obj_cnt());
// end_key_
total_size += get_rowkey_obj_array_size(
range_.end_key_.get_obj_ptr(), range_.end_key_.get_obj_cnt());
obj.set_int(scan_flag_.flag_);
total_size += obj.get_serialize_size();
return total_size;
}
示例4: get_rowkey_obj_array_size
int64_t get_rowkey_obj_array_size(const ObObj* array, const int64_t size)
{
int64_t total_size = 0;
ObObj obj;
obj.set_int(size);
total_size += obj.get_serialize_size();
for (int64_t i = 0; i < size; ++i)
{
total_size += array[i].get_serialize_size();
}
return total_size;
}
示例5: get_obj_serialize_size
int64_t ObSqlGetParam::get_obj_serialize_size(const int64_t value, bool is_ext) const
{
ObObj obj;
if (is_ext)
{
obj.set_ext(value);
}
else
{
obj.set_int(value);
}
return obj.get_serialize_size();
}
示例6: get_basic_param_serialize_size
int64_t ObSqlReadParam::get_basic_param_serialize_size(void) const
{
int64_t total_size = 0;
ObObj obj;
// consistency
obj.set_int(get_is_read_consistency());
total_size += obj.get_serialize_size();
// result cached
obj.set_int(get_is_result_cached());
total_size += obj.get_serialize_size();
// data version
obj.set_int(get_data_version());
total_size += obj.get_serialize_size();
// table id
obj.set_int(table_id_);
total_size += obj.get_serialize_size();
// renamed table id
obj.set_int(renamed_table_id_);
total_size += obj.get_serialize_size();
// only_static_data
obj.set_bool(only_static_data_);
total_size += obj.get_serialize_size();
return total_size;
}
示例7: get_end_param_serialize_size
int64_t ObSqlScanParam::get_end_param_serialize_size(void) const
{
ObObj obj;
obj.set_ext(ObActionFlag::END_PARAM_FIELD);
return obj.get_serialize_size();
}