Class that supports get/set a pointer to IFACE with a string name. More...
#include <mappable-conf-object.h>
Public Member Functions | |
| void | set_iface (const std::string &name, IFACE *iface) override |
| Sets the IFACE associated with the given name. | |
| IFACE * | get_iface (const std::string &name) const override |
| Gets the interface associated with the given name. | |
| IFACE * | get_iface (size_t name_hash) const |
| Gets the interface associated with the given name hash. | |
| void | erase_iface (const std::string &name) override |
| Erases the interface associated with the given name. | |
Public Member Functions inherited from simics::MapNameToInterface< IFACE > | |
| virtual | ~MapNameToInterface ()=default |
| virtual void | set_iface (const std::string &name, IFACE *iface)=0 |
| virtual IFACE * | get_iface (const std::string &name) const =0 |
| virtual void | erase_iface (const std::string &name)=0 |
Class that supports get/set a pointer to IFACE with a string name.
The MapNameToInterfaceObject class provides functionality to map names to interface objects. It allows setting, getting, and erasing interfaces by their names. This class is used to manage associations between names and interface objects in a structured manner.
| IFACE | The type of the interface. |
|
inlineoverridevirtual |
Erases the interface associated with the given name.
This function removes the association between the specified name and its interface. If no association exists for the given name, it does nothing.
| name | The name associated with the interface to erase. |
Implements simics::MapNameToInterface< IFACE >.
|
inlineoverridevirtual |
Gets the interface associated with the given name.
This function retrieves the interface associated with the specified name. If no interface is found for the given name, it returns nullptr.
| name | The name associated with the interface. |
Implements simics::MapNameToInterface< IFACE >.
|
inline |
Gets the interface associated with the given name hash.
This function retrieves the interface associated with the specified name hash. If no interface is found for the given hash, it returns nullptr.
| name_hash | The hash value of the name associated with the interface. |
|
inlineoverridevirtual |
Sets the IFACE associated with the given name.
This function associates the given IFACE with the specified name. If the interface is null or the name is empty, it throws an invalid_argument exception.
| name | The name to associate with the IFACE. |
| iface | The IFACE to associate with the name. |
| std::invalid_argument | if the interface is null or the name is empty. |
Implements simics::MapNameToInterface< IFACE >.