[Bug/Feature] Missing serialization/deserialization of vector of
structs.
[Cause] N/A
[Solution] N/A
[Verification] Build, install, run tests
Change-Id: I562bb89550b4af5ce86c3f818738cb878830f828
FromKVStoreVisitor visitor(*this, name);
value.accept(visitor);
}
FromKVStoreVisitor visitor(*this, name);
value.accept(visitor);
}
+
+ template<typename T>
+ void getInternal(const std::string& name, std::vector<T>& values)
+ {
+ values.clear();
+ for (unsigned int i = 0;; ++i) {
+ const std::string k = key(name, std::to_string(i));
+ if (mStorePtr->count(k) == 0) {
+ return;
+ }
+ T value;
+ getInternal(k, value);
+ values.push_back(value);
+ }
+ }
ToKVStoreVisitor visitor(*this, name);
value.accept(visitor);
}
ToKVStoreVisitor visitor(*this, name);
value.accept(visitor);
}
+
+ template<typename T>
+ void setInternal(const std::string& name, const std::vector<T>& values)
+ {
+ mStorePtr->remove(name);
+ for (size_t i = 0; i < values.size(); ++i) {
+ setInternal(key(name, std::to_string(i)), values[i]);
+ }
+ }