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

Method get_data

src/utils/data_buffer.cpp:81–97  ·  view source on GitHub ↗

Removes data from buffer

Source from the content-addressed store, hash-verified

79
80// Removes data from buffer
81size_t DataBuffer::get_data (size_t max_count, double *data_buf)
82{
83 lock.lock ();
84 size_t result_count = max_count;
85 if (result_count > count)
86 {
87 result_count = count;
88 }
89 if (result_count)
90 {
91 get_chunk (first_used, result_count, data_buf);
92 first_used = (first_used + result_count) % buffer_size;
93 count -= result_count;
94 }
95 lock.unlock ();
96 return result_count;
97}
98
99// Doesn't remove data from buffer
100size_t DataBuffer::get_current_data (size_t max_count, double *data_buf)

Callers 7

get_board_dataMethod · 0.80
thread_workerMethod · 0.80
thread_workerMethod · 0.80
get_data_defaultMethod · 0.80
get_data_auxMethod · 0.80
get_data_ancMethod · 0.80
TESTFunction · 0.80

Calls 2

lockMethod · 0.45
unlockMethod · 0.45

Tested by 1

TESTFunction · 0.64