← Back to team overview

geda-developers team mailing list archive

Re: [RFC] edaobjectset.h (was: libgeda data structures and algorithms)

 

On Wednesday 19 December 2012 00:23:30 Peter Clifton wrote:
> On Wed, 2012-12-19 at 00:00 +0100, Ivan Stankovic wrote:
> The above might lead to a simplifying assumption, that we cannot allow
> more than one active iterator into the set at a time. (If not, the
> remove call needs to manage "fixing up" all active iterators,
> otherwise it becomes limitless how much data we need to store, or
> keep referenced from inside each iterator.)

The usual approach is that modification of the collection increments a 
private "stamp" variable. Each iterator also contains a stamp value, and 
is only valid if the stamps match. Effectively, iterators only remain 
valid until the collection is modified. (But the iterator used in the 
modification is updated, so it remains valid).

Once again: why oh why doesn't GLib provide managed set/list data types?

                               Peter

-- 
Peter Brett <peter@xxxxxxxxxxxxx>
Remote Sensing Research Group
Surrey Space Centre

Attachment: signature.asc
Description: This is a digitally signed message part.


References