当前位置: 首页>>代码示例>>C++>>正文


C++ ObObj::get_serialize_size方法代码示例

本文整理汇总了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;
 }
开发者ID:Alibaba-boonya,项目名称:oceanbase,代码行数:10,代码来源:ob_common_param.cpp

示例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);
}
开发者ID:Abioy,项目名称:oceanbase,代码行数:31,代码来源:test_ob_object.cpp

示例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;
 }
开发者ID:Alibaba-boonya,项目名称:oceanbase,代码行数:22,代码来源:ob_sql_scan_param.cpp

示例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;
    }
开发者ID:Alibaba-boonya,项目名称:oceanbase,代码行数:13,代码来源:ob_common_param.cpp

示例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();
    }
开发者ID:Alibaba-boonya,项目名称:oceanbase,代码行数:15,代码来源:ob_sql_get_param.cpp

示例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;
 }
开发者ID:Alibaba-boonya,项目名称:oceanbase,代码行数:24,代码来源:ob_sql_read_param.cpp

示例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();
 }
开发者ID:Alibaba-boonya,项目名称:oceanbase,代码行数:6,代码来源:ob_sql_scan_param.cpp


注:本文中的ObObj::get_serialize_size方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。