| 3 | #include <new> |
| 4 | |
| 5 | DataBuffer::DataBuffer (int num_samples, size_t buffer_size) |
| 6 | { |
| 7 | this->buffer_size = buffer_size; |
| 8 | this->num_samples = num_samples; |
| 9 | first_free = first_used = count = 0; |
| 10 | |
| 11 | if (buffer_size == 0) |
| 12 | { |
| 13 | data = NULL; |
| 14 | } |
| 15 | else |
| 16 | { |
| 17 | try |
| 18 | { |
| 19 | data = new double[buffer_size * num_samples]; |
| 20 | } |
| 21 | catch (const std::bad_alloc &) |
| 22 | { |
| 23 | data = NULL; |
| 24 | } |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | DataBuffer::~DataBuffer () |
| 29 | { |
nothing calls this directly
no outgoing calls
no test coverage detected