18 #ifndef SDRBASE_UTIL_DOUBLEBUFFER_H_ 19 #define SDRBASE_UTIL_DOUBLEBUFFER_H_ 66 void write(
const typename std::vector<T>::const_iterator&
begin,
const typename std::vector<T>::const_iterator& cend)
68 typename std::vector<T>::const_iterator end = cend;
70 if ((end - begin) >
m_size)
75 int insize = end -
begin;
83 std::copy(begin + sizeLeft, end,
m_data.begin());
94 typename std::vector<T>::const_iterator
begin()
const {
return m_data.begin(); }
95 typename std::vector<T>::iterator
begin() {
return m_data.begin(); }
103 QByteArray buf(reinterpret_cast<const char*>(
m_data.data()),
m_data.size()*
sizeof(T));
121 unsigned int tmpUInt;
131 memcpy(reinterpret_cast<char *>(
m_data.data()), buf.data(), buf.size());
DoubleBufferSimple & operator=(const DoubleBufferSimple &other)
std::vector< T >::iterator begin()
void writeBlob(quint32 id, const QByteArray &value)
std::vector< T >::const_iterator begin() const
bool readU32(quint32 id, quint32 *result, quint32 def=0) const
bool deserialize(const QByteArray &data)
bool readS32(quint32 id, qint32 *result, qint32 def=0) const
bool readBlob(quint32 id, QByteArray *result, const QByteArray &def=QByteArray()) const
void write(const typename std::vector< T >::const_iterator &begin, const typename std::vector< T >::const_iterator &cend)
DoubleBufferSimple(const DoubleBufferSimple &other)
std::vector< T >::iterator m_current
void writeS32(quint32 id, qint32 value)
quint32 getVersion() const
void writeU32(quint32 id, quint32 value)
unsigned int absoluteFill() const
const QByteArray & final()
std::vector< T >::iterator getCurrent() const
QByteArray serialize() const