<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to RetrieveDataLength Method</title><link>https://sourceforge.net/p/perfcache/wiki/RetrieveDataLength%2520Method/</link><description>Recent changes to RetrieveDataLength Method</description><atom:link href="https://sourceforge.net/p/perfcache/wiki/RetrieveDataLength%20Method/feed" rel="self"/><language>en</language><lastBuildDate>Thu, 15 Dec 2011 19:25:07 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/perfcache/wiki/RetrieveDataLength%20Method/feed" rel="self" type="application/rss+xml"/><item><title>WikiPage RetrieveDataLength Method modified by Glenn Hofford</title><link>https://sourceforge.net/p/perfcache/wiki/RetrieveDataLength%2520Method/</link><description>&lt;pre&gt;--- v1 
+++ v2 
@@ -18,36 +18,25 @@
 
     1) szKey or wszKey: the key
 
-    2) pbData: a pointer to a buffer of bytes that will be inserted into the cache.
-
-    3) cbData: a count of bytes of the data. This value does not necessarily need to include
-       space for a trailing NULL. Exactly cbData bytes of the buffer pointed to by pbData
-       will be stored in the cache.
-
-    4) numSecondsTTL: number of seconds for the "time-to-live" value.
-
-&lt;br /&gt;
+    2) pcbData: pointer to a variable that on return will contain the exact number of bytes of the data that is stored in the cache entry.
+
+&lt;br /&gt;
 ###### Return values:######
 
       E_KEY_INVALIDKEYTYPE
       E_INVALID_KEYVALUE
       E_KEY_NOTFOUND
       E_CACHE_RETRIEVE_ENTRY_MARKED_FOR_DELETION
       E_CACHE_RETRIEVE_ENTRY_IS_EXPIRED
       E_SUCCESS
 
 &lt;br /&gt;
 ###### Remarks:######
 
-The RetrieveDataLength() method 
-
-RetrieveDataLength() retrieves the length of a cache entry's Document field's
-data, in bytes. This function includes internal synchronization; it performs a
-directory lookup followed by a retrieval of the data length field from the
-cache entry's Document member field.
-
 If the original data that was inserted into the cache had contained a null terminator
 byte, the count returned in *pcbData will include space for this trailing byte.
+
+RetrieveDataLength() includes internal synchronization; it performs a directory lookup followed by a retrieval of the data length field from the cache entry's Document member field.
 
 If the key is not found (E_KEY_NOTFOUND), RetrieveDataLength() will increment 
 the global miss count. However, if the key is found and the function is successful,
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Glenn Hofford</dc:creator><pubDate>Thu, 15 Dec 2011 19:25:07 -0000</pubDate><guid>https://sourceforge.netccfa44899ed775b8c276ee9212dc08a21135d1fe</guid></item><item><title>WikiPage RetrieveDataLength Method modified by Glenn Hofford</title><link>https://sourceforge.net/p/perfcache/wiki/RetrieveDataLength%2520Method/</link><description>##### Method: Cache::RetrieveDataLength #####

###### Summary: ######

RetrieveDataLength() retrieves the length in bytes of a cache entry's Document field's data.

&lt;br /&gt;
###### Syntax: ######

    int RetrieveDataLength (const QBYTE *szKey,
                            size_t *pcbData);

    int RetrieveDataLength (const QWORD *wszKey,
                            size_t *pcbData);

&lt;br /&gt;
###### Parameters:######

    1) szKey or wszKey: the key

    2) pbData: a pointer to a buffer of bytes that will be inserted into the cache.

    3) cbData: a count of bytes of the data. This value does not necessarily need to include
       space for a trailing NULL. Exactly cbData bytes of the buffer pointed to by pbData
       will be stored in the cache.

    4) numSecondsTTL: number of seconds for the "time-to-live" value.

&lt;br /&gt;
###### Return values:######

      E_KEY_INVALIDKEYTYPE
      E_INVALID_KEYVALUE
      E_KEY_NOTFOUND
      E_CACHE_RETRIEVE_ENTRY_MARKED_FOR_DELETION
      E_CACHE_RETRIEVE_ENTRY_IS_EXPIRED
      E_SUCCESS

&lt;br /&gt;
###### Remarks:######

The RetrieveDataLength() method 

RetrieveDataLength() retrieves the length of a cache entry's Document field's
data, in bytes. This function includes internal synchronization; it performs a
directory lookup followed by a retrieval of the data length field from the
cache entry's Document member field.

If the original data that was inserted into the cache had contained a null terminator
byte, the count returned in *pcbData will include space for this trailing byte.

If the key is not found (E_KEY_NOTFOUND), RetrieveDataLength() will increment 
the global miss count. However, if the key is found and the function is successful,
the global hit count is not incremented, since a successful call to RetrieveDataLength()
is normally followed by a call to Retrieve().

RetrieveDataLength() does not modify Replacement metadata (e.g. LRU, LFU).

&lt;br /&gt;
###### Example ######

    size_t cbData = 0;

    int iResult = pCache-&gt;RetrieveDataLength ((const QBYTE *) "AAA", // key
                                              &amp;cbData);
    if (iResult != E_SUCCESS)
    {
        // error handling here
    }
</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Glenn Hofford</dc:creator><pubDate>Thu, 15 Dec 2011 19:21:29 -0000</pubDate><guid>https://sourceforge.netbc9f26bc41d7eb5db4c08cb545ff1b531d966d3b</guid></item></channel></rss>