mirror of
https://github.com/holub/mame
synced 2025-04-25 09:50:04 +03:00
devcb.h: removed inline configuration macros for devcb; they frighten me
delegate.h: added static creators for static variants as well
This commit is contained in:
parent
68ddfa5066
commit
209e8b8eef
@ -338,13 +338,25 @@ public:
|
||||
_ReturnType operator()(_P1Type p1, _P2Type p2, _P3Type p3) const { return (*m_function)(m_callobject, p1, p2, p3); }
|
||||
_ReturnType operator()(_P1Type p1, _P2Type p2, _P3Type p3, _P4Type p4) const { return (*m_function)(m_callobject, p1, p2, p3, p4); }
|
||||
|
||||
// static stub creator
|
||||
// static stub creators
|
||||
template<class _FunctionClass, typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _P2Type, _P3Type, _P4Type>::member_func_type _Function>
|
||||
static delegate_base static_creator(const char *name)
|
||||
{
|
||||
return delegate_base(_Function, name, (_FunctionClass *)NULL);
|
||||
}
|
||||
|
||||
template<class _FunctionClass, typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _P2Type, _P3Type, _P4Type>::static_func_type _Function>
|
||||
static delegate_base static_creator(const char *name)
|
||||
{
|
||||
return delegate_base(_Function, name, (_FunctionClass *)NULL);
|
||||
}
|
||||
|
||||
template<class _FunctionClass, typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _P2Type, _P3Type, _P4Type>::static_ref_func_type _Function>
|
||||
static delegate_base static_creator(const char *name)
|
||||
{
|
||||
return delegate_base(_Function, name, (_FunctionClass *)NULL);
|
||||
}
|
||||
|
||||
protected:
|
||||
// bind the actual object
|
||||
void bind(delegate_generic_class *object)
|
||||
@ -553,13 +565,25 @@ public:
|
||||
_ReturnType operator()(_P1Type p1, _P2Type p2, _P3Type p3) const { return (*m_function)(m_object, p1, p2, p3); }
|
||||
_ReturnType operator()(_P1Type p1, _P2Type p2, _P3Type p3, _P4Type p4) const { return (*m_function)(m_object, p1, p2, p3, p4); }
|
||||
|
||||
// static stub creator
|
||||
// static stub creators
|
||||
template<class _FunctionClass, typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _P2Type, _P3Type, _P4Type>::member_func_type _Function>
|
||||
static delegate_base static_creator(const char *name)
|
||||
{
|
||||
return delegate_base(_Function, name, (_FunctionClass *)NULL);
|
||||
}
|
||||
|
||||
template<class _FunctionClass, typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _P2Type, _P3Type, _P4Type>::static_func_type _Function>
|
||||
static delegate_base static_creator(const char *name)
|
||||
{
|
||||
return delegate_base(_Function, name, (_FunctionClass *)NULL);
|
||||
}
|
||||
|
||||
template<class _FunctionClass, typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _P2Type, _P3Type, _P4Type>::static_ref_func_type _Function>
|
||||
static delegate_base static_creator(const char *name)
|
||||
{
|
||||
return delegate_base(_Function, name, (_FunctionClass *)NULL);
|
||||
}
|
||||
|
||||
protected:
|
||||
// bind the actual object
|
||||
void bind(delegate_generic_class *object)
|
||||
|
@ -197,21 +197,6 @@ void devcb_stub16(device_t *device, offs_t offset, UINT16 data)
|
||||
#define DECLARE_WRITE_LINE_MEMBER(name) void name(ATTR_UNUSED int state)
|
||||
#define WRITE_LINE_MEMBER(name) void name(ATTR_UNUSED int state)
|
||||
|
||||
// macros for inline device handler initialization
|
||||
|
||||
#define MCFG_DEVICE_CONFIG_DEVCB_GENERIC(_access, _struct, _entry, _tag, _type, _linefunc, _devfunc, _spacefunc) \
|
||||
MCFG_DEVICE_CONFIG_DATA32(_struct, _entry .type, DEVCB_TYPE_DEVICE) \
|
||||
MCFG_DEVICE_CONFIG_DATAPTR(_struct, _entry .tag, _tag) \
|
||||
MCFG_DEVICE_CONFIG_DATAPTR(_struct, _entry . _access ## line, _linefunc) \
|
||||
MCFG_DEVICE_CONFIG_DATAPTR(_struct, _entry . _access ## device, _devfunc) \
|
||||
MCFG_DEVICE_CONFIG_DATAPTR(_struct, _entry . _access ## space, _spacefunc)
|
||||
|
||||
#define MCFG_DEVICE_CONFIG_READ_LINE(_struct, _entry, _tag, _func) MCFG_DEVICE_CONFIG_DEVCB_GENERIC(read, _struct, _entry, _tag, DEVCB_TYPE_DEVICE, _func, NULL, NULL)
|
||||
#define MCFG_DEVICE_CONFIG_WRITE_LINE(_struct, _entry, _tag, _func) MCFG_DEVICE_CONFIG_DEVCB_GENERIC(write, _struct, _entry, _tag, DEVCB_TYPE_DEVICE, _func, NULL, NULL)
|
||||
|
||||
#define MCFG_DEVICE_CONFIG_READ_HANDLER(_struct, _entry, _tag, _func) MCFG_DEVICE_CONFIG_DEVCB_GENERIC(read, _struct, _entry, _tag, DEVCB_TYPE_DEVICE, NULL, _func, NULL)
|
||||
#define MCFG_DEVICE_CONFIG_WRITE_HANDLER(_struct, _entry, _tag, _func) MCFG_DEVICE_CONFIG_DEVCB_GENERIC(write, _struct, _entry, _tag, DEVCB_TYPE_DEVICE, NULL, _func, NULL)
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
|
Loading…
Reference in New Issue
Block a user