2016-01-27 06:40:11 +08:00
|
|
|
#pragma once
|
|
|
|
|
2016-08-11 11:47:30 +08:00
|
|
|
// !! DEPRICATED !!
|
|
|
|
// TODO: DELETE
|
|
|
|
|
2016-02-11 06:34:49 +08:00
|
|
|
#include <memory>
|
2016-06-06 17:29:52 +08:00
|
|
|
#include <string>
|
2016-02-22 05:21:15 +08:00
|
|
|
#include <unordered_map>
|
2016-06-06 17:29:52 +08:00
|
|
|
#include <vector>
|
2016-01-27 06:40:11 +08:00
|
|
|
|
2016-02-22 05:21:15 +08:00
|
|
|
#include "storage/model/properties/properties.hpp"
|
|
|
|
|
2016-08-25 22:29:45 +08:00
|
|
|
template <class TG>
|
2016-02-22 05:21:15 +08:00
|
|
|
struct ResultList
|
|
|
|
{
|
|
|
|
using sptr = std::shared_ptr<ResultList>;
|
2016-08-25 22:29:45 +08:00
|
|
|
using data_t = std::vector<const Properties<TG> *>;
|
2016-02-22 05:21:15 +08:00
|
|
|
|
2016-03-13 03:16:19 +08:00
|
|
|
ResultList() = default;
|
2016-06-06 17:29:52 +08:00
|
|
|
ResultList(ResultList &other) = delete;
|
|
|
|
ResultList(ResultList &&other) = default;
|
|
|
|
ResultList(data_t &&data) : data(std::forward<data_t>(data)) {}
|
2016-02-22 05:21:15 +08:00
|
|
|
|
2016-06-06 17:29:52 +08:00
|
|
|
explicit operator bool() const { return data.size() > 0; }
|
2016-03-13 03:16:19 +08:00
|
|
|
|
2016-08-25 22:29:45 +08:00
|
|
|
std::vector<const Properties<TG> *> data;
|
2016-02-22 05:21:15 +08:00
|
|
|
};
|
|
|
|
|
2016-08-25 22:29:45 +08:00
|
|
|
template <class TG>
|
2016-02-22 05:21:15 +08:00
|
|
|
struct QueryResult
|
2016-01-27 06:40:11 +08:00
|
|
|
{
|
2016-02-11 06:34:49 +08:00
|
|
|
using sptr = std::shared_ptr<QueryResult>;
|
2016-08-25 22:29:45 +08:00
|
|
|
using data_t =
|
|
|
|
std::unordered_map<std::string, typename ResultList<TG>::sptr>;
|
2016-02-22 05:21:15 +08:00
|
|
|
|
2016-03-13 03:16:19 +08:00
|
|
|
QueryResult() = default;
|
2016-06-06 17:29:52 +08:00
|
|
|
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
|
|
|
|
2016-06-06 17:29:52 +08:00
|
|
|
explicit operator bool() const { return data.size() > 0; }
|
2016-03-13 03:16:19 +08:00
|
|
|
|
2016-02-22 05:21:15 +08:00
|
|
|
data_t data;
|
2016-01-27 06:40:11 +08:00
|
|
|
};
|