https://www.liblfds.org/mediawiki/index.php?title=r7.1.0:Function_lfds710_btree_au_query&feed=atom&action=historyr7.1.0:Function lfds710 btree au query - Revision history2024-03-29T12:51:55ZRevision history for this page on the wikiMediaWiki 1.36.0https://www.liblfds.org/mediawiki/index.php?title=r7.1.0:Function_lfds710_btree_au_query&diff=673&oldid=prevAdmin at 17:24, 30 May 20162016-05-30T17:24:08Z<p></p>
<p><b>New page</b></p><div>{{DISPLAYTITLE:function lfds710_btree_au_query}}<br />
==Source Files==<br />
└───liblfds710<br />
├───inc<br />
│ └───liblfds710<br />
│ lfds710_btree_addonly_unbalanced.h<br />
└───src<br />
└───lfds710_btree_addonly_unbalanced<br />
lfds710_btree_addonly_unbalanced_query.c<br />
<br />
==Opaque Structures==<br />
struct [[r7.1.0:struct lfds710_btree_au_state|lfds710_btree_au_state]];<br />
<br />
==Enums==<br />
enum [[r7.1.0:enum lfds710_btree_au_query|lfds710_btree_au_query]]<br />
{<br />
LFDS710_BTREE_AU_QUERY_GET_POTENTIALLY_INACCURATE_COUNT,<br />
LFDS710_BTREE_AU_QUERY_SINGLETHREADED_VALIDATE<br />
};<br />
<br />
==Prototype==<br />
void lfds710_btree_au_query( struct lfds710_btree_au_state *baus,<br />
enum lfds710_btree_au_query query_type,<br />
void *query_input,<br />
void *query_output );<br />
<br />
==Parameters==<br />
''struct lfds710_btree_au_state *baus''<br />
: A pointer to an initialized ''struct lfds710_btree_au_state''.<br />
<br />
''enum lfds710_btree_au_query query_type''<br />
: Indicates which query to perform.<br />
<br />
''void *query_input''<br />
: A pointer to input data for the query, where the data varies by query;<br />
:: ''LFDS710_BTREE_AU_QUERY_GET_POTENTIALLY_INACCURATE_COUNT''<br />
::: ''query_input'' is NULL.<br />
:: ''LFDS710_BTREE_AU_QUERY_SINGLETHREADED_VALIDATE''<br />
::: This argument can be NULL, or can be a pointer to a ''struct lfds710_liblfds_validation_info'', which specifies an expected min/max count, in which case validation also counts the number of elements and check they fall within the specified range. The walk is thread-safe, the count is not. See Notes.<br />
<br />
''void *query_output''<br />
: A pointer to output store for the query, where the output varies by query; <br />
:: ''LFDS710_BTREE_AU_QUERY_GET_POTENTIALLY_INACCURATE_COUNT''<br />
::: Points to a ''lfds710_pal_uint_t'', which is set to the number of elements in the tree.<br />
:: ''LFDS710_BTREE_AU_QUERY_SINGLETHREADED_VALIDATE''<br />
::: Points to an enum ''[[r7.1.0:enum lfds710_misc_validity|lfds710_misc_validity]]'', which is set to indicate the result of the validation operation.<br />
<br />
==Notes==<br />
All ''SINGLETHREADED'' queries can only be safely performed if no insert operations occur while the operation runs. If insert operations do occur during the execution of a ''SINGLETHREADED'' query, it is theoretically possible for the query to enter an infinite loop or to access random memory. Do not do this.<br />
<br />
The ''LFDS710_BTREE_AU_QUERY_GET_POTENTIALLY_INACCURATE_COUNT'' query is non-atomic and walks the tree, counting elements; if new element are added during the count walk, they may not be seen. As such, the count is potentially inaccurate.<br />
<br />
==See Also==<br />
* [[r7.1.0:Binary Tree (add-only, unbalanced)|Binary Tree (add-only, unbalanced)]]</div>Admin