Iterator

Implementation of an iterator that goes thru a Component and all its sub-components in a tree (pre-order) traversal. A test case that demonstrates the usage is also included, along with wrapping to make these iterators accessible from scripting..
Sherm,

I changed the inheritance and the code compiles, how do I test that it's
working?

Thanks,
-Ayman

On Sun, Nov 16, 2014 at 7:11 PM, Michael Sherman <notifications@github.com>
wrote:

> In OpenSim/Common/ComponentList.h:
>
> > + * any Component).
> > + * This iterator is const_iterator as it returns only const ref or pointer upon
> > + * dereferencing.
> > + * This iterator works only in forward direction (not bidirectional)
> > + * Only preIncrement (++iter) syntax is supported.
> > + *
> > + * Use as:
> > +@code
> > +ComponentList<GeometryPath> geomPathList = model.getComponentList<GeometryPath>();
> > +for (const GeometryPath& gpath : geomPathList) {
> > +    // do something with gpath
> > +}
> > +@endcode
> > +*/
> > +template <typename T>
> > +class ComponentListIterator {
>
> Consider deriving this from std::iterator<std::forward_iterator_tag, ...>.
> That would permit STL methods like std::advance() to operate correctly on
> this kind of iterator. Alternatively, file an issue that
> ComponentListIterator doesn't satisfy the C++ iterator interface and we can
> just make that a future project for someone.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/opensim-org/opensim-core/pull/235/files#r20417017>.
>