MCPcopy Create free account
hub / github.com/brainflow-dev/brainflow / DataBuffer

Method DataBuffer

src/utils/data_buffer.cpp:5–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3#include <new>
4
5DataBuffer::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
28DataBuffer::~DataBuffer ()
29{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected