Kinetis Bootloader Host  2.0.0
Host Tools for Kinetis devices
blfwk::SizedIntegerValue Class Reference

Adds a word size attribute to IntegerValue. More...

#include <Value.h>

+ Inheritance diagram for blfwk::SizedIntegerValue:
+ Collaboration diagram for blfwk::SizedIntegerValue:

Public Member Functions

 SizedIntegerValue (uint32_t value, int_size_t size=kWordSize)
 
 SizedIntegerValue (uint16_t value)
 
 SizedIntegerValue (uint8_t value)
 
 SizedIntegerValue (const SizedIntegerValue &other)
 
virtual std::string getTypeName () const
 
virtual size_t getSize () const
 
int_size_t getWordSize () const
 
void setWordSize (int_size_t size)
 
uint32_t getWordSizeMask () const
 Returns a 32-bit mask value dependant on the word size attribute. More...
 
Assignment operators

These operators set the word size as well as the integer value.

SizedIntegerValueoperator= (uint8_t value)
 
SizedIntegerValueoperator= (uint16_t value)
 
SizedIntegerValueoperator= (uint32_t value)
 
- Public Member Functions inherited from blfwk::IntegerValue
 IntegerValue (uint32_t value)
 
 IntegerValue (const IntegerValue &other)
 
uint32_t getValue () const
 
 operator uint32_t () const
 
IntegerValueoperator= (uint32_t value)
 

Protected Attributes

int_size_t m_size
 Size of the integer.
 
- Protected Attributes inherited from blfwk::IntegerValue
uint32_t m_value
 The integer value.
 

Detailed Description

Adds a word size attribute to IntegerValue.

The word size really only acts as an attribute that is carried along with the integer value. It doesn't affect the actual value at all. However, you can use the getWordSizeMask() method to mask off bits that should not be there.

The word size defaults to a 32-bit word.

Member Function Documentation

size_t SizedIntegerValue::getSize ( ) const
virtual

Returns a varying size depending on the word size attribute.

Reimplemented from blfwk::IntegerValue.

uint32_t SizedIntegerValue::getWordSizeMask ( ) const

Returns a 32-bit mask value dependant on the word size attribute.

The resulting mask can be used to truncate the integer value to be certain it doesn't extend beyond the associated word size.


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