BlocksProtocol::IntegerWithBitSize< numBits > Struct Template Reference
juce_blocks_basics » protocol

Helper class to define an integer with a specific bit size. More...

## Public Types

enum | { bits = numBits, maxValue = static_cast<uint32> ((1ULL << numBits) - 1ULL) }

## Public Member Functions

| IntegerWithBitSize ()=default
| IntegerWithBitSize (const IntegerWithBitSize &)=default
IntegerWithBitSize & | operator= (const IntegerWithBitSize &)=default
| IntegerWithBitSize (uint32 v) noexcept
| operator uint32 () const noexcept
uint32 | get () const noexcept
uint8 | getScaledToByte () const noexcept
float | toUnipolarFloat () const noexcept
float | toBipolarFloat () const noexcept

## Static Public Member Functions

static IntegerWithBitSize | fromUnipolarFloat (float value) noexcept
static IntegerWithBitSize | fromBipolarFloat (float value) noexcept

## Public Attributes

uint32 | value = 0

## Detailed Description

### template<int numBits>
struct BlocksProtocol::IntegerWithBitSize< numBits >

Helper class to define an integer with a specific bit size.

## Member Enumeration Documentation

## anonymous enum

template<int numBits>

anonymous enum

Enumerator
bits |
maxValue |

## Constructor & Destructor Documentation

## IntegerWithBitSize() [1/3]

template<int numBits>

BlocksProtocol::IntegerWithBitSize< numBits >::IntegerWithBitSize | ( |  | ) |

default

Referenced by BlocksProtocol::IntegerWithBitSize< 8 >::fromBipolarFloat(), and BlocksProtocol::IntegerWithBitSize< 8 >::fromUnipolarFloat().

## IntegerWithBitSize() [2/3]

template<int numBits>

BlocksProtocol::IntegerWithBitSize< numBits >::IntegerWithBitSize | ( | const IntegerWithBitSize< numBits > & |  | ) |

default

## IntegerWithBitSize() [3/3]

template<int numBits>

BlocksProtocol::IntegerWithBitSize< numBits >::IntegerWithBitSize | ( | uint32 | v | ) |

noexcept

## Member Function Documentation

## operator=()

template<int numBits>

IntegerWithBitSize& BlocksProtocol::IntegerWithBitSize< numBits >::operator= | ( | const IntegerWithBitSize< numBits > & |  | ) |

default

## operator uint32()

template<int numBits>

BlocksProtocol::IntegerWithBitSize< numBits >::operator uint32 | ( |  | ) | const

noexcept

## get()

template<int numBits>

uint32 BlocksProtocol::IntegerWithBitSize< numBits >::get | ( |  | ) | const

noexcept

Referenced by BlocksProtocol::HostPacketDecoder< Handler >::handleButtonDownOrUp(), BlocksProtocol::HostPacketDecoder< Handler >::handleConfigMessage(), BlocksProtocol::HostPacketDecoder< Handler >::handleCustomMessage(), BlocksProtocol::HostPacketDecoder< Handler >::handleTouch(), and BlocksProtocol::HostPacketDecoder< Handler >::handleTouchWithVelocity().

## getScaledToByte()

template<int numBits>

uint8 BlocksProtocol::IntegerWithBitSize< numBits >::getScaledToByte | ( |  | ) | const

noexcept

## toUnipolarFloat()

template<int numBits>

float BlocksProtocol::IntegerWithBitSize< numBits >::toUnipolarFloat | ( |  | ) | const

noexcept

## toBipolarFloat()

template<int numBits>

float BlocksProtocol::IntegerWithBitSize< numBits >::toBipolarFloat | ( |  | ) | const

noexcept

## fromUnipolarFloat()

template<int numBits>

static IntegerWithBitSize BlocksProtocol::IntegerWithBitSize< numBits >::fromUnipolarFloat | ( | float | value | ) |

static noexcept

## fromBipolarFloat()

template<int numBits>

static IntegerWithBitSize BlocksProtocol::IntegerWithBitSize< numBits >::fromBipolarFloat | ( | float | value | ) |

static noexcept

## Member Data Documentation

## value

template<int numBits>

uint32 BlocksProtocol::IntegerWithBitSize< numBits >::value = 0

Referenced by BlocksProtocol::IntegerWithBitSize< 8 >::fromBipolarFloat(), BlocksProtocol::IntegerWithBitSize< 8 >::fromUnipolarFloat(), BlocksProtocol::IntegerWithBitSize< 8 >::get(), BlocksProtocol::IntegerWithBitSize< 8 >::getScaledToByte(), BlocksProtocol::IntegerWithBitSize< 8 >::operator uint32(), BlocksProtocol::IntegerWithBitSize< 8 >::toBipolarFloat(), and BlocksProtocol::IntegerWithBitSize< 8 >::toUnipolarFloat().

The documentation for this struct was generated from the following file:

- juce_BitPackingUtilities.h