当前位置: 首页>>代码示例>>C++>>正文


C++ DataObjectRef::isPersistent方法代码示例

本文整理汇总了C++中DataObjectRef::isPersistent方法的典型用法代码示例。如果您正苦于以下问题:C++ DataObjectRef::isPersistent方法的具体用法?C++ DataObjectRef::isPersistent怎么用?C++ DataObjectRef::isPersistent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DataObjectRef的用法示例。


在下文中一共展示了DataObjectRef::isPersistent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1:

// We intercept the `handleVerifiedDataObject` call to now call
// into the cache strat, if it exists. The cache strat module
// will then call `insertDataObjectIntoDataStore` if the new object
// should be inserted
void
DataManager::insertDataObjectIntoDataStore(DataObjectRef& dObj)
{
    if (!dObj) {
        HAGGLE_ERR ("Trying to insert null data object into DB.\n");
        return;
    }

    // insert into database (including filtering)
    if (dObj->isPersistent ()) {
        kernel->getDataStore ()->insertDataObject (dObj,
            onInsertedDataObjectCallback);
    }
    else {
        // do not expect a callback for a non-persistent data object,
        // but we still call insertDataObject in order to filter the data object.
        kernel->getDataStore ()->insertDataObject (dObj, NULL);
    }
}
开发者ID:SRI-CSL,项目名称:ENCODERS,代码行数:23,代码来源:DataManager.cpp

示例2: 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;
}
开发者ID:SRI-CSL,项目名称:ENCODERS,代码行数:42,代码来源:CacheStrategyUtility.cpp


注:本文中的DataObjectRef::isPersistent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。