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

Abstract base class for packet processor's registers. More...

#include <packetprocessor/Register.hpp>

Inheritance diagram for bil::Register:
Inheritance graph
[legend]

List of all members.

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.

Detailed Description

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.


Constructor & Destructor Documentation

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.

Parameters:
addressAddress of the register.
nameName of the register (gets copied).
writableWritable flag.
readableReadable flag.

Definition at line 12 of file Register.cpp.

Register::~Register ( )
pure virtual

Destructs a Register instance.

Definition at line 22 of file Register.cpp.


Member Function Documentation

RegisterAddress::address_t Register::address ( ) const

Gets register address.

Returns:
The register address.

Definition at line 28 of file Register.cpp.

const std::string & Register::name ( ) const

Gets register name.

Returns:
A const reference to the register name.

Definition at line 34 of file Register.cpp.

bool Register::writable ( ) const

Tells if register is writable.

Returns:
True if register is writable, false otherwise.

Definition at line 40 of file Register.cpp.

bool Register::readable ( ) const

Tells if register is readable.

Returns:
True if register is readable, false otherwise.

Definition at line 46 of file Register.cpp.

void Register::write ( const boost::uint32_t *  words,
size_t  wordCount 
)
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.

Parameters:
wordsPointer to data words to write.
wordCountNumber of data words to write.
Exceptions:
.

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.

void Register::read ( boost::uint32_t *  words,
size_t  wordCount 
) const
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.

Parameters:
wordsPointer to data buffer.
wordCountNumber of data words to read into buffer.
Exceptions:
.

Reimplemented in bil::V5IDCODERegister, bil::V5CMDRegister, bil::V5CRCRegister, bil::V5FARRegister, and bil::WordRegister.

Definition at line 58 of file Register.cpp.


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