Click or drag to resize

GetCacheEntry Function

Retrieves a CacheEntry structure for the specified attribute on the specific repeated capability physical name.

template <typename T>
CacheEntry<T>& GetCacheEntry(ViSession Vi, ViAttr attributeId, const std::string& strQualifiedPhysicalName = std::string());
Parameters
Vi

[in] ViSession handle for the driver session.

attributeId

[in] The attribute ID of the cache entry to retrieve (e.g. ACME4321_ATTR_BANDWIDTH).

strQualifiedPhysicalName

[in] The qualified repeated capability physical name of the cache entry to retrieve for the specified attribute (e.g. Channel!!CH1). This parameter should be specified for attributes associated with a repeated capability. Note that the qualified physical name must always be used, even if the repeated capability associated with the attribute has not been configured to use qualified physical names via the Driver Settings Editor.

Return Value

The cache entry associated with the specified attribute ID and repeated capability physical name.

Remarks

This function is used in scenarios where the driver developer wishes to take direct control over the state caching functionality of the driver for specific attributes.

Example

The following example demonstrates use of the GetCacheEntry function.

C++
ViStatus _VI_FUNC acme4321_Configure(ViSession Vi, ViReal64 Frequency, ViReal64 Gain)
{
    auto status = VI_SUCCESS;

    // Retrieve the cache entry for the Bandwidth attribute
    // 
    auto& entry = GetCacheEntry<ViReal64>(Vi, ACME4321_ATTR_BANDWIDTH);

    if (entry.IsValid())
    {
        // ...
    }

    return status;
}

Download a complete CHM version of this documentation here.