summaryrefslogtreecommitdiffstats
path: root/sord/sord.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2014-09-24 23:47:11 +0000
committerDavid Robillard <d@drobilla.net>2014-09-24 23:47:11 +0000
commitaa7e97885285fc79b2bf35941dd428c7515c13bb (patch)
tree3b7f82ae139dce4205442b43e3b2b16b03435289 /sord/sord.h
parent851d093f3942eacec533a64d718b362a83f74e78 (diff)
downloadsord-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.h17
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
@{