Re: [Tracker] REVIEW: external-crawler branch, part2



On 08/08/14 09:09, Philip Van Hoof wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

87c30cc73629ff54ff8e5170ded499c2cbbda61a

About TrackerEnumeratorIface:

In my opinion an enumerator has a Next() method to enumerate to the
next element. I think it's a bit wierd to return a linked list on
Start() of the enumerator API.

You can find examples of enumerators in Gee, Java (called Iterator
there), .NET and also in libtracker-sparql, in boost for C++, etc.

I think in GIO you also have Enumerators that work like this, and in
GVariant Ryan also has enumerator APIs that work this way.

I think TrackerEnumerator should be renamed if the API doesn't work
with a Next() call like how all other enumerator APIs in the world work.

Note that in a typical enumerator design the Start method comes from
the thing that is enumerable.


Enumerable thingThatHasItems = new List();
Enumerable e = thingThatHasItems.Enumerate();
Value v;

while (e.Next(&v))
{
}

After your (and Sam's) comments on this, I am going to do that.
Thanks for the input here guys.

--
Regards,
Martyn

Founder & Director @ Lanedo GmbH.
http://www.linkedin.com/in/martynrussell


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]