public:
explicit FromKVStoreVisitor(const std::string& filePath, const std::string& prefix)
: mStorePtr(new KVStore(filePath)),
- mKeyPrefix(prefix)
+ mKeyPrefix(prefix),
+ mTransaction(mStorePtr->getTransaction())
{
}
FromKVStoreVisitor(const FromKVStoreVisitor& visitor, const std::string& prefix)
: mStorePtr(visitor.mStorePtr),
- mKeyPrefix(prefix)
+ mKeyPrefix(prefix),
+ mTransaction(visitor.mTransaction)
{
}
private:
std::shared_ptr<KVStore> mStorePtr;
std::string mKeyPrefix;
+ KVStore::Transaction mTransaction;
template<typename T, typename std::enable_if<!isVisitable<T>::value, int>::type = 0>
void getInternal(const std::string& name, T& value)
void getInternal(const std::string& name, std::vector<T>& values)
{
values.clear();
+
size_t vectorSize = mStorePtr->get<size_t>(name);
if (vectorSize == 0) {
return;