communicationconfig.h
Go to the documentation of this file.
1 
7 #ifndef COMMUNICATIONCONFIG_H
8 #define COMMUNICATIONCONFIG_H
9 
12 #include <string>
13 #include <unordered_map>
14 #include <yaml-cpp/yaml.h>
15 #include <utility>
16 #include <vector>
17 #include <boost/algorithm/string.hpp>
18 #include <unordered_set>
20 
28 {
29  unsigned int baudRate;
30  std::string deviceTag;
31  unsigned int serialTimeout;
32  unsigned int maxLineLength;
33  std::string serialDevicesFolder;
34 };
35 
49 {
50 public:
61  CommunicationConfig(std::string configPath);
68  friend void operator>>(const YAML::Node& node, Syntax& syntax);
76  friend void operator>>(const YAML::Node& node,
77  SerialInterfaceParams& serialParams);
85  friend void operator>>(
86  const YAML::Node& node,
87  std::unordered_map<std::string, std::shared_ptr<Channel>>& channels);
95  friend void
96  operator>>(const YAML::Node& node,
97  std::unordered_map<std::string, std::shared_ptr<CommandOptions>>&
98  options);
99 
104  const std::shared_ptr<Syntax> getSyntax() const;
109  const std::shared_ptr<SerialInterfaceParams> getSerialInterfaceParams() const;
114  const std::unordered_map<std::string, std::shared_ptr<Command>>&
115  getCommands() const;
120  const std::unordered_map<unsigned char, std::shared_ptr<SensorGroup>>&
121  getSensorGroups() const;
122 
123 private:
124  std::string configPath;
125  std::unordered_map<std::string, std::shared_ptr<Command>>
127  std::unordered_map<unsigned char, std::shared_ptr<SensorGroup>>
130  std::unordered_map<std::string, std::shared_ptr<Channel>>
132  std::unordered_map<std::string, std::shared_ptr<CommandOptions>>
144  void insertCommand(const YAML::Node& node);
151  void insertSensorGroup(const YAML::Node& node);
156  void readSerialInterfaceConfig();
161  void readGeneralSyntax();
166  void readChannels();
171  void readOptions();
176  void readCommands();
181  void readSensorGroups();
182 };
183 
184 #endif // COMMUNICATIONCONFIG_H
std::unordered_map< std::string, std::shared_ptr< Command > > commands
Header file for the Command class.
The Syntax class serves as a data struct to provide information about important symbols for the commu...
Definition: syntax.h:21
Header file for the SensorGroup class.
std::unordered_map< std::string, std::shared_ptr< CommandOptions > > options
The SerialInterfaceParams class serves as a data struct to configure the setup of a serial connection...
std::unordered_map< unsigned char, std::shared_ptr< SensorGroup > > sensorGroups
std::unordered_map< std::string, std::shared_ptr< Channel > > channels
The CommunicationConfig class parses config files and provides configuration parameters to a Communca...
SerialInterfaceParams serialParams
void operator>>(const YAML::Node &node, Syntax &syntax)
Header file for the Syntax struct.


pses_ucbridge
Author(s): Sebastian Ehmes
autogenerated on Sat Oct 28 2017 19:16:13