本文整理汇总了C++中DBC::get_priority方法的典型用法代码示例。如果您正苦于以下问题:C++ DBC::get_priority方法的具体用法?C++ DBC::get_priority怎么用?C++ DBC::get_priority使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DBC
的用法示例。
在下文中一共展示了DBC::get_priority方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: rberkeley_dbcursor_get_priority
/* {{{ rberkeley_dbcursor_get_priority */
SEXP rberkeley_dbcursor_get_priority (SEXP _dbc)
{
DBC *dbc;
DB_CACHE_PRIORITY priority;
int ret;
dbc = R_ExternalPtrAddr(_dbc);
if(R_ExternalPtrTag(_dbc) != install("DBC") || dbc == NULL)
error("invalid 'dbc' handle");
ret = dbc->get_priority(dbc, &priority);
if(ret != 0)
return ScalarInteger(ret);
switch(priority) {
case DB_PRIORITY_VERY_LOW:
return mkString("DB_PRIORITY_VERY_LOW");
break;
case DB_PRIORITY_LOW:
return mkString("DB_PRIORITY_LOW");
break;
case DB_PRIORITY_DEFAULT:
return mkString("DB_PRIORITY_DEFAULT");
break;
case DB_PRIORITY_HIGH:
return mkString("DB_PRIORITY_HIGH");
break;
case DB_PRIORITY_VERY_HIGH:
return mkString("DB_PRIORITY_VERY_HIGH");
break;
default:
return R_NilValue;
}
}
示例2: rberkeley_db_get_priority
/* {{{ rberkeley_db_get_priority */
SEXP rberkeley_db_get_priority (SEXP _dbp)
{
error("DB->get_priority is unavailable from R");
DBC *dbp;
DB_CACHE_PRIORITY priority;
int ret;
dbp = R_ExternalPtrAddr(_dbp);
if(R_ExternalPtrTag(_dbp) != RBerkeley_DB || dbp == NULL)
error("invalid 'db' handle");
/* something is wrong with this call... */
ret = dbp->get_priority(dbp, &priority);
if(ret != 0)
return ScalarInteger(ret);
switch(priority) {
case DB_PRIORITY_VERY_LOW:
return mkString("DB_PRIORITY_VERY_LOW");
break;
case DB_PRIORITY_LOW:
return mkString("DB_PRIORITY_LOW");
break;
case DB_PRIORITY_DEFAULT:
return mkString("DB_PRIORITY_DEFAULT");
break;
case DB_PRIORITY_HIGH:
return mkString("DB_PRIORITY_HIGH");
break;
case DB_PRIORITY_VERY_HIGH:
return mkString("DB_PRIORITY_VERY_HIGH");
break;
default:
return R_NilValue;
}
}