1 #ifndef MESSAGEPARSER_TEMPLATE_H 2 #define MESSAGEPARSER_TEMPLATE_H 6 #include <unordered_map> 7 #include <unordered_set> 50 virtual const std::unordered_set<std::string>& getCompatibleKeys()
const = 0;
52 virtual void pushMessageRef(
const std::string& key,
54 double timestamp) = 0;
57 const std::string& prefix) = 0;
62 const std::string& field_name,
65 if( in_data.
size() == 0 )
69 auto plot_pair = destination_plot_map.
numeric.find( field_name );
70 if( (plot_pair == destination_plot_map.
numeric.end()) )
72 plot_pair = destination_plot_map.
addNumeric( field_name );
73 plot_pair->second.swapData( in_data );
76 PlotData& plot_data = plot_pair->second;
77 for(
size_t i=0;
i < in_data.
size();
i++)
79 double val = in_data[
i].y;
80 if( !std::isnan(val) && !std::isinf(val) )
92 #define MessageParser_iid "com.icarustechnology.PlotJuggler.MessageParser" std::unordered_map< std::string, PlotData > numeric
MessageRef(const uint8_t *first_ptr, size_t size)
MessageRef(const std::vector< uint8_t > &vect)
const uint8_t * data() const
virtual size_t size() const
#define MessageParser_iid
std::unordered_map< std::string, PlotData >::iterator addNumeric(const std::string &name)
static void appendData(PlotDataMapRef &destination_plot_map, const std::string &field_name, PlotData &in_data)
const uint8_t * _first_ptr
The MessageParser is the base class to create plugins that are able to parse one or multiple Message ...