[out] Cached value. If the value is not valid, then the value of this parameter is undefined.
CCacheEntry<T>::GetValue
Retrieves the value of a cache entry.
Syntax
Section titled “Syntax”bool CCacheEntry<T>::GetValue(T* pValue) const;Parameters
Section titled “Parameters”pValue
Return value
Section titled “Return value”Returns true if the value is in the cache and is valid, otherwise false.
Example
Section titled “Example”The following example demonstrates use of the GetValue function.
STDMETHODIMP Acme4321::get_Bandwidth(double* val){ HRESULT hr = S_OK;
// Retrieve the cache entry for the Bandwidth property CCacheEntry<double>* pEntry = GetOrCreateCacheEntry<double>(_T("IAcme4321.Bandwidth"));
// If the value is in the cache AND is valid, retrieve the value and return if (pEntry->GetValue(val)) return S_OK;
// If we get this far, then the cached value is not valid, so we // must communicate with the instrument to retrieve the value hr = InstrQueryCommand(val);
return hr;}