ros_parser.h
Go to the documentation of this file.
1 #ifndef INTROSPECTIONPARSER_H
2 #define INTROSPECTIONPARSER_H
3 
4 #include "ros_parser_base.h"
6 
8 {
9 public:
11 
12  void clear();
13 
14  void setMaxArrayPolicy(size_t max_array_size,
15  bool discard_entire_array);
16 
18  {
19  for(const auto& it: rules)
20  {
21  _introspection_parser->registerRenamingRules(
22  RosIntrospection::ROSType(it.first) ,
23  it.second );
24  }
25  }
26 
27  bool registerSchema(const std::string& topic_name,
28  const std::string& md5sum,
30  const std::string& definition);
31 
32  virtual const std::unordered_set<std::string>& getCompatibleKeys() const override
33  {
34  return _registered_md5sum;
35  }
36 
37 
38  void pushMessageRef(const std::string& topic_name,
39  const MessageRef& msg,
40  double timestamp) override;
41 
42  void showWarnings();
43 
44  virtual void extractData(PlotDataMapRef& destination,
45  const std::string& prefix) override;
46 
47  typedef std::unordered_map<std::string, std::unique_ptr<RosParserBase> > ParsersMap;
48 
49 private:
50  std::unordered_set<std::string> _registered_md5sum;
51  std::unique_ptr<RosIntrospection::Parser> _introspection_parser;
53 
54  ParsersMap _builtin_parsers;
55 
56  uint32_t _max_array_size;
59 
60  std::unordered_set<std::string> _warn_cancellation;
61  std::unordered_set<std::string> _warn_max_arraysize;
62 
63  double extractRealValue( const RosIntrospection::Variant& value,
64  const std::string& item_name);
65 };
66 
67 #endif // INTROSPECTIONPARSER_H
std::unordered_set< std::string > _warn_cancellation
Definition: ros_parser.h:60
double extractRealValue(const RosIntrospection::Variant &value, const std::string &item_name)
Definition: ros_parser.cpp:24
PlotDataMapRef _plot_map
Definition: ros_parser.h:52
virtual const std::unordered_set< std::string > & getCompatibleKeys() const override
Definition: ros_parser.h:32
std::unordered_set< std::string > _registered_md5sum
Definition: ros_parser.h:50
std::unordered_set< std::string > _warn_max_arraysize
Definition: ros_parser.h:61
bool _discard_large_array
Definition: ros_parser.h:58
std::map< ROSType, std::vector< SubstitutionRule > > SubstitutionRuleMap
void setMaxArrayPolicy(size_t max_array_size, bool discard_entire_array)
Definition: ros_parser.cpp:58
void pushMessageRef(const std::string &topic_name, const MessageRef &msg, double timestamp) override
Definition: ros_parser.cpp:104
virtual void extractData(PlotDataMapRef &destination, const std::string &prefix) override
Definition: ros_parser.cpp:240
uint32_t _max_array_size
Definition: ros_parser.h:56
const char * msg
bool _warnings_enabled
Definition: ros_parser.h:57
std::unordered_map< std::string, std::unique_ptr< RosParserBase > > ParsersMap
Definition: ros_parser.h:47
ParsersMap _builtin_parsers
Definition: ros_parser.h:54
std::unique_ptr< RosIntrospection::Parser > _introspection_parser
Definition: ros_parser.h:51
void addRules(const RosIntrospection::SubstitutionRuleMap &rules)
Definition: ros_parser.h:17
bool registerSchema(const std::string &topic_name, const std::string &md5sum, RosIntrospection::ROSType type, const std::string &definition)
Definition: ros_parser.cpp:83


plotjuggler
Author(s): Davide Faconti
autogenerated on Sat Jul 6 2019 03:44:18