SlaveConfig.h
Go to the documentation of this file.
1 #pragma once
2 
5 
7 {
8  class SlaveProfile : public Config
9  {
10  friend class SlaveConfig;
11 
12  public:
13  SlaveProfile(SlaveIdentifierConfig identifier, std::string type, std::string name) :
14  type(type), name(name), identifier(identifier)
15  {
16  }
17  std::string getName();
18  std::string getType();
20 
21  private:
22  std::string type;
23  std::string name;
24  SlaveIdentifierConfig identifier;
25  };
26 
27  class SlaveConfig : public Config
28  {
29  public:
31  std::optional<std::string> type,
32  std::optional<std::string> name);
33 
35  std::optional<std::string> type,
36  std::optional<std::string> name,
37  std::shared_ptr<SlaveProfile> profile);
38 
39  virtual ~SlaveConfig() = default;
40 
42 
43  std::optional<std::string> getType() const;
44 
45  std::optional<std::string> getName() const;
46 
47  bool checkAllItemsRead(std::vector<std::string>& errors) const override;
48 
49  void print(std::stringstream& s, int indention) const override;
50 
51  void onParsingFinished() override;
52 
53  private:
54  SlaveIdentifierConfig identifier;
55  std::optional<std::string> type;
56  std::optional<std::string> name;
57  bool identifierRead = false;
58  };
59 
60  enum SlaveType
61  {
64  };
65 } // namespace armarx::control::hardware_config
armarx::control::hardware_config::SlaveConfig::onParsingFinished
void onParsingFinished() override
This method is called when the config is completely read form the HardwareConfig file.
Definition: SlaveConfig.cpp:91
armarx::control::hardware_config::SlaveIdentifierConfig
Data structure holding the information necessary to create a SlaveIdentifier.
Definition: SlaveIdentifierConfig.h:15
armarx::control::hardware_config::SlaveProfile::getType
std::string getType()
Definition: SlaveConfig.cpp:103
armarx::control::hardware_config::SlaveProfile
Definition: SlaveConfig.h:8
armarx::control::hardware_config::WithType
@ WithType
Definition: SlaveConfig.h:62
armarx::control::hardware_config::SlaveProfile::getName
std::string getName()
Definition: SlaveConfig.cpp:97
armarx::control::hardware_config::SlaveProfile::getIdentifier
SlaveIdentifierConfig & getIdentifier()
Definition: SlaveConfig.cpp:109
armarx::control::hardware_config
Definition: Config.cpp:3
armarx::control::hardware_config::SlaveProfile::SlaveProfile
SlaveProfile(SlaveIdentifierConfig identifier, std::string type, std::string name)
Definition: SlaveConfig.h:13
armarx::control::hardware_config::SlaveConfig::getName
std::optional< std::string > getName() const
Definition: SlaveConfig.cpp:36
armarx::control::hardware_config::SlaveConfig::SlaveConfig
SlaveConfig(SlaveIdentifierConfig identifier, std::optional< std::string > type, std::optional< std::string > name)
Definition: SlaveConfig.cpp:6
SlaveIdentifierConfig.h
Config.h
armarx::control::hardware_config::SlaveConfig::getIdentifier
SlaveIdentifierConfig & getIdentifier()
Definition: SlaveConfig.cpp:23
armarx::control::hardware_config::SlaveConfig::print
void print(std::stringstream &s, int indention) const override
Print this configuration.
Definition: SlaveConfig.cpp:59
armarx::control::hardware_config::SlaveConfig::checkAllItemsRead
bool checkAllItemsRead(std::vector< std::string > &errors) const override
This method is called once the device has read the configuration data it needs.
Definition: SlaveConfig.cpp:42
armarx::control::hardware_config::Config
The Config class is the base class of all specialized configurations that have a direct key -> value ...
Definition: Config.h:91
armarx::control::hardware_config::SlaveConfig
Definition: SlaveConfig.h:27
armarx::control::hardware_config::SlaveConfig::~SlaveConfig
virtual ~SlaveConfig()=default
armarx::control::hardware_config::WithoutType
@ WithoutType
Definition: SlaveConfig.h:63
armarx::control::hardware_config::SlaveConfig::getType
std::optional< std::string > getType() const
Definition: SlaveConfig.cpp:30
armarx::ctrlutil::s
double s(double t, double s0, double v0, double a0, double j)
Definition: CtrlUtil.h:33
armarx::control::hardware_config::SlaveType
SlaveType
Definition: SlaveConfig.h:60