25 #ifndef _ED247_STREAM_H_ 26 #define _ED247_STREAM_H_ 27 #include "ed247_xml.h" 28 #include "ed247_signal.h" 29 #include "ed247_sample.h" 41 class StreamAssistant;
50 uint32_t sample_size_size);
60 const std::string& get_name()
const {
return _configuration->_name; }
61 const std::string& get_icd()
const {
return _configuration->_icd; }
62 const std::string& get_comment()
const {
return _configuration->_comment; }
63 ed247_uid_t get_uid()
const {
return _configuration->_uid; }
66 uint32_t get_sample_max_size_bytes()
const {
return _configuration->_sample_max_size_bytes; }
67 uint32_t get_sample_max_number()
const {
return _configuration->_sample_max_number; }
68 uint32_t get_max_size()
const {
return _max_size; }
76 void set_user_data(
void *user_data) { _user_data = user_data; }
77 void get_user_data(
void **user_data) { *user_data = _user_data; }
81 bool is_signal_based()
const {
return _configuration->is_signal_based(); }
82 virtual uint32_t get_sampling_period_us() {
return 0; }
84 signal_list_t& get_signals() {
return _signals; }
86 signal_list_t find_signals(std::string str_regex);
87 signal_ptr_t get_signal(std::string str_name);
91 uint32_t get_incoming_sample_number() {
return _recv_stack.size(); }
92 uint32_t get_outgoing_sample_number() {
return _send_stack.size(); }
99 bool push_sample(
const void* sample_data, uint32_t sample_size,
110 uint32_t encode(
char* frame, uint32_t frame_size);
119 bool run_callbacks();
125 uint32_t _sample_size_size;
126 uint32_t _sample_first_header_size;
127 uint32_t _sample_next_header_size;
129 signal_list_t _signals;
130 std::unique_ptr<ed247_internal_signal_list_t> _client_signals;
131 std::unique_ptr<StreamAssistant> _assistant;
140 struct CallbackData {
144 std::vector<CallbackData> _callbacks;
156 uint32_t get_sampling_period_us()
override {
return ((
xml::StreamSignals*)_configuration)->_sampling_period_us; }
160 typedef std::shared_ptr<Stream> stream_ptr_t;
161 typedef std::vector<stream_ptr_t> stream_list_t;
162 typedef std::unordered_map<std::string, stream_ptr_t> stream_map_t;
179 stream_ptr_t
get(std::string name);
180 stream_list_t find(std::string regex);
182 stream_map_t& streams() {
return _streams; }
183 uint32_t size()
const {
return _streams.size(); }
185 stream_list_t& get_streams_signals_output() {
return _streams_signals_output; }
186 stream_list_t& get_streams_signals_input() {
return _streams_signals_input; }
189 stream_map_t _streams;
190 stream_list_t _streams_signals_output;
191 stream_list_t _streams_signals_input;
Definition: ed247_stream.h:153
ed247_direction_t
Stream direction.
Definition: ed247.h:153
Definition: ed247_stream.h:168
Definition: ed247_channel.h:34
Timestamp structure, seconds from EPOCH (January 1st 1970) and nanoseconds offset with reference to p...
Definition: ed247.h:209
uint16_t ed247_uid_t
Unique identifier type.
Definition: ed247.h:115
Definition: ed247_sample.h:107
Definition: ed247_stream.h:34
Definition: ed247_context.h:36
Definition: ed247_sample.h:56
Definition: ed247_stream.h:43
Definition: ed247_stream.h:33
Definition: ed247_xml.h:147
Definition: ed247_signal.h:37
ed247_status_t
Status codes.
Definition: ed247.h:67
Definition: ed247_channel.cpp:37
ed247_stream_type_t
Stream types.
Definition: ed247.h:132
ed247_status_t(* ed247_stream_recv_callback_t)(ed247_context_t context, ed247_stream_t stream)
Stream receive callback function pointer.
Definition: ed247.h:615
Definition: ed247_stream_assistant.h:11
Definition: ed247_stream_assistant.h:20
Definition: ed247_xml.h:173
Sample Details.
Definition: ed247.h:909
Definition: ed247_context.h:31