tahamajs's picture
download
raw
749 Bytes
#ifndef WAVE_H
#define WAVE_H
#include <CPS4042/Units/Byte.h>
/// a simple wave generator
template <Byte min, Byte max, Byte step>
struct Wave
{
static_assert(((max - min) > step) && ((max - min) % step == 0),
"invalid range or step");
inline void
operator()(Byte& data)
{
if(data >= max)
{
data = max;
m_upDirection = false;
}
if(data <= min)
{
data = min;
m_upDirection = true;
}
if(m_upDirection)
data += step;
else
data -= step;
}
private:
static inline bool m_upDirection = true;
};
#endif // WAVE_H

Xet Storage Details

Size:
749 Bytes
·
Xet hash:
08934db498f802a25a4811bc1d6cffdb1a74d0758bbb73ef69eca13d8b3861e3

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.