Interface: tos.interfaces.BitVector

interface BitVector

Interface to a bit vector.

Author:
Cory Sharp <cssharp@eecs.berkeley.edu>

Commands
command void assign(uint16_t bitnum, bool value) Write a bit in the vector.
command void clear(uint16_t bitnum) Set a bit in the vector.
command void clearAll() Clear all bits in the vector.
command bool get(uint16_t bitnum) Read a bit from the vector.
command void set(uint16_t bitnum) Set a bit in the vector.
command void setAll() Set all bits in the vector.
command uint16_t size() Return bit vector length.
command void toggle(uint16_t bitnum) Toggle a bit in the vector.

Commands - Details

assign

command void assign(uint16_t bitnum, bool value)

Write a bit in the vector.

Parameters:
bitnum - Bit to clear.
value - New bit value.

clear

command void clear(uint16_t bitnum)

Set a bit in the vector.

Parameters:
bitnum - Bit to clear.

clearAll

command void clearAll()

Clear all bits in the vector.

get

command bool get(uint16_t bitnum)

Read a bit from the vector.

Parameters:
bitnum - Bit to read.
Returns:
Bit value.

set

command void set(uint16_t bitnum)

Set a bit in the vector.

Parameters:
bitnum - Bit to set.

setAll

command void setAll()

Set all bits in the vector.

size

command uint16_t size()

Return bit vector length.

Returns:
Bit vector length.

toggle

command void toggle(uint16_t bitnum)

Toggle a bit in the vector.

Parameters:
bitnum - Bit to toggle.