MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / AddUnit

Method AddUnit

lib/mdflib/mdflib/src/hounitspecification.cpp:73–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71}
72
73void HoUnitSpecification::AddUnit(HoUnit unit) {
74 const std::string& key = unit.Identity() ;
75 if (key.empty()) {
76 MDF_ERROR() << "A unit must have an identity.";
77 return;
78 }
79
80 if (const auto itr = unit_list_.find(key);
81 itr != unit_list_.cend() ) {
82 MDF_ERROR() << "The unit is already defined. Short Name: " << key;
83 return;
84 }
85 unit_list_.emplace(key,std::move(unit));
86}
87
88const HoUnitList& HoUnitSpecification::Units() const {
89 return unit_list_;

Callers 2

TESTFunction · 0.80
TEST_FFunction · 0.80

Calls 4

emptyMethod · 0.80
findMethod · 0.80
cendMethod · 0.80
IdentityMethod · 0.45

Tested by

no test coverage detected