#ifndef CONTAINERITERATOR_H #define CONTAINERITERATOR_H #include #include #include "objectRowState.h" template class ContainerIterator : public IHaveSubTasks { public: ContainerIterator(const T * con) : SourceObject(__PRETTY_FUNCTION__), IHaveSubTasks(NULL), binder(boost::bind(&BindColumns, _1, _2)), container(con) { } void execute(ExecContext * ec) const { ObjectRowState rs; BOOST_FOREACH(const auto & i, *container) { binder(rs, i); rs.process(boost::bind(&ContainerIterator::executeChildren, this, ec)); } } private: boost::function binder; const T * container; void executeChildren(ExecContext * ec) const { BOOST_FOREACH(const Tasks::value_type & sq, normal) { sq->execute(ec); } } }; #endif