本文整理汇总了C++中DataObjectRef::getOrigDataLen方法的典型用法代码示例。如果您正苦于以下问题:C++ DataObjectRef::getOrigDataLen方法的具体用法?C++ DataObjectRef::getOrigDataLen怎么用?C++ DataObjectRef::getOrigDataLen使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataObjectRef
的用法示例。
在下文中一共展示了DataObjectRef::getOrigDataLen方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: string
/*
* Returns true iff
*/
bool
CacheStrategyUtility::isResponsibleForDataObject(
DataObjectRef &dObj)
{
string id = string(dObj->getIdStr());
/*
// THIS IS NOT THREAD SAFE!! added getOrigSize
// to grab unaltered file size.
if (utilMetadata.find(id) != utilMetadata.end()) {
return true;
}
*/
if (dObj->isDuplicate()) {
return false;
}
// SW: TODO: NOTE: this might not be the best way to check if it's from
// a local application, but it works for now...
bool isLocal = dObj->getRemoteInterface() && dObj->getRemoteInterface()->isApplication();
bool notResponsible = dObj->isControlMessage() || dObj->isNodeDescription();
bool isResponsible = !notResponsible;
if (!handle_zero_size) {
isResponsible = isResponsible && (dObj->getOrigDataLen() > 0);
}
if (!manage_locally_sent_files) {
isResponsible = isResponsible && dObj->isPersistent();
}
if (stats_replacement_strat && stats_replacement_strat->isResponsibleForDataObject(dObj)) {
isResponsible = true;
} else if (manage_only_remote_files) {
isResponsible = isResponsible && !isLocal;
}
return isResponsible;
}