本文整理汇总了C++中ObExprObj::get_type方法的典型用法代码示例。如果您正苦于以下问题:C++ ObExprObj::get_type方法的具体用法?C++ ObExprObj::get_type怎么用?C++ ObExprObj::get_type使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObExprObj
的用法示例。
在下文中一共展示了ObExprObj::get_type方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: double_mtime
static int double_mtime(const ObObjCastParams ¶ms, const ObExprObj &in, ObExprObj &out)
{
UNUSED(params);
OB_ASSERT(in.get_type() == ObDoubleType);
out.set_mtime(static_cast<ObModifyTime> (in.get_double()));
return OB_SUCCESS;
}
示例2: ctime_float
static int ctime_float(const ObObjCastParams ¶ms, const ObExprObj &in, ObExprObj &out)
{
UNUSED(params);
OB_ASSERT(in.get_type() == ObCreateTimeType);
out.set_float(static_cast<float> (in.get_ctime()));
return OB_SUCCESS;
}
示例3: double_int
static int double_int(const ObObjCastParams ¶ms, const ObExprObj &in, ObExprObj &out)
{
UNUSED(params);
OB_ASSERT(in.get_type() == ObDoubleType);
out.set_int(static_cast<int64_t> (in.get_double()));
return OB_SUCCESS;
}
示例4: ctime_datetime
static int ctime_datetime(const ObObjCastParams ¶ms, const ObExprObj &in, ObExprObj &out)
{
UNUSED(params);
OB_ASSERT(in.get_type() == ObCreateTimeType);
out.set_datetime(static_cast<ObDateTime> (in.get_ctime() / 1000000L));
return OB_SUCCESS;
}
示例5: mtime_pdatetime
static int mtime_pdatetime(const ObObjCastParams ¶ms, const ObExprObj &in, ObExprObj &out)
{
UNUSED(params);
OB_ASSERT(in.get_type() == ObModifyTimeType);
out.set_precise_datetime(static_cast<ObPreciseDateTime> (in.get_mtime()));
return OB_SUCCESS;
}
示例6: float_double
static int float_double(const ObObjCastParams ¶ms, const ObExprObj &in, ObExprObj &out)
{
UNUSED(params);
OB_ASSERT(in.get_type() == ObFloatType);
out.set_double(static_cast<double> (in.get_float()));
return OB_SUCCESS;
}
示例7: decimal_bool
static int decimal_bool(const ObObjCastParams ¶ms, const ObExprObj &in, ObExprObj &out)
{
UNUSED(params);
OB_ASSERT(in.get_type() == ObDecimalType);
out.set_bool(!in.get_decimal().is_zero());
return OB_SUCCESS;
}
示例8: mtime_bool
static int mtime_bool(const ObObjCastParams ¶ms, const ObExprObj &in, ObExprObj &out)
{
UNUSED(params);
OB_ASSERT(in.get_type() == ObModifyTimeType);
out.set_bool(static_cast<bool> (in.get_mtime()));
return OB_SUCCESS;
}
示例9: bool_float
static int bool_float(const ObObjCastParams ¶ms, const ObExprObj &in, ObExprObj &out)
{
UNUSED(params);
OB_ASSERT(in.get_type() == ObBoolType);
out.set_float(static_cast<float> (in.get_bool()));
return OB_SUCCESS;
}
示例10: int_datetime
static int int_datetime(const ObObjCastParams ¶ms, const ObExprObj &in, ObExprObj &out)
{
UNUSED(params);
OB_ASSERT(in.get_type() == ObIntType);
out.set_datetime(static_cast<ObDateTime> (in.get_int()));
return OB_SUCCESS;
}
示例11: bool_ctime
static int bool_ctime(const ObObjCastParams ¶ms, const ObExprObj &in, ObExprObj &out)
{
UNUSED(params);
OB_ASSERT(in.get_type() == ObBoolType);
out.set_ctime(static_cast<ObCreateTime> (in.get_bool()));
return OB_SUCCESS;
}
示例12: int_varchar
static int int_varchar(const ObObjCastParams ¶ms, const ObExprObj &in, ObExprObj &out)
{
int ret = OB_SUCCESS;
UNUSED(params);
OB_ASSERT(in.get_type() == ObIntType);
ret = varchar_printf(out, "%ld", in.get_int());
return ret;
}
示例13: int_decimal
static int int_decimal(const ObObjCastParams ¶ms, const ObExprObj &in, ObExprObj &out)
{
UNUSED(params);
OB_ASSERT(in.get_type() == ObIntType);
ObNumber num;
num.from(in.get_int());
out.set_decimal(num); // @todo optimize
return OB_SUCCESS;
}
示例14: mtime_decimal
static int mtime_decimal(const ObObjCastParams ¶ms, const ObExprObj &in, ObExprObj &out)
{
UNUSED(params);
OB_ASSERT(in.get_type() == ObModifyTimeType);
ObNumber num;
num.from(static_cast<int64_t> (in.get_mtime()));
out.set_decimal(num);
return OB_SUCCESS;
}
示例15: datetime_varchar
static int datetime_varchar(const ObObjCastParams ¶ms, const ObExprObj &in, ObExprObj &out)
{
int ret = OB_SUCCESS;
UNUSED(params);
OB_ASSERT(in.get_type() == ObDateTimeType);
time_t t = static_cast<time_t> (in.get_datetime());
struct tm gtm;
localtime_r(&t, >m);
ret = varchar_printf(out, "%04d-%02d-%02d %02d:%02d:%02d",
gtm.tm_year + 1900, gtm.tm_mon + 1, gtm.tm_mday,
gtm.tm_hour, gtm.tm_min, gtm.tm_sec);
return ret;
}