68 EventHandler::EventHandler() : netlist_event_enabled(true), module_event_enabled(true), gate_event_enabled(true), net_event_enabled(true), grouping_event_enabled(true)
74 netlist_event_enabled = flag;
75 module_event_enabled = flag;
76 gate_event_enabled = flag;
77 net_event_enabled = flag;
78 grouping_event_enabled = flag;
83 if (netlist_event_enabled)
85 m_netlist_callback(c,
netlist, associated_data);
92 if (gate_event_enabled)
94 m_gate_callback(c, gate, associated_data);
101 if (net_event_enabled)
103 m_net_callback(c,
net, associated_data);
111 if (module_event_enabled)
113 m_module_callback(c,
module, associated_data);
120 if (grouping_event_enabled)
122 m_grouping_callback(c, grouping, associated_data);
129 m_gate_callback.add_callback(
name,
function);
134 m_grouping_callback.add_callback(
name,
function);
139 m_module_callback.add_callback(
name,
function);
144 m_net_callback.add_callback(
name,
function);
149 m_netlist_callback.add_callback(
name,
function);
154 m_netlist_callback.remove_callback(
name);
155 m_module_callback.remove_callback(
name);
156 m_gate_callback.remove_callback(
name);
157 m_net_callback.remove_callback(
name);
158 m_grouping_callback.remove_callback(
name);
NETLIST_API void unregister_callback(const std::string &name)
NETLIST_API void notify(NetlistEvent::event ev, Netlist *netlist, u32 associated_data=0xFFFFFFFF)
NETLIST_API void register_callback(const std::string &name, std::function< void(NetlistEvent::event e, Netlist *netlist, u32 associated_data)> function)
NETLIST_API void event_enable_all(bool flag)
@ boolean_function_changed
no associated_data
@ location_changed
no associated_data
@ removed
no associated_data
@ name_changed
no associated_data
@ created
no associated_data
@ net_assigned
associated_data = id of inserted net
@ module_removed
associated_data = id of removed module
@ gate_assigned
associated_data = id of inserted gate
@ module_assigned
associated_data = id of inserted module
@ gate_removed
associated_data = id of removed gate
@ removed
no associated_data
@ net_removed
associated_data = id of removed net
@ name_changed
no associated_data
@ created
no associated_data
@ gates_remove_end
associated_data = number of removed gates
@ gate_assigned
associated_data = id of inserted gate
@ gate_removed
associated_data = id of removed gate
@ pin_changed
associated_data = [4LSB: type of action] [28HSB: id of pin group or pin]
@ submodule_removed
associated_data = id of removed module
@ gates_assign_begin
associated_data = number of gates to assign
@ type_changed
no associated_data
@ gates_assign_end
associated_data = number of assigned gates
@ gates_remove_begin
associated_data = number of gates to remove
@ submodule_added
associated_data = id of added module
@ removed
no associated_data
@ parent_changed
no associated_data
@ name_changed
no associated_data
@ created
no associated_data
@ src_added
associated_data = id of src gate
@ dst_removed
associated_data = id of dst gate
@ src_removed
associated_data = id of src gate
@ dst_added
associated_data = id of dst gate
@ removed
no associated_data
@ name_changed
no associated_data
@ created
no associated_data
@ marked_global_gnd
associated_data = id of gate
@ unmarked_global_output
associated_data = id of net
@ id_changed
associated_data = old id
@ device_name_changed
no associated_data
@ unmarked_global_gnd
associated_data = id of gate
@ input_filename_changed
no associated_data
@ unmarked_global_vcc
associated_data = id of gate
@ marked_global_vcc
associated_data = id of gate
@ unmarked_global_input
associated_data = id of net
@ design_name_changed
no associated_data
@ marked_global_output
associated_data = id of net
@ marked_global_input
associated_data = id of net
const Module * module(const Gate *g, const NodeBoxes &boxes)
void handle_net_event(NetEvent::event event, Net *net, u32 associated_data)
void handle_gate_event(GateEvent::event event, Gate *gate, u32 associated_data)
void handle_netlist_event(NetlistEvent::event event, Netlist *netlist, u32 associated_data)
void handle_grouping_event(GroupingEvent::event event, Grouping *grp, u32 associated_data)
void handle_module_event(ModuleEvent::event event, Module *module, u32 associated_data)