Bitstream Interpretation Library (BIL)
0.1
|
A lookup table for registers. More...
#include <packetprocessor/RegisterLookup.hpp>
Public Member Functions | |
RegisterLookup (RegisterAddress::address_t highestAddress) | |
Creates a new RegisterLookup instance. | |
void | add (Register ®) |
Adds a register reference into lookup table. | |
bool | remove (RegisterAddress::address_t registerAddress) |
Removes register reference for given address. | |
Register * | lookup (RegisterAddress::address_t registerAddress) const |
Looks up a register by address. |
A lookup table for registers.
The RegisterLookup class stores references to Register instances and allows quick looking up of them by their address.
Definition at line 25 of file RegisterLookup.hpp.
RegisterLookup::RegisterLookup | ( | RegisterAddress::address_t | highestAddress | ) |
Creates a new RegisterLookup instance.
highestAddress | Highest address the lookup table should have a slot for. |
Definition at line 13 of file RegisterLookup.cpp.
void RegisterLookup::add | ( | Register & | reg | ) |
Adds a register reference into lookup table.
reg | The register to add. |
. |
Definition at line 20 of file RegisterLookup.cpp.
bool RegisterLookup::remove | ( | RegisterAddress::address_t | registerAddress | ) |
Removes register reference for given address.
registerAddress | Address of slot to empty. |
Definition at line 31 of file RegisterLookup.cpp.
Register * RegisterLookup::lookup | ( | RegisterAddress::address_t | registerAddress | ) | const |
Looks up a register by address.
registerAddress | The address of register to get. |
Definition at line 44 of file RegisterLookup.cpp.