52a53
> #include <functional>
243,246c244,248
< /**
< * @todo Implement as in lru. Currently not used
< */
< virtual std::string print() const override { return ""; }
---
> void forEachBlk(std::function<void(CacheBlk &)> visitor) override {
> for (int i = 0; i < numBlocks; i++) {
> visitor(blks[i]);
> }
> }
248,260c250
< /**
< * Visit each block in the tag store and apply a visitor to the
< * block.
< *
< * The visitor should be a function (or object that behaves like a
< * function) that takes a cache block reference as its parameter
< * and returns a bool. A visitor can request the traversal to be
< * stopped by returning false, returning true causes it to be
< * called for the next block in the tag store.
< *
< * \param visitor Visitor to call on each block.
< */
< void forEachBlk(CacheBlkVisitor &visitor) override {
---
> bool anyBlk(std::function<bool(CacheBlk &)> visitor) override {
262,263c252,254
< if (!visitor(blks[i]))
< return;
---
> if (visitor(blks[i])) {
> return true;
> }
264a256
> return false;