Bitstream Interpretation Library (BIL)
0.1
|
Abstract base class for packet processor's registers. More...
#include <packetprocessor/Register.hpp>
Public Member Functions | |
Register (RegisterAddress::address_t address, const std::string &name, bool writable=true, bool readable=true) | |
Constructs a Register instance. | |
virtual | ~Register ()=0 |
Destructs a Register instance. | |
RegisterAddress::address_t | address () const |
Gets register address. | |
const std::string & | name () const |
Gets register name. | |
bool | writable () const |
Tells if register is writable. | |
bool | readable () const |
Tells if register is readable. | |
virtual void | write (const boost::uint32_t *words, size_t wordCount) |
Writes data words into the register. | |
virtual void | read (boost::uint32_t *words, size_t wordCount) const |
Reads data words from the register. |
Abstract base class for packet processor's registers.
Each register has an address, a name, and could be written and/or read. Derived specialized registers perform some register specific actions on reads/writes, and accept only specific data.
Definition at line 25 of file Register.hpp.
Register::Register | ( | RegisterAddress::address_t | address, |
const std::string & | name, | ||
bool | writable = true , |
||
bool | readable = true |
||
) |
Constructs a Register instance.
Once created, name, address, writable, and readable can not be changed.
address | Address of the register. |
name | Name of the register (gets copied). |
writable | Writable flag. |
readable | Readable flag. |
Definition at line 12 of file Register.cpp.
|
pure virtual |
Destructs a Register instance.
Definition at line 22 of file Register.cpp.
RegisterAddress::address_t Register::address | ( | ) | const |
const std::string & Register::name | ( | ) | const |
Gets register name.
Definition at line 34 of file Register.cpp.
bool Register::writable | ( | ) | const |
Tells if register is writable.
Definition at line 40 of file Register.cpp.
bool Register::readable | ( | ) | const |
Tells if register is readable.
Definition at line 46 of file Register.cpp.
|
virtual |
Writes data words into the register.
Note that different Register subclasses may accept different data (e.g. only a specific number of words or some special values), and even the same register instance may accept different data over the time dependent on its internal state.
words | Pointer to data words to write. |
wordCount | Number of data words to write. |
. |
Reimplemented in bil::V5FDRIRegister, bil::V5IDCODERegister, bil::V5MFWRRegister, bil::V5CMDRegister, bil::V5CRCRegister, bil::V5FARRegister, and bil::WordRegister.
Definition at line 52 of file Register.cpp.
|
virtual |
Reads data words from the register.
Note that different Register subclasses may accept different read sizes, and even the same register instance may accept different read sizes over the time dependent on its internal state.
words | Pointer to data buffer. |
wordCount | Number of data words to read into buffer. |
. |
Reimplemented in bil::V5IDCODERegister, bil::V5CMDRegister, bil::V5CRCRegister, bil::V5FARRegister, and bil::WordRegister.
Definition at line 58 of file Register.cpp.