本文整理汇总了C++中db::Result::getULongLong方法的典型用法代码示例。如果您正苦于以下问题:C++ Result::getULongLong方法的具体用法?C++ Result::getULongLong怎么用?C++ Result::getULongLong使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类db::Result
的用法示例。
在下文中一共展示了Result::getULongLong方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OSAttribute
OSAttribute *DBObject::accessAttribute(CK_ATTRIBUTE_TYPE type)
{
switch (attributeKind(type))
{
case akUnknown:
return NULL;
case akBoolean:
{
// try to find the attribute in the boolean attribute table
DB::Statement statement = _connection->prepare(
"select value from attribute_boolean where type=%lu and object_id=%lld",
type,
_objectId);
if (!statement.isValid())
{
return NULL;
}
DB::Result result = _connection->perform(statement);
if (!result.isValid())
{
return NULL;
}
// Store the attribute in the transaction when it is active.
std::map<CK_ATTRIBUTE_TYPE,OSAttribute*> *attrs = &_attributes;
if (_transaction)
attrs = _transaction;
bool value = result.getInt(1) != 0;
std::map<CK_ATTRIBUTE_TYPE,OSAttribute*>::iterator it = attrs->find(type);
OSAttribute *attr;
if (it != attrs->end())
{
if (it->second != NULL)
{
delete it->second;
}
it->second = new OSAttribute(value);
attr = it->second;
}
else
{
attr = new OSAttribute(value);
(*attrs)[type] = attr;
}
return attr;
}
case akInteger:
{
// try to find the attribute in the integer attribute table
DB::Statement statement = _connection->prepare(
"select value from attribute_integer where type=%lu and object_id=%lld",
type,
_objectId);
if (!statement.isValid())
{
return NULL;
}
DB::Result result = _connection->perform(statement);
if (!result.isValid())
{
return NULL;
}
// Store the attribute in the transaction when it is active.
std::map<CK_ATTRIBUTE_TYPE,OSAttribute*> *attrs = &_attributes;
if (_transaction)
attrs = _transaction;
unsigned long value = result.getULongLong(1);
std::map<CK_ATTRIBUTE_TYPE,OSAttribute*>::iterator it = attrs->find(type);
OSAttribute *attr;
if (it != attrs->end())
{
if (it->second != NULL)
{
delete it->second;
}
it->second = new OSAttribute(value);
attr = it->second;
}
else
{
attr = new OSAttribute(value);
(*attrs)[type] = attr;
}
return attr;
}
case akBinary:
{
// try to find the attribute in the binary attribute table
DB::Statement statement = _connection->prepare(
"select value from attribute_binary where type=%lu and object_id=%lld",
type,
_objectId);
if (!statement.isValid())
{
return NULL;
}
DB::Result result = _connection->perform(statement);
//.........这里部分代码省略.........