mirror of
https://github.com/holub/mame
synced 2025-06-06 12:53:46 +03:00

* Updated sol2 to 3.2.2 * Updated pugixml to 1.10 * Increased minimum clang version to 6 * Cleaned up some stuff that can use new features
35 lines
813 B
C++
35 lines
813 B
C++
// license:BSD-3-Clause
|
|
// copyright-holders:Aaron Giles, Vas Crabb
|
|
/***************************************************************************
|
|
|
|
devdelegate.cpp
|
|
|
|
Delegates that are late-bound to MAME devices.
|
|
|
|
***************************************************************************/
|
|
|
|
#include "emu.h"
|
|
#include "devdelegate.h"
|
|
|
|
|
|
namespace emu::detail {
|
|
|
|
delegate_late_bind &device_delegate_helper::bound_object() const
|
|
{
|
|
if (!m_tag)
|
|
return m_base.get();
|
|
device_t *const device(m_base.get().subdevice(m_tag));
|
|
if (!device)
|
|
throw emu_fatalerror("Unable to locate device '%s' relative to '%s'\n", m_tag, m_base.get().tag());
|
|
return *device;
|
|
}
|
|
|
|
|
|
void device_delegate_helper::set_tag(char const *tag)
|
|
{
|
|
m_base = m_base.get().mconfig().current_device();
|
|
m_tag = tag;
|
|
}
|
|
|
|
} // namespace emu::detail
|