#include "Stroika/Foundation/StroikaPreComp.h"#include "Stroika/Foundation/Traversal/Iterable.h"#include "Stroika/Foundation/Traversal/Iterator.h"#include "Generator.inl"Go to the source code of this file.
Namespaces | |
| namespace | Stroika::Foundation |
Functions | |
| template<typename T > | |
| Iterator< T > | Stroika::Foundation::Traversal::CreateGeneratorIterator (const function< optional< T >()> &getNext) |
| template<typename T > | |
| Iterable< T > | Stroika::Foundation::Traversal::CreateGenerator (const function< optional< T >()> &getNext) |
| Create an Iterable<T> from a function that returns optional<T> - treating nullopt as meaning the END of iteration. | |
TODO:
"Writeup details on how todo generator � as lambda-from-iteator � like I did for
revision with queie and lambdas � except we have we construct new object with
updstream-get-lambda and pass it to downstream one. I think that works. Try draft�."
I'm now not quite sure what that means. This may have been more for the FunctionApplicaiton module?
But keep for a little bit to see if it makes sense when I review this code later...
-- LGP 2013-10-14
Definition in file Generator.h.
| Iterator< T > Stroika::Foundation::Traversal::CreateGeneratorIterator | ( | const function< optional< T >()> & | getNext | ) |
Note - if you need to maintain context for the iterator (typically yes) - bind it into the std::function lambda closure (with smart pointers).
Definition at line 14 of file Generator.inl.
| Iterable< T > Stroika::Foundation::Traversal::CreateGenerator | ( | const function< optional< T >()> & | getNext | ) |
Create an Iterable<T> from a function that returns optional<T> - treating nullopt as meaning the END of iteration.
Note - if you need to maintain context for the iterator (typically yes) - bind it into the std::function lambda closure (with smart pointers).
Definition at line 55 of file Generator.inl.