HAL  v4.5.0-83-g30c8f0afc
The Hardware Analyzer - a comprehensive reverse engineering and manipulation framework for gate-level netlists.
hal::EventHandler Class Reference

#include <hal_core/netlist/event_system/event_handler.h>

Collaboration diagram for hal::EventHandler:
Collaboration graph

Public Member Functions

 EventHandler ()
 
void event_enable_all (bool flag)
 
void notify (NetlistEvent::event ev, Netlist *netlist, u32 associated_data=0xFFFFFFFF)
 
void notify (ModuleEvent::event ev, Module *module, u32 associated_data=0xFFFFFFFF)
 
void notify (GateEvent::event ev, Gate *gate, u32 associated_data=0xFFFFFFFF)
 
void notify (NetEvent::event ev, Net *net, u32 associated_data=0xFFFFFFFF)
 
void notify (GroupingEvent::event ev, Grouping *grouping, u32 associated_data=0xFFFFFFFF)
 
void register_callback (const std::string &name, std::function< void(NetlistEvent::event e, Netlist *netlist, u32 associated_data)> function)
 
void register_callback (const std::string &name, std::function< void(ModuleEvent::event e, Module *module, u32 associated_data)> function)
 
void register_callback (const std::string &name, std::function< void(GateEvent::event e, Gate *, u32 associated_data)> function)
 
void register_callback (const std::string &name, std::function< void(NetEvent::event e, Net *, u32 associated_data)> function)
 
void register_callback (const std::string &name, std::function< void(GroupingEvent::event e, Grouping *grouping, u32 associated_data)> function)
 
void unregister_callback (const std::string &name)
 

Detailed Description

The event handler distributes the events emitted by the netlist and its elements to all registered callbacks. Callbacks are registered per event type and can be enabled or disabled individually.

Definition at line 164 of file event_handler.h.

Constructor & Destructor Documentation

◆ EventHandler()

hal::EventHandler::EventHandler ( )

Definition at line 68 of file event_handler.cpp.

Member Function Documentation

◆ event_enable_all()

void hal::EventHandler::event_enable_all ( bool  flag)

Enables/disables callbacks for all handler.
Enabled by default.

Parameters
[in]flag- true to enable, false to disable.

Definition at line 72 of file event_handler.cpp.

◆ notify() [1/5]

void hal::EventHandler::notify ( GateEvent::event  ev,
Gate gate,
u32  associated_data = 0xFFFFFFFF 
)

Executes all registered callbacks.

Parameters
[in]ev- the event which occured.
[in]gate- The affected object.
[in]associated_data- may have a meaning depending on the event type.

Definition at line 90 of file event_handler.cpp.

References hal::event_log::handle_gate_event().

◆ notify() [2/5]

void hal::EventHandler::notify ( GroupingEvent::event  ev,
Grouping grouping,
u32  associated_data = 0xFFFFFFFF 
)

Executes all registered callbacks.

Parameters
[in]ev- the event which occured.
[in]grouping- The affected object.
[in]associated_data- may have a meaning depending on the event type.

Definition at line 118 of file event_handler.cpp.

References hal::event_log::handle_grouping_event().

◆ notify() [3/5]

void hal::EventHandler::notify ( ModuleEvent::event  ev,
Module module,
u32  associated_data = 0xFFFFFFFF 
)

Executes all registered callbacks.

Parameters
[in]ev- the event which occured.
[in]module- The affected object.
[in]associated_data- may have a meaning depending on the event type.

Definition at line 108 of file event_handler.cpp.

References hal::event_log::handle_module_event(), and hal::ShortestPath::module().

◆ notify() [4/5]

void hal::EventHandler::notify ( NetEvent::event  ev,
Net net,
u32  associated_data = 0xFFFFFFFF 
)

Executes all registered callbacks.

Parameters
[in]ev- the event which occured.
[in]net- The affected object.
[in]associated_data- may have a meaning depending on the event type.

Definition at line 99 of file event_handler.cpp.

References hal::event_log::handle_net_event(), and net.

◆ notify() [5/5]

void hal::EventHandler::notify ( NetlistEvent::event  ev,
Netlist netlist,
u32  associated_data = 0xFFFFFFFF 
)

Executes all registered callbacks.

Parameters
[in]ev- the event which occured.
[in]netlist- The affected object.
[in]associated_data- may have a meaning depending on the event type.

Definition at line 81 of file event_handler.cpp.

References hal::event_log::handle_netlist_event().

Referenced by hal::PinChangedEvent::send(), hal::Grouping::set_color(), hal::Module::set_name(), hal::Net::set_name(), hal::Grouping::set_name(), hal::Module::set_parent_module(), hal::Module::set_type(), and hal::PinChangedBulkScope::~PinChangedBulkScope().

◆ register_callback() [1/5]

void hal::EventHandler::register_callback ( const std::string &  name,
std::function< void(GateEvent::event e, Gate *, u32 associated_data)>  function 
)

Registers a callback function.

Parameters
[in]name- name of the callback, used for callback removal.
[in]function- The callback function.

Definition at line 127 of file event_handler.cpp.

References name.

◆ register_callback() [2/5]

void hal::EventHandler::register_callback ( const std::string &  name,
std::function< void(GroupingEvent::event e, Grouping *grouping, u32 associated_data)>  function 
)

Registers a callback function.

Parameters
[in]name- name of the callback, used for callback removal.
[in]function- The callback function.

Definition at line 132 of file event_handler.cpp.

References name.

◆ register_callback() [3/5]

void hal::EventHandler::register_callback ( const std::string &  name,
std::function< void(ModuleEvent::event e, Module *module, u32 associated_data)>  function 
)

Registers a callback function.

Parameters
[in]name- name of the callback, used for callback removal.
[in]function- The callback function.

Definition at line 137 of file event_handler.cpp.

References name.

◆ register_callback() [4/5]

void hal::EventHandler::register_callback ( const std::string &  name,
std::function< void(NetEvent::event e, Net *, u32 associated_data)>  function 
)

Registers a callback function.

Parameters
[in]name- name of the callback, used for callback removal.
[in]function- The callback function.

Definition at line 142 of file event_handler.cpp.

References name.

◆ register_callback() [5/5]

void hal::EventHandler::register_callback ( const std::string &  name,
std::function< void(NetlistEvent::event e, Netlist *netlist, u32 associated_data)>  function 
)

Registers a callback function.

Parameters
[in]name- name of the callback, used for callback removal.
[in]function- The callback function.

Definition at line 147 of file event_handler.cpp.

References name.

Referenced by hal::NetlistRelay::registerNetlistCallbacks().

◆ unregister_callback()

void hal::EventHandler::unregister_callback ( const std::string &  name)

Removes a callback function.

Parameters
[in]name- name of the callback.

Definition at line 152 of file event_handler.cpp.

References name.

Referenced by hal::NetlistRelay::unregisterNetlistCallbacks().


The documentation for this class was generated from the following files: