3 #ifndef _ED247_SAMPLE_H_ 4 #define _ED247_SAMPLE_H_ 31 void allocate(uint32_t capacity);
33 const uint32_t& size()
const {
return _size; }
34 const uint32_t& capacity()
const {
return _capacity; }
35 const char* data()
const {
return _data; }
36 bool empty()
const {
return _size == 0; }
39 bool copy(
const char* data,
const uint32_t& size);
40 bool copy(
const void* data,
const uint32_t& size) {
return copy((
const char*)data, size); }
43 char* data_rw() {
return _data; }
44 void set_size(
const uint32_t & size) { _size = size; }
45 void reset() { _size = 0; }
61 _data_timestamp(LIBED247_TIMESTAMP_DEFAULT),
62 _recv_timestamp(LIBED247_TIMESTAMP_DEFAULT),
63 _frame_details(LIBED247_SAMPLE_DETAILS_DEFAULT)
73 _data_timestamp(std::move(other._data_timestamp)),
74 _recv_timestamp(std::move(other._recv_timestamp)),
75 _frame_details(std::move(other._frame_details))
84 void set_data_timestamp(
const ed247_timestamp_t& data_timestamp) { _data_timestamp = data_timestamp; }
85 void set_recv_timestamp(
const ed247_timestamp_t& recv_timestamp) { _recv_timestamp = recv_timestamp; }
100 using Sample::allocate;
112 uint32_t capacity()
const {
return _samples.size(); }
113 uint32_t samples_capacity()
const {
return _samples_capacity; }
114 uint32_t size()
const {
return _index_size; }
115 bool empty()
const {
return _index_size == 0; }
116 bool full()
const {
return _index_size >= _samples.size(); }
136 return _samples[_index_write == 0 ? (_samples.size()-1) : (_index_write-1)];
143 return _samples[(_index_read + index) % _samples.size()];
147 std::vector<StreamSample> _samples;
148 uint32_t _samples_capacity;
149 uint32_t _index_read;
150 uint32_t _index_write;
151 uint32_t _index_size;
Definition: ed247_sample.h:14
Timestamp structure, seconds from EPOCH (January 1st 1970) and nanoseconds offset with reference to p...
Definition: ed247.h:209
LIBED247_EXPORT void ed247_get_receive_timestamp(ed247_timestamp_t *timestamp)
Return the time to timestamp the incoming streams.
Definition: ed247_time.cpp:107
Definition: ed247_sample.h:107
Definition: ed247_sample.h:56
Definition: ed247_channel.cpp:37
Sample Details.
Definition: ed247.h:909