Get rid of some init_object calls.

This commit is contained in:
couriersud 2016-04-10 15:59:33 +02:00
parent 521353d8d7
commit 71d2cf2625
5 changed files with 30 additions and 14 deletions

View File

@ -300,9 +300,8 @@ void netlist_mame_device_t::device_start()
//printf("clock is %d\n", clock());
m_netlist = global_alloc(netlist_mame_t(*this));
m_netlist = global_alloc(netlist_mame_t(*this, "netlist"));
m_setup = global_alloc(netlist::setup_t(m_netlist));
netlist().init_object(*m_netlist, "netlist");
m_setup->init();
// register additional devices

View File

@ -85,8 +85,8 @@ class netlist_mame_t : public netlist::netlist_t
{
public:
netlist_mame_t(netlist_mame_device_t &parent)
: netlist::netlist_t(),
netlist_mame_t(netlist_mame_device_t &parent, const pstring &aname)
: netlist::netlist_t(aname),
m_parent(parent)
{}
virtual ~netlist_mame_t() { };

View File

@ -74,13 +74,12 @@ logic_family_desc_t *family_CD4XXX = palloc(logic_family_cd4xxx_t);
queue_t::queue_t(netlist_t &nl)
: timed_queue<net_t *, netlist_time>(512)
, object_t(QUEUE, GENERIC)
, object_t(nl, "QUEUE", QUEUE, GENERIC)
, pstate_callback_t()
, m_qsize(0)
, m_times(512)
, m_names(512)
{
this->init_object(nl, "QUEUE");
}
void queue_t::register_state(pstate_manager_t &manager, const pstring &module)
@ -131,6 +130,23 @@ ATTR_COLD object_t::object_t(const type_t atype, const family_t afamily)
, m_netlist(NULL)
{}
ATTR_COLD object_t::object_t(const pstring &aname, const type_t atype, const family_t afamily)
: m_name(aname)
, m_objtype(atype)
, m_family(afamily)
{
// FIXME:
m_netlist = reinterpret_cast<netlist_t *>(this);
}
ATTR_COLD object_t::object_t(netlist_t &nl, const pstring &aname, const type_t atype, const family_t afamily)
: m_name(aname)
, m_objtype(atype)
, m_family(afamily)
, m_netlist(&nl)
{
}
ATTR_COLD object_t::~object_t()
{
}
@ -171,8 +187,8 @@ ATTR_COLD void device_object_t::init_object(core_device_t &dev,
// netlist_t
// ----------------------------------------------------------------------------------------
netlist_t::netlist_t()
: object_t(NETLIST, GENERIC), pstate_manager_t(),
netlist_t::netlist_t(const pstring &aname)
: object_t(aname, NETLIST, GENERIC), pstate_manager_t(),
m_stop(netlist_time::zero),
m_time(netlist_time::zero),
m_use_deactivate(0),

View File

@ -405,6 +405,8 @@ namespace netlist
};
ATTR_COLD object_t(const type_t atype, const family_t afamily);
ATTR_COLD object_t(const pstring &aname, const type_t atype, const family_t afamily);
ATTR_COLD object_t(netlist_t &nl, const pstring &aname, const type_t atype, const family_t afamily);
virtual ~object_t();
@ -1188,7 +1190,7 @@ namespace netlist
P_PREVENT_COPYING(netlist_t)
public:
netlist_t();
netlist_t(const pstring &aname);
virtual ~netlist_t();
ATTR_COLD void start();

View File

@ -145,8 +145,8 @@ class netlist_tool_t : public netlist::netlist_t
{
public:
netlist_tool_t()
: netlist::netlist_t(), m_opts(NULL), m_setup(NULL)
netlist_tool_t(const pstring &aname)
: netlist::netlist_t(aname), m_opts(NULL), m_setup(NULL)
{
}
@ -159,7 +159,6 @@ public:
void init()
{
m_setup = palloc(netlist::setup_t(this));
this->init_object(*this, "netlist");
m_setup->init();
}
@ -281,7 +280,7 @@ pvector_t<input_t> *read_input(netlist::netlist_t *netlist, pstring fname)
static void run(tool_options_t &opts)
{
netlist_tool_t nt;
netlist_tool_t nt("netlist");
osd_ticks_t t = osd_ticks();
nt.m_opts = &opts;
@ -326,7 +325,7 @@ static void run(tool_options_t &opts)
static void listdevices()
{
netlist_tool_t nt;
netlist_tool_t nt("netlist");
nt.init();
const netlist::factory_list_t &list = nt.setup().factory();