Bitstream Interpretation Library (BIL)  0.1
Public Member Functions
bil::RegisterLookup Class Reference

A lookup table for registers. More...

#include <packetprocessor/RegisterLookup.hpp>

List of all members.

Public Member Functions

 RegisterLookup (RegisterAddress::address_t highestAddress)
 Creates a new RegisterLookup instance.
void add (Register &reg)
 Adds a register reference into lookup table.
bool remove (RegisterAddress::address_t registerAddress)
 Removes register reference for given address.
Registerlookup (RegisterAddress::address_t registerAddress) const
 Looks up a register by address.

Detailed Description

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.


Constructor & Destructor Documentation

RegisterLookup::RegisterLookup ( RegisterAddress::address_t  highestAddress)

Creates a new RegisterLookup instance.

Parameters:
highestAddressHighest address the lookup table should have a slot for.

Definition at line 13 of file RegisterLookup.cpp.


Member Function Documentation

void RegisterLookup::add ( Register reg)

Adds a register reference into lookup table.

Parameters:
regThe register to add.
Exceptions:
.

Definition at line 20 of file RegisterLookup.cpp.

bool RegisterLookup::remove ( RegisterAddress::address_t  registerAddress)

Removes register reference for given address.

Parameters:
registerAddressAddress of slot to empty.
Returns:
True, if slot was emptied; false otherwise (e.g. because slot was already empty before or does not exist).

Definition at line 31 of file RegisterLookup.cpp.

Register * RegisterLookup::lookup ( RegisterAddress::address_t  registerAddress) const

Looks up a register by address.

Parameters:
registerAddressThe address of register to get.
Returns:
If found, a pointer to the register; 0 otherwise.

Definition at line 44 of file RegisterLookup.cpp.


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