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 
18  std::string getName();
19  std::string getType();
21 
22  private:
23  std::string type;
24  std::string name;
25  SlaveIdentifierConfig identifier;
26  };
27 
28  class SlaveConfig : public Config
29  {
30  public:
32  std::optional<std::string> type,
33  std::optional<std::string> name);
34 
36  std::optional<std::string> type,
37  std::optional<std::string> name,
38  std::shared_ptr<SlaveProfile> profile);
39 
40  virtual ~SlaveConfig() = default;
41 
43 
44  std::optional<std::string> getType() const;
45 
46  std::optional<std::string> getName() const;
47 
48  bool checkAllItemsRead(std::vector<std::string>& errors) const override;
49 
50  void print(std::stringstream& s, int indention) const override;
51 
52  void onParsingFinished() override;
53 
54  private:
55  SlaveIdentifierConfig identifier;
56  std::optional<std::string> type;
57  std::optional<std::string> name;
58  bool identifierRead = false;
59  };
60 
61  enum SlaveType
62  {
65  };
66 } // 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:63
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:93
armarx::control::hardware_config::SlaveConfig
Definition: SlaveConfig.h:28
armarx::control::hardware_config::SlaveConfig::~SlaveConfig
virtual ~SlaveConfig()=default
armarx::control::hardware_config::WithoutType
@ WithoutType
Definition: SlaveConfig.h:64
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:61