50a51
> #include <functional>
301,304c302,306
< /**
< * Called at end of simulation to complete average block reference stats.
< */
< void cleanupRefs() override;
---
> void forEachBlk(std::function<void(CacheBlk &)> visitor) override {
> for (CacheBlk& blk : blks) {
> visitor(blk);
> }
> }
306,328c308
< /**
< * Print all tags used
< */
< std::string print() const override;
<
< /**
< * Called prior to dumping stats to compute task occupancy
< */
< void computeStats() override;
<
< /**
< * 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 {
330,331c310,312
< if (!visitor(blk))
< return;
---
> if (visitor(blk)) {
> return true;
> }
332a314
> return false;