Am 10.12.2013 22:36, schrieb Axel Dörfler:
On 12/10/2013 09:37 PM, Stephan Aßmus wrote:I am thinking of breaking out the TextDocumentView stuff from HaikuDepot into its own static library, similar to libicon.a, but not linked into libbe.so. I have one utility class in HaikuDepot which is used by the text stuff, List.h. We have a few similar classes like this one in the code. Ingo's headers/private/userlandfs/shared/Vector.h is an example. Markus' headers/private/media/TList.h is another. We should probably merge those at some point.That sounds like a perfect GCI task, btw.
Merging APIs and features, perhaps. But adjusting callers could be difficult with potential to overlook subtle side-effects of differing implementations...
I don't know if I have (or want to spend) the time to do this work. But assuming the first step would be to just merge what is nice about these different classes into one headers/private/shared/List.h... what to people like and dislike in a List<T> API and implemenation? Any comments on Ingo's Vector.h and my List.h in particular?Vector.h: seems to duplicate the STL's ugly API. Looks like it could be dropped in favor of std::vector. TList.h: very simplistic implementation, API mixes iterator and list. List.h: looks like the best candidate of the lot, I have no complaints there.
But don't you think an Iterator interface is nice as well? Alternatively, one should at least offer the Visitor pattern, no?
I'll try to have a look at the text API at a later time.
Thanks! Best regards, -Stephan