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

Method get_current_data

src/utils/data_buffer.cpp:100–113  ·  view source on GitHub ↗

Doesn't remove data from buffer

Source from the content-addressed store, hash-verified

98
99// Doesn't remove data from buffer
100size_t DataBuffer::get_current_data (size_t max_count, double *data_buf)
101{
102 lock.lock ();
103 size_t result_count = max_count;
104 if (result_count > count)
105 result_count = count;
106 if (result_count)
107 {
108 size_t first_return = (first_used + (count - result_count)) % buffer_size;
109 get_chunk (first_return, result_count, data_buf);
110 }
111 lock.unlock ();
112 return result_count;
113}
114
115size_t DataBuffer::get_data_count ()
116{

Callers 3

read_threadMethod · 0.80
TESTFunction · 0.80

Calls 2

lockMethod · 0.45
unlockMethod · 0.45

Tested by 1

TESTFunction · 0.64