本文整理汇总了C++中ObObj::is_max_value方法的典型用法代码示例。如果您正苦于以下问题:C++ ObObj::is_max_value方法的具体用法?C++ ObObj::is_max_value怎么用?C++ ObObj::is_max_value使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObObj
的用法示例。
在下文中一共展示了ObObj::is_max_value方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
int ObMetaTable3::MyIterator::check_rowkey_obj_type(int32_t rowkey_obj_idx, const ObObj &obj) const
{
int ret = OB_SUCCESS;
bool found = false;
for (int k = 0; k < table_schema_.columns_.count(); ++k)
{
const ColumnSchema &cschema = table_schema_.columns_.at(k);
if (rowkey_obj_idx + 1 == cschema.rowkey_id_) // rowkey_id start from 1
{
if (obj.get_type() != cschema.data_type_
&& (!obj.is_min_value())
&& (!obj.is_max_value()))
{
TBSYS_LOG(WARN, "invalid meta table row key, cid=%lu ctype=%d obj_type=%d",
cschema.column_id_, cschema.data_type_, obj.get_type());
break;
}
found = true;
break;
}
} // end for
if (!found)
{
TBSYS_LOG(WARN, "rowkey obj not found in table schema, idx=%d", rowkey_obj_idx);
ret = OB_ERR_DATA_FORMAT;
}
return ret;
}
示例2: compare
int ObObj::compare(const ObObj &other) const
{
int cmp = 0;
ObObjType this_type = get_type();
ObObjType other_type = other.get_type();
if (!can_compare(other))
{
TBSYS_LOG(ERROR, "can not be compared, this_type=%d other_type=%d",
get_type(), other.get_type());
cmp = this_type - other_type;
}
else
{
// compare principle : min value < null type < normal object < max value;
if (is_min_value())
{
// min value == min value and less than any else
if (other.is_min_value())
{
cmp = 0;
}
else
{
cmp = -1;
}
}
else if (is_max_value())
{
// max value == max value and great than any else
if (other.is_max_value())
{
cmp = 0;
}
else
{
cmp = 1;
}
}
else if (this_type == ObNullType)
{
// null type == null type but less than any else type object.
// null type > min type
if (other.is_min_value())
{
// null type > min value
cmp = 1;
}
else if (other_type == ObNullType)
{
// null type == null type.
cmp = 0;
}
else
{
// null type < any of normal object type.
cmp = -1;
}
}
else if (other.is_min_value() || other_type == ObNullType)
{
// any of normal type (except null type) > (min value & null type)
cmp = 1;
}
else if (other.is_max_value())
{
cmp = -1;
}
/*
else if (this_type == ObNullType || other_type == ObNullType)
{
cmp = this_type - other_type;
}
*/
else
{
// okay finally, two object are normal object type.
cmp = this->compare_same_type(other);
}
}
return cmp;
}