AbstractFifo and generic objects


The AbstractFifo class seems to work with ints, by default. What’s my best bet to put another type of data in? It’s a relatively small struct type class - 8 or so members, ints or int64.

There’s no problem copying it - no refs or pointers.

Should I cast it to an array of ints or bytes? Or redo the Fifo class? Could the Fifo actually be templated, more like the other containers? I seem to recall others need objects to be trivially copyable too.



Sorry, read a bit more. It works with a flat list of any type, it looks like. A C Array, at least. Are any Juce containers suitable?



The AbstractFifo doesn’t care how things are stored, it just takes care of remembering where the valid data is within that buffer. You can use whatever kind of wacky scheme you like to actually store the data.