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

A register for doing cyclic redundancy checks. More...

#include <packetprocessor/V5CRCRegister.hpp>

Inheritance diagram for bil::V5CRCRegister:
Inheritance graph
[legend]
Collaboration diagram for bil::V5CRCRegister:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 V5CRCRegister ()
 Constructs a V5CRCRegister instance.
virtual void write (const boost::uint32_t *words, size_t wordCount)
 When writing a word, a CRC check will be issued (by calling check()).
virtual void read (boost::uint32_t *words, size_t wordCount) const
 When reading a word, the current CRC value will be returned.
boost::uint32_t crcValue () const
 Gets the current CRC value.
void reset ()
 Resets the CRC register value to 0.
void update (const boost::uint32_t *words, size_t wordCount, RegisterAddress::address_t registerAddress)
 Updates the CRC value based on given data and register address.
void check () const
 Checks if CRC was successful, i.e. CRC value is 0 again.
- Public Member Functions inherited from bil::Register
 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.

Detailed Description

A register for doing cyclic redundancy checks.

The CRC register is an one word write- and readable register. Writes will trigger a check of its register value. Reads will return the current CRC value. The actual updating of the CRC values must be done from outside per update().

Definition at line 23 of file V5CRCRegister.hpp.


Constructor & Destructor Documentation

V5CRCRegister::V5CRCRegister ( )

Constructs a V5CRCRegister instance.

Definition at line 14 of file V5CRCRegister.cpp.


Member Function Documentation

void V5CRCRegister::write ( const boost::uint32_t *  words,
size_t  wordCount 
)
virtual

When writing a word, a CRC check will be issued (by calling check()).

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

Reimplemented from bil::Register.

Definition at line 21 of file V5CRCRegister.cpp.

void V5CRCRegister::read ( boost::uint32_t *  words,
size_t  wordCount 
) const
virtual

When reading a word, the current CRC value will be returned.

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

Reimplemented from bil::Register.

Definition at line 33 of file V5CRCRegister.cpp.

boost::uint32_t V5CRCRegister::crcValue ( ) const

Gets the current CRC value.

Returns:
The CRC value.

Definition at line 44 of file V5CRCRegister.cpp.

void V5CRCRegister::reset ( )

Resets the CRC register value to 0.

Definition at line 50 of file V5CRCRegister.cpp.

void V5CRCRegister::update ( const boost::uint32_t *  words,
size_t  wordCount,
RegisterAddress::address_t  registerAddress 
)

Updates the CRC value based on given data and register address.

Parameters:
wordsPointer to data words.
wordCountNumber of data words.
registerAddressTarget register of data words.

Definition at line 56 of file V5CRCRegister.cpp.

void V5CRCRegister::check ( ) const

Checks if CRC was successful, i.e. CRC value is 0 again.

Exceptions:
.

Definition at line 73 of file V5CRCRegister.cpp.


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