/* It should be used just for dense chunks. For iterate over materialized chunk (sparse algorithm) please use DelegateChunkIteator. */ template< typename Walker, typename Reader > class DenseChunkIteratorTile : public ConstChunkIterator { private: typedef DenseChunkIteratorTile User; typedef TileWriter Writer; typedef WalkerError WE; typedef TileError TE; friend class MessageBuilder; private: RepartChunk const& _repartChunk; RepartArraySettings const& _sourceArray; RepartChunkSettings _sourceChunk; RepartChunkSettings const _resultChunk; Coordinates _source; position_t _sourceSkip; position_t _sourceLeft; Coordinates _result; position_t _resultSkip; position_t _resultLeft; Coordinates _sourceChunkPosition; bool _sourceChunkEmpty; int const _mode; bool _has; bool _next; Walker _walker; WE _walkerError; Reader _reader; TE _readerError; Writer _writer; TE _writerError; public: DenseChunkIteratorTile(RepartChunk const& chunk, boost::shared_ptr data, const int mode) : _repartChunk(chunk), _sourceArray(_repartChunk.source), _sourceChunk(_sourceArray, _repartChunk.sourceOverlap), _resultChunk(_repartChunk.result, !(mode & ConstChunkIterator::IGNORE_OVERLAPS), _repartChunk), _source(_sourceArray.n), _result(_resultChunk.n), _mode(_resultChunk.mode(mode)), _has(false), _next(false), _walker(&_walkerError, data, _sourceChunk.mode(mode)), _walkerError(*this), _reader(&_readerError), _readerError(*this, _reader), _writer(&_writerError), _writerError(*this, _writer) { _reset(); } DenseChunkIteratorTile(RepartChunk const& chunk, boost::shared_ptr bitmap, boost::shared_ptr data, TypeId const& dataType, const int mode) : _repartChunk(chunk), _sourceArray(_repartChunk.source), _sourceChunk(_sourceArray, _repartChunk.sourceOverlap), _resultChunk(_repartChunk.result, !(mode & ConstChunkIterator::IGNORE_OVERLAPS), _repartChunk), _source(_sourceArray.n), _result(_resultChunk.n), _mode(_resultChunk.mode(mode)), _has(false), _next(false), _walker(&_walkerError, bitmap, data, _sourceChunk.mode(mode)), _walkerError(*this), _reader(&_readerError, dataType), _readerError(*this, _reader), _writer(&_writerError, dataType), _writerError(*this, _writer) { _reset(); }