PDA

View Full Version : qt way of having a ring or circular buffer set



PeterVE
28th July 2016, 14:48
I have two reasons for a ring or circular buffer; processing incoming video frames and an in-app communication between threads mailbox system. In looking around, I found mention of QRingBuffer and QCircularBuffer but both are in the private area. This concerns me as to me this means it is not consumer ready for me/us developers. I also saw that Boost has such a thing as well. So my question is, what are people using? Is it safe to use the private stuff? Is it hard to get Boost into a Qt build environment?

Thanks for your time.

Cheers,
Pete

d_stranz
28th July 2016, 16:10
Is it safe to use the private stuff?

I wouldn't use it. There's a reason why there are things in private areas of Qt - they are either not intended to be part of the public interface or are subject to change in later versions.


Is it hard to get Boost into a Qt build environment?

Not at all. Until most of what I use got put into c++ 11, I used it extensively. I still use boost graph occasionally. Since boost is nearly all c++ templates only, all you need is to set your library include path to point to the top-level boost directory, then include boost files as "<circular_buffer.hpp>" (or "<boost/circular_buffer.hpp>" if you unzipped it to a version-named top level directory), etc.