bool LocalCapabilitiesDirectory::getLocalAndCachedCapabilities(
    const std::string& participantId,
    const joynr::types::QtDiscoveryQos& discoveryQos,
    QSharedPointer<ILocalCapabilitiesCallback> callback)
{
    joynr::types::QtDiscoveryScope::Enum scope = discoveryQos.getDiscoveryScope();

    std::vector<CapabilityEntry> localCapabilities = searchCache(participantId, -1, true);
    std::vector<CapabilityEntry> globalCapabilities =
        searchCache(participantId, discoveryQos.getCacheMaxAge(), false);

    return callRecieverIfPossible(scope, localCapabilities, globalCapabilities, callback);
}
示例#2
0
char cacheOperation(CacheSet *cacheSets, long address) {
    // Get tag, setIndex, blockOffset values
    long tag = addressTag(address);
    long setIndex = addressSetIndex(address);
    long blockOffset = addressBlockOffset(address);
    
    // Find set, search for line/block
    CacheSet currentSet = cacheSets[setIndex];
    return searchCache(currentSet, tag, setIndex, blockOffset);
}