7 std::optional<std::string> type,
8 std::optional<std::string> name) :
9 identifier(identifier), type(type), name(name)
14 std::optional<std::string> type,
15 std::optional<std::string> name,
16 std::shared_ptr<SlaveProfile> profile) :
17 identifier(identifier), type(type), name(name)
19 this->
items = profile->items;
25 identifierRead =
true;
29 std::optional<std::string>
35 std::optional<std::string>
50 s <<
"Identifier of slave not read. ";
51 s <<
"Identifier details: " << identifier;
52 errors.push_back(s.str());
61 for (
int i = 0; i < indention; i++)
65 s <<
"Slave:" << std::endl;
66 for (
int i = 0; i < indention + 1; i++)
70 s <<
"Type: " <<
getType().value_or(
"<no type>") << std::endl;
71 for (
int i = 0; i < indention + 1; i++)
75 s <<
"Name: " <<
getName().value_or(
"<no name>") << std::endl;
76 for (
int i = 0; i < indention + 1; i++)
80 s <<
"Identifier: " << identifier << std::endl;
82 for (
int i = 0; i < indention + 1; i++)
86 s <<
"Config:" << std::endl;
93 identifierRead =
false;
virtual void print(std::stringstream &s, int indention) const
Print this configuration.
virtual bool checkAllItemsRead(std::vector< std::string > &errors) const
This method is called once the device has read the configuration data it needs.
std::map< std::string, ConfigItemWithMetadata > items
std::optional< std::string > getType() const
bool checkAllItemsRead(std::vector< std::string > &errors) const override
This method is called once the device has read the configuration data it needs.
SlaveIdentifierConfig & getIdentifier()
void onParsingFinished() override
This method is called when the config is completely read form the HardwareConfig file.
void print(std::stringstream &s, int indention) const override
Print this configuration.
SlaveConfig(SlaveIdentifierConfig identifier, std::optional< std::string > type, std::optional< std::string > name)
std::optional< std::string > getName() const
Data structure holding the information necessary to create a SlaveIdentifier.
SlaveIdentifierConfig & getIdentifier()