Re: custom treemodel?



On 5/19/06, Paul Davis <pjdavis engineering uiowa edu> wrote:
I agree with this whole heartedly. If we start making assumptions about
what gets passed to this class, it starts to lose some of its use.
Unless theres a very very good cause for doing so I'd recommend making
any assumptions.

I assume you mean *NOT* making any assumptions :)

Even though we might be thinking of using this to wrap tree models
around STL containers, whats to stop someone from passing it a linked
list of some non-standard format. Or what if we wanted to do something
even simpler and just pass it an NxM dimensional array?

There's not really anything to stop you from passing in a non-standard
container object, other than the fact that the compiler will complain
if it doesn't define a begin() or end() method, or if it doesn't
implement operator++ or something like that (just examples, I don't
know yet exactly which methods will be used in the implementation).
I've been focusing on the standard STL container implementation
because I think that's probably the most common use case.  But
theoretically you could maybe have a couple different custom
treemodels, e.g.:

template <class T>
ContainerTreeModel

and

template <class T, int N, int M>
ArrayTreeModel

or something like that (where N and M are the array dimensions).  It
doesn't seem like there would be much shared functionality between
these two types, but I could be wrong.  I haven't thought about it too
carefully yet.

Looks good so far.  And I sure am glad I'm not the one scratching my
head about virtual inheritance and GObjects...as much fun as it sounds.

heh.  Thanks for your input though.  It's greatly appreciated.

Jonner



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