mirror of
https://github.com/pocoproject/poco.git
synced 2025-03-05 20:49:00 +01:00
Changed FIFOBuffer's next() to reset FIFO data to the start of the internal buffer to make it compatible with writing to the next() pointer.
This commit is contained in:
parent
d89f41add0
commit
30ae0afd7b
@ -352,6 +352,11 @@ public:
|
||||
T* begin()
|
||||
/// Returns the pointer to the beginning of the buffer.
|
||||
{
|
||||
if (_begin != 0)
|
||||
{
|
||||
std::memmove(_buffer.begin(), _buffer.begin() + _begin, _used * sizeof(T));
|
||||
_begin = 0;
|
||||
}
|
||||
return _buffer.begin();
|
||||
}
|
||||
|
||||
@ -361,6 +366,12 @@ public:
|
||||
if (available() == 0)
|
||||
throw InvalidAccessException("Buffer is full.");
|
||||
|
||||
if (_begin != 0)
|
||||
{
|
||||
std::memmove(_buffer.begin(), _buffer.begin() + _begin, _used * sizeof(T));
|
||||
_begin = 0;
|
||||
}
|
||||
|
||||
return _buffer.begin() + _used;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user