Simple ring-buffer template class, because re-implementing the wheel in every driver is silly.