MCPcopy Create free account
hub / github.com/bytedance/Fastbot_Android / fillDetails

Method fillDetails

native/desc/State.cpp:143–171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

141 }
142
143 void State::fillDetails(const std::shared_ptr<State> &copy) {
144 for (auto widgetPtr: this->_widgets) {
145 auto widgetIterator = std::find_if(copy->_widgets.begin(), copy->_widgets.end(),
146 [&widgetPtr](const WidgetPtr &cw) {
147 return *(cw.get()) == *widgetPtr;
148 });
149 if (widgetIterator != copy->_widgets.end()) {
150 widgetPtr->fillDetails(*widgetIterator);
151 } else {
152 LOGE("ERROR can not refill widget");
153 }
154 }
155 for (const auto &miter: this->_mergedWidgets) {
156 auto mkw = copy->_mergedWidgets.find(miter.first);
157 if (mkw == copy->_mergedWidgets.end())
158 continue;
159 for (auto widgetPtr: miter.second) {
160 auto widgetIterator = std::find_if((*mkw).second.begin(), (*mkw).second.end(),
161 [&widgetPtr](const WidgetPtr &cw) {
162 return *(cw.get()) == *widgetPtr;
163 });
164 if (widgetIterator != (*mkw).second.end()) {
165 widgetPtr->fillDetails(*widgetIterator);
166 }
167 }
168
169 }
170 _hasNoDetail = false;
171 }
172
173 std::string State::toString() const {
174 std::string ret("{state: " + std::to_string(this->hash()) + "\n widgets: \n");

Callers 1

addStateMethod · 0.45

Calls 3

beginMethod · 0.45
endMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected