memgraph/include/query_engine/query_result.hpp

45 lines
1.1 KiB
C++
Raw Normal View History

#pragma once
// !! DEPRICATED !!
// TODO: DELETE
2016-02-11 06:34:49 +08:00
#include <memory>
#include <string>
#include <unordered_map>
#include <vector>
#include "storage/model/properties/properties.hpp"
template <class TG>
struct ResultList
{
using sptr = std::shared_ptr<ResultList>;
using data_t = std::vector<const Properties<TG> *>;
2016-03-13 03:16:19 +08:00
ResultList() = default;
ResultList(ResultList &other) = delete;
ResultList(ResultList &&other) = default;
ResultList(data_t &&data) : data(std::forward<data_t>(data)) {}
explicit operator bool() const { return data.size() > 0; }
2016-03-13 03:16:19 +08:00
std::vector<const Properties<TG> *> data;
};
template <class TG>
struct QueryResult
{
2016-02-11 06:34:49 +08:00
using sptr = std::shared_ptr<QueryResult>;
using data_t =
std::unordered_map<std::string, typename ResultList<TG>::sptr>;
2016-03-13 03:16:19 +08:00
QueryResult() = default;
QueryResult(QueryResult &other) = delete;
QueryResult(QueryResult &&other) = default;
QueryResult(data_t &&data) : data(std::forward<data_t>(data)) {}
2016-02-11 06:34:49 +08:00
explicit operator bool() const { return data.size() > 0; }
2016-03-13 03:16:19 +08:00
data_t data;
};