Esempio n. 1
0
            }                                                                                                   //: element_t(name, std::move(properties(props).set_type(element_type::MACRO)))

            public override core_device_t make_device(device_arena pool, netlist_state_t anetlist, string name) //dev_uptr make_device(device_arena &pool, netlist_state_t &anetlist, const pstring &name) override;
            {
                return(new nld_wrapper(anetlist, name));                                                        //return plib::make_unique<NETLIB_NAME(wrapper)>(pool, anetlist, name);
            }
Esempio n. 2
0
            //template <std::size_t... Is>
            //dev_uptr make_device(device_arena &pool,
            //                    netlist_state_t &anetlist,
            //                    const pstring &name, std::tuple<Args...>& args, std::index_sequence<Is...>)
            //{
            //    return plib::make_unique<C>(pool, anetlist, name, std::forward<Args>(std::get<Is>(args))...);
            //}

            //dev_uptr make_device(device_arena &pool,
            //            netlist_state_t &anetlist,
            //            const pstring &name, std::tuple<Args...>& args)
            //{
            //    return make_device(pool, anetlist, name, args, std::index_sequence_for<Args...>{});
            //}

            //dev_uptr make_device(device_arena &pool,
            //    netlist_state_t &anetlist,
            //    const pstring &name) override
            //{
            //    return make_device(pool, anetlist, name, m_args);
            //    //return pool.make_unique<C>(anetlist, name);
            //}

            public core_device_t make_device(device_arena pool, netlist_state_t anetlist, string name, object [] args)
            {
                //return plib::make_unique<C>(pool, anetlist, name, std::forward<Args>(std::get<Is>(args))...);
                ////return anetlist.make_pool_object<C>(anetlist, name, std::forward<Args>(std::get<Is>(args))...);

                if (typeof(C) == typeof(analog.nld_C))
                {
                    return(new analog.nld_C(anetlist, name));
                }
                else if (typeof(C) == typeof(analog.nld_D))
                {
                    return(new analog.nld_D(anetlist, name));
                }
                else if (typeof(C) == typeof(analog.nld_opamp))
                {
                    return(new analog.nld_opamp(anetlist, name));
                }
                else if (typeof(C) == typeof(analog.nld_POT))
                {
                    return(new analog.nld_POT(anetlist, name));
                }
                else if (typeof(C) == typeof(analog.nld_QBJT_EB))
                {
                    return(new analog.nld_QBJT_EB(anetlist, name));
                }
                else if (typeof(C) == typeof(analog.nld_QBJT_switch))
                {
                    return(new analog.nld_QBJT_switch(anetlist, name));
                }
                else if (typeof(C) == typeof(analog.nld_R))
                {
                    return(new analog.nld_R(anetlist, name));
                }
                else if (typeof(C) == typeof(analog.nld_switch2))
                {
                    return(new analog.nld_switch2(anetlist, name));
                }
                else if (typeof(C) == typeof(analog.nld_Z))
                {
                    return(new analog.nld_Z(anetlist, name));
                }
                else if (typeof(C) == typeof(devices.nld_74107))
                {
                    return(new devices.nld_74107(anetlist, name));
                }
                else if (typeof(C) == typeof(devices.nld_74153))
                {
                    return(new devices.nld_74153(anetlist, name));
                }
                else if (typeof(C) == typeof(devices.nld_7448))
                {
                    return(new devices.nld_7448(anetlist, name));
                }
                else if (typeof(C) == typeof(devices.nld_7450))
                {
                    return(new devices.nld_7450(anetlist, name));
                }
                else if (typeof(C) == typeof(devices.nld_7474))
                {
                    return(new devices.nld_7474(anetlist, name));
                }
                else if (typeof(C) == typeof(devices.nld_7483))
                {
                    return(new devices.nld_7483(anetlist, name));
                }
                else if (typeof(C) == typeof(devices.nld_7490))
                {
                    return(new devices.nld_7490(anetlist, name));
                }
                else if (typeof(C) == typeof(devices.nld_7493))
                {
                    return(new devices.nld_7493(anetlist, name));
                }
                else if (typeof(C) == typeof(devices.nld_9316))
                {
                    return(new devices.nld_9316(anetlist, name));
                }
                else if (typeof(C) == typeof(devices.nld_analog_input))
                {
                    return(new devices.nld_analog_input(anetlist, name));
                }
                else if (typeof(C) == typeof(devices.nld_CD4066_GATE))
                {
                    return(new devices.nld_CD4066_GATE(anetlist, name));
                }
                else if (typeof(C) == typeof(devices.nld_clock))
                {
                    return(new devices.nld_clock(anetlist, name));
                }
                else if (typeof(C) == typeof(devices.nld_frontier))
                {
                    return(new devices.nld_frontier(anetlist, name));
                }
                else if (typeof(C) == typeof(devices.nld_gnd))
                {
                    return(new devices.nld_gnd(anetlist, name));
                }
                else if (typeof(C) == typeof(devices.nld_logic_input))
                {
                    return(new devices.nld_logic_input(anetlist, name));
                }
                else if (typeof(C) == typeof(devices.nld_mainclock))
                {
                    return(new devices.nld_mainclock(anetlist, name));
                }
                else if (typeof(C) == typeof(devices.nld_NE555))
                {
                    return(new devices.nld_NE555(anetlist, name));
                }
                else if (typeof(C) == typeof(devices.nld_netlistparams))
                {
                    return(new devices.nld_netlistparams(anetlist, name));
                }
                else if (typeof(C) == typeof(devices.nld_solver))
                {
                    return(new devices.nld_solver(anetlist, name));
                }
                else if (typeof(C) == typeof(devices.nld_sys_dsw1))
                {
                    return(new devices.nld_sys_dsw1(anetlist, name));
                }
                else if (typeof(C) == typeof(devices.nld_sys_noise <mt19937_64, plib.normal_distribution_t, plib.distribution_ops_normal>))
                {
                    return(new devices.nld_sys_noise <mt19937_64, plib.normal_distribution_t, plib.distribution_ops_normal>(anetlist, name));
                }
                else if (typeof(C) == typeof(interface_.nld_analog_callback))
                {
                    assert(args.Length == 2);  return(new interface_.nld_analog_callback(anetlist, name, (nl_fptype)args[0], (interface_.nld_analog_callback.FUNC)args[1]));
                }
                else if (typeof(C) == typeof(interface_.nld_logic_callback))
                {
                    assert(args.Length == 1);  return(new interface_.nld_logic_callback(anetlist, name, (interface_.nld_logic_callback.FUNC)args[0]));
                }
                else if (typeof(C) == typeof(nld_sound_in))
                {
                    return(new nld_sound_in(anetlist, name));
                }
                else
                {
                    throw new emu_unimplemented();
                }
            }
Esempio n. 3
0
 public override core_device_t make_device(device_arena pool, netlist_state_t anetlist, string name)
 {
     return(make_device(pool, anetlist, name, m_args));
 }
Esempio n. 4
0
            //~element_t() { }

            //PCOPYASSIGNMOVE(element_t, default)


            public abstract core_device_t make_device(device_arena pool, netlist_state_t anetlist, string name);  //virtual dev_uptr make_device(device_arena &pool, netlist_state_t &anetlist, const pstring &name) = 0;