summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/debug/dvmemory.cpp
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2016-04-18 18:53:28 -0400
committer AJR <ajrhacker@users.noreply.github.com>2016-04-18 18:53:28 -0400
commit084d3654ca14a79d9ec173bad4ddf00ad0fb5a7f (patch)
tree197ae37b68f3169048fb3cadf6947353315f3608 /src/emu/debug/dvmemory.cpp
parent55d3e544e013174880c8f208264683aac6d711f9 (diff)
Iterate over devices C++11 style
Replace the old device_iterator and its specialized versions with functionally equivalent classes that use standard operators to yield references to devices/interfaces rather than pointers. With range-based for loops, they no longer have to be stored in named variables, though they can also be reused concurrently since the iteration state is now maintained by a subclass. Add a few more typical getters to device_t::subdevice_list.
Diffstat (limited to 'src/emu/debug/dvmemory.cpp')
-rw-r--r--src/emu/debug/dvmemory.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/emu/debug/dvmemory.cpp b/src/emu/debug/dvmemory.cpp
index 8efaa22ef9a..0724f9fa27d 100644
--- a/src/emu/debug/dvmemory.cpp
+++ b/src/emu/debug/dvmemory.cpp
@@ -135,14 +135,13 @@ void debug_view_memory::enumerate_sources()
std::string name;
// first add all the devices' address spaces
- memory_interface_iterator iter(machine().root_device());
- for (device_memory_interface *memintf = iter.first(); memintf != nullptr; memintf = iter.next())
- if (&memintf->device() != &machine().root_device())
+ for (device_memory_interface &memintf : memory_interface_iterator(machine().root_device()))
+ if (&memintf.device() != &machine().root_device())
for (address_spacenum spacenum = AS_0; spacenum < ADDRESS_SPACES; ++spacenum)
- if (memintf->has_space(spacenum))
+ if (memintf.has_space(spacenum))
{
- address_space &space = memintf->space(spacenum);
- name = string_format("%s '%s' %s space memory", memintf->device().name(), memintf->device().tag(), space.name());
+ address_space &space = memintf.space(spacenum);
+ name = string_format("%s '%s' %s space memory", memintf.device().name(), memintf.device().tag(), space.name());
m_source_list.append(*global_alloc(debug_view_memory_source(name.c_str(), space)));
}