add hash iterator functions to access the pointer to the value.
This commit is contained in:
@@ -62,6 +62,7 @@ EdgeHashIterator *BLI_edgehashIterator_new(EdgeHash *eh) ATTR_MALLOC ATTR_WARN
|
||||
void BLI_edgehashIterator_free(EdgeHashIterator *ehi);
|
||||
void BLI_edgehashIterator_getKey(EdgeHashIterator *ehi, unsigned int *v0_r, unsigned int *v1_r);
|
||||
void *BLI_edgehashIterator_getValue(EdgeHashIterator *ehi) ATTR_WARN_UNUSED_RESULT;
|
||||
void **BLI_edgehashIterator_getValue_p(EdgeHashIterator *ehi) ATTR_WARN_UNUSED_RESULT;
|
||||
void BLI_edgehashIterator_setValue(EdgeHashIterator *ehi, void *val);
|
||||
void BLI_edgehashIterator_step(EdgeHashIterator *ehi);
|
||||
bool BLI_edgehashIterator_isDone(EdgeHashIterator *ehi) ATTR_WARN_UNUSED_RESULT;
|
||||
|
@@ -86,6 +86,7 @@ void BLI_ghashIterator_free(GHashIterator *ghi);
|
||||
|
||||
void *BLI_ghashIterator_getKey(GHashIterator *ghi) ATTR_WARN_UNUSED_RESULT;
|
||||
void *BLI_ghashIterator_getValue(GHashIterator *ghi) ATTR_WARN_UNUSED_RESULT;
|
||||
void **BLI_ghashIterator_getValue_p(GHashIterator *ghi) ATTR_WARN_UNUSED_RESULT;
|
||||
|
||||
void BLI_ghashIterator_step(GHashIterator *ghi);
|
||||
bool BLI_ghashIterator_done(GHashIterator *ghi) ATTR_WARN_UNUSED_RESULT;
|
||||
|
@@ -601,6 +601,18 @@ void *BLI_ghashIterator_getValue(GHashIterator *ghi)
|
||||
return ghi->curEntry ? ghi->curEntry->val : NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the value from an iterator.
|
||||
*
|
||||
* \param ghi The iterator.
|
||||
* \return The value at the current index, or NULL if the
|
||||
* iterator is done.
|
||||
*/
|
||||
void **BLI_ghashIterator_getValue_p(GHashIterator *ghi)
|
||||
{
|
||||
return ghi->curEntry ? &ghi->curEntry->val : NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Steps the iterator to the next index.
|
||||
*
|
||||
|
@@ -483,6 +483,14 @@ void *BLI_edgehashIterator_getValue(EdgeHashIterator *ehi)
|
||||
return ehi->curEntry ? ehi->curEntry->val : NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the pointer to the value from an iterator.
|
||||
*/
|
||||
void **BLI_edgehashIterator_getValue_p(EdgeHashIterator *ehi)
|
||||
{
|
||||
return ehi->curEntry ? &ehi->curEntry->val : NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the value for an iterator.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user