LedController  2.0.2
A library for the MAX7219 and the MAX7221 Led display drivers.
sakurajin::ByteRow< SIZE > Class Template Reference

This class is used to handle a row of bytes with a given length. More...

#include <LedController_byterow.hpp>

Collaboration diagram for sakurajin::ByteRow< SIZE >:
Collaboration graph

Public Member Functions

byte at (uint64_t index) const noexcept
 Access the class just like the underlying array. More...
 
 ByteRow () noexcept
 Construct a new Byte Row object with 0s. More...
 
 ByteRow (byte newdata[SIZE]) noexcept
 Construct a new Byte Row object from an array. More...
 
virtual bool operator!= (const ByteRow< SIZE > &other) const noexcept
 checks if two byteRows do not have identical data More...
 
virtual ByteRow operator& (const ByteRow< SIZE > &other) const noexcept
 Overlaps two ByteRows (bitwise or). More...
 
virtual ByteRow operator++ () const noexcept
 Moves all data of the ByteRow to the up by one. More...
 
virtual ByteRow operator-- () const noexcept
 Moves all data of the ByteRow to the down by one. More...
 
virtual ByteRow operator<< (unsigned int distance) const noexcept
 Moves all data of the ByteRow to the left by a given distance. More...
 
ByteRowoperator= (byte newdata[SIZE]) noexcept
 Assign an array to this object. More...
 
virtual bool operator== (const ByteRow< SIZE > &other) const noexcept
 checks if two byteRows have identical data More...
 
virtual ByteRow operator>> (unsigned int distance) const noexcept
 Moves all data of the ByteRow to the right by a given distance. More...
 
const byte & operator[] (uint64_t index) const noexcept
 Access the class just like the underlying array. More...
 
byte & operator[] (uint64_t index) noexcept
 Access the class just like the underlying array. More...
 
 ~ByteRow () noexcept
 Destroy the Byte Row object. More...
 

Protected Attributes

byte _data [SIZE]
 The internal array where the actual data is. More...
 

Detailed Description

template<size_t SIZE>
class sakurajin::ByteRow< SIZE >

This class is used to handle a row of bytes with a given length.

Template Parameters
SIZEThe length of the row.

Definition at line 27 of file LedController_byterow.hpp.

Constructor & Destructor Documentation

◆ ByteRow() [1/2]

template<size_t SIZE>
sakurajin::ByteRow< SIZE >::ByteRow ( byte  newdata[SIZE])
inlinenoexcept

Construct a new Byte Row object from an array.

Parameters
newdataThe array which should be used to initilize the row.

Definition at line 51 of file LedController_byterow.hpp.

◆ ByteRow() [2/2]

template<size_t SIZE>
sakurajin::ByteRow< SIZE >::ByteRow ( )
inlinenoexcept

Construct a new Byte Row object with 0s.

Definition at line 64 of file LedController_byterow.hpp.

◆ ~ByteRow()

template<size_t SIZE>
sakurajin::ByteRow< SIZE >::~ByteRow ( )
inlinenoexcept

Destroy the Byte Row object.

Definition at line 77 of file LedController_byterow.hpp.

Member Function Documentation

◆ at()

template<size_t SIZE>
byte sakurajin::ByteRow< SIZE >::at ( uint64_t  index) const
inlinenoexcept

Access the class just like the underlying array.

Parameters
indexhe index that is requested.
Returns
byte the data at the requested index.

Definition at line 128 of file LedController_byterow.hpp.

◆ operator!=()

template<size_t SIZE>
virtual bool sakurajin::ByteRow< SIZE >::operator!= ( const ByteRow< SIZE > &  other) const
inlinevirtualnoexcept

checks if two byteRows do not have identical data

Parameters
otherthe other byteRow
Returns
true the data is not equal
false the data is equal

Definition at line 288 of file LedController_byterow.hpp.

◆ operator&()

template<size_t SIZE>
virtual ByteRow sakurajin::ByteRow< SIZE >::operator& ( const ByteRow< SIZE > &  other) const
inlinevirtualnoexcept

Overlaps two ByteRows (bitwise or).

This operator can be used to display two ByteRows in one ByteRow.

Parameters
otherThe ByteRow that should be overlapped with this object
Returns
ByteRow The resulting ByteRow

Definition at line 166 of file LedController_byterow.hpp.

◆ operator++()

template<size_t SIZE>
virtual ByteRow sakurajin::ByteRow< SIZE >::operator++ ( ) const
inlinevirtualnoexcept

Moves all data of the ByteRow to the up by one.

Returns
ByteRow the resulting ByteRow

Definition at line 242 of file LedController_byterow.hpp.

◆ operator--()

template<size_t SIZE>
virtual ByteRow sakurajin::ByteRow< SIZE >::operator-- ( ) const
inlinevirtualnoexcept

Moves all data of the ByteRow to the down by one.

Returns
ByteRow the resulting ByteRow

Definition at line 225 of file LedController_byterow.hpp.

◆ operator<<()

template<size_t SIZE>
virtual ByteRow sakurajin::ByteRow< SIZE >::operator<< ( unsigned int  distance) const
inlinevirtualnoexcept

Moves all data of the ByteRow to the left by a given distance.

Note
each index is handled on its own and no data is shifted across
Parameters
distancethe distance the data should be moved
Returns
ByteRow the resulting ByteRow

Definition at line 187 of file LedController_byterow.hpp.

◆ operator=()

template<size_t SIZE>
ByteRow& sakurajin::ByteRow< SIZE >::operator= ( byte  newdata[SIZE])
inlinenoexcept

Assign an array to this object.

Parameters
newdataThe data that will be assigned to this obejct
Returns
ByteRow& The modified object

Definition at line 146 of file LedController_byterow.hpp.

◆ operator==()

template<size_t SIZE>
virtual bool sakurajin::ByteRow< SIZE >::operator== ( const ByteRow< SIZE > &  other) const
inlinevirtualnoexcept

checks if two byteRows have identical data

Parameters
otherthe other byteRow
Returns
true the data is equal
false the data is not equal

Definition at line 265 of file LedController_byterow.hpp.

◆ operator>>()

template<size_t SIZE>
virtual ByteRow sakurajin::ByteRow< SIZE >::operator>> ( unsigned int  distance) const
inlinevirtualnoexcept

Moves all data of the ByteRow to the right by a given distance.

Note
each index is handled on its own and no data is shifted across
Parameters
distancethe distance the data should be moved
Returns
ByteRow the resulting ByteRow

Definition at line 208 of file LedController_byterow.hpp.

◆ operator[]() [1/2]

template<size_t SIZE>
const byte& sakurajin::ByteRow< SIZE >::operator[] ( uint64_t  index) const
inlinenoexcept

Access the class just like the underlying array.

Parameters
indexthe index that is requested.
Returns
const byte& the data at the requested index.

Definition at line 110 of file LedController_byterow.hpp.

◆ operator[]() [2/2]

template<size_t SIZE>
byte& sakurajin::ByteRow< SIZE >::operator[] ( uint64_t  index)
inlinenoexcept

Access the class just like the underlying array.

Parameters
indexthe index that is requested.
Returns
byte& the data at the requested index.

Definition at line 92 of file LedController_byterow.hpp.

Member Data Documentation

◆ _data

template<size_t SIZE>
byte sakurajin::ByteRow< SIZE >::_data[SIZE]
protected

The internal array where the actual data is.

Definition at line 36 of file LedController_byterow.hpp.


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