John,
You told that templates are not possible, and i understand that.
But i still need to find a solutions, since all my lists are STL/STD
template based.
Like my main a2dList class is a pure std::list, with some extra members
that return an iterator.
All the other list are derived from that or they are template
instantiations of it.
template<class T>
class a2dlist: public std::list< T, std::allocator<T> >
Has a member like:
typename a2dlist<T>::iterator item(size_t index) {.....}
The smart pointer list is also a2dlist / std::list based.
template<class T>
class a2dSmrtPtrList: public a2dlist< a2dSmrtPtr< T > >
And of those i have many instantiations like this:
class a2dVertexList : public a2dSmrtPtrList< a2dLineSegment >
class a2dCanvasObjectList: public a2dSmrtPtrList<a2dCanvasObject>
This use iterators like:
a2dCanvasObjectList::iterator
a2dCanvasObjectList::const_iterator
So do you have any idea how i best approach this?
Should i for instance best write lua code to generate the template
instantiation in *.i lines code??
Its the iterators that worry me the most :-( What i saw in wxLua looks
like its based on wxList "old fashion" use, where wxNode is not typed.
But my iterator are typed i am afraid.
Is there a sample demo-ing wxList usage?? I think it is weird to use
lists in lua, should be a table. But my data in the document/C++, is all
stored in the type of lists is showed above, and i like to iterate
through them. Maybe i should just make a GetFirst() GetNext() kind of
iteration inside list classes ??
I am very bad in writing lua code, but this will change :-). But for the
moment this makes it a bit difficult to see through all this :-(.
Thanks for any ideas!
Klaas
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
wxlua-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wxlua-users