diff options
author | David Robillard <d@drobilla.net> | 2014-09-24 23:47:11 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2014-09-24 23:47:11 +0000 |
commit | aa7e97885285fc79b2bf35941dd428c7515c13bb (patch) | |
tree | 3b7f82ae139dce4205442b43e3b2b16b03435289 /sord/sord.h | |
parent | 851d093f3942eacec533a64d718b362a83f74e78 (diff) | |
download | sord-aa7e97885285fc79b2bf35941dd428c7515c13bb.tar.gz sord-aa7e97885285fc79b2bf35941dd428c7515c13bb.tar.bz2 sord-aa7e97885285fc79b2bf35941dd428c7515c13bb.zip |
Add sord_erase() for erasing statements via an iterator.
git-svn-id: http://svn.drobilla.net/sord/trunk@310 3d64ff67-21c5-427c-a301-fe4f08042e5a
Diffstat (limited to 'sord/sord.h')
-rw-r--r-- | sord/sord.h | 17 |
1 files changed, 16 insertions, 1 deletions
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,13 +453,26 @@ 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 @{ |