diff options
Diffstat (limited to 'src/emu/devfind.h')
-rw-r--r-- | src/emu/devfind.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/emu/devfind.h b/src/emu/devfind.h index fef6843029e..1fe2ed78439 100644 --- a/src/emu/devfind.h +++ b/src/emu/devfind.h @@ -508,6 +508,8 @@ template <class DeviceClass, bool Required> class device_finder : public object_finder_base<DeviceClass, Required> { public: + using object_finder_base<DeviceClass, Required>::set_tag; + /// \brief Device finder constructor /// \param [in] base Base device to search from. /// \param [in] tag Device tag to search for. This is not copied, @@ -515,6 +517,16 @@ public: /// remains valid until resolution time. device_finder(device_t &base, char const *tag) : object_finder_base<DeviceClass, Required>(base, tag) { } + /// \brief Set search tag + /// + /// Allows search tag to be changed after construction. Note that + /// this must be done before resolution time to take effect. Note + /// that this binds to a particular instance, so the device must not + /// be removed or replaced, as it will cause a use-after-free when + /// resolving objects. + /// \param [in] object Object to refer to. + void set_tag(DeviceClass &object) { set_tag(object, DEVICE_SELF); } + /// \brief Set target during configuration /// /// During configuration, device_finder instances may be assigned |