http://en.wikipedia.org/wiki/Iterator_pattern
Iterators are an abstraction. They are a way of iterating and accessing various elements in a data structure without having to couple your code to that data structure's particular implementation. You are right (to some degree) that you can't use your languages iterators to traverse your octree but you can use your language's common iterator interface to make your octree conform to the API (IEnumerator iand IEnumerable and their generic equivalents in C# are examples of this pattern).
Show differencesHistory of post edits
#1M6dEEp
Posted 08 June 2012 - 05:02 PM
http://en.wikipedia.org/wiki/Iterator_pattern
Iterators are an abstraction. They are a way of iterating and accessing various elements in a data structure without having to couple your code to that data structure's particular implementation. You are right (to some degree) that you can't use your languages iterators to traverse your octree but you can use your language's common iterator interface to make your octree conform to the API (IEnumerator iand IEnumerable and their generic equivalents in C# are examples of this pattern).
Iterators are an abstraction. They are a way of iterating and accessing various elements in a data structure without having to couple your code to that data structure's particular implementation. You are right (to some degree) that you can't use your languages iterators to traverse your octree but you can use your language's common iterator interface to make your octree conform to the API (IEnumerator iand IEnumerable and their generic equivalents in C# are examples of this pattern).