elftosb::SizedIntegerValue Class Reference

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

`#include <Value.h>`

Inheritance diagram for elftosb::SizedIntegerValue:
[legend]
Collaboration diagram for elftosb::SizedIntegerValue:
[legend]

## 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.
SizedIntegerValue & | operator= (uint8_t value)
SizedIntegerValue & | operator= (uint16_t value)
SizedIntegerValue & | operator= (uint32_t value)
Public Member Functions inherited from elftosb::IntegerValue
| IntegerValue (uint32_t value)
| IntegerValue (const IntegerValue &other)
uint32_t | getValue () const
| operator uint32_t () const
IntegerValue & | operator= (uint32_t value)

## Protected Attributes

int_size_t | m_size
| Size of the integer.
Protected Attributes inherited from elftosb::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 elftosb::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:

- apps/elftosb/common/Value.h
- apps/elftosb/common/Value.cpp