From aa7e97885285fc79b2bf35941dd428c7515c13bb Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 24 Sep 2014 23:47:11 +0000 Subject: Add sord_erase() for erasing statements via an iterator. git-svn-id: http://svn.drobilla.net/sord/trunk@310 3d64ff67-21c5-427c-a301-fe4f08042e5a --- sord/sord.h | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'sord') diff --git a/sord/sord.h b/sord/sord.h index 5ff9a7b..fda754e 100644 --- a/sord/sord.h +++ b/sord/sord.h @@ -443,6 +443,8 @@ sord_contains(SordModel* model, const SordQuad pat); /** Add a quad to a model. + + Calling this function invalidates all iterators on `model`. */ SORD_API bool @@ -451,12 +453,25 @@ sord_add(SordModel* model, const SordQuad quad); /** Remove a quad from a model. - Note that is it illegal to remove while iterating over `model`. + Calling this function invalidates all iterators on `model`. To remove quads + while iterating, use sord_erase() instead. */ SORD_API void sord_remove(SordModel* model, const SordQuad quad); +/** + Remove a quad from a model via an iterator. + + Calling this function invalidates all iterators on `model` except `iter`. + + @param iter Iterator to the element to erase, which is incremented to the + next value on return. +*/ +SORD_API +SerdStatus +sord_erase(SordModel* model, SordIter* iter); + /** @} @name Inserter -- cgit v1.2.1