mirror of
https://github.com/mmueller41/genode.git
synced 2026-01-21 12:32:56 +01:00
base: Added helper function for iterating over an affinity location.
This commit is contained in:
@@ -166,6 +166,15 @@ class Genode::Affinity
|
||||
node.attribute_value("height", default_height));
|
||||
}
|
||||
|
||||
template<typename FUNC>
|
||||
void for_each(const FUNC &fn) {
|
||||
for (unsigned y = _ypos; y < _ypos + height(); y++) {
|
||||
for (unsigned x = _xpos; x < _xpos+_width; x++) {
|
||||
fn(Genode::Affinity::Location(x, y, _width, _height));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user