HAL
hal::EventHandler Class Reference

#include <event_handler.h>

Collaboration diagram for hal::EventHandler:
Collaboration graph

Public Member Functions

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

Detailed Description

Definition at line 145 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(), and test_multiple::netlist.

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(), and hal::Module::set_type().

◆ register_callback() [1/5]

NETLIST_API 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.

◆ register_callback() [2/5]

NETLIST_API 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.

◆ register_callback() [3/5]

NETLIST_API 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.

◆ register_callback() [4/5]

NETLIST_API 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.

◆ register_callback() [5/5]

NETLIST_API 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.

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: