| 27 | } |
| 28 | |
| 29 | size_t RingBuffer::size() const |
| 30 | { |
| 31 | if (m_wpos == m_rpos) |
| 32 | return m_full ? m_capacity : 0; |
| 33 | else if (m_wpos > m_rpos) |
| 34 | return m_wpos - m_rpos; |
| 35 | else |
| 36 | return (m_capacity - m_rpos) + m_wpos; |
| 37 | } |
| 38 | |
| 39 | size_t RingBuffer::read(void* dst, size_t nbytes) |
| 40 | { |
no outgoing calls
no test coverage detected