-
Notifications
You must be signed in to change notification settings - Fork 46
/
QueryData.h
35 lines (25 loc) · 986 Bytes
/
QueryData.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#pragma once
#ifndef QUERYDATA_H
#define QUERYDATA_H
#include "QueryObject.h"
#include "DroidData.h"
#include "HumanData.h"
namespace graphql::learn {
class Query
{
public:
explicit Query(std::map<Episode, SharedHero>&& heroes,
std::map<response::IdType, std::shared_ptr<Human>>&& humans,
std::map<response::IdType, std::shared_ptr<Droid>>&& droids) noexcept;
std::shared_ptr<object::Character> getHero(std::optional<Episode> episodeArg) const noexcept;
std::shared_ptr<object::Human> getHuman(const response::IdType& idArg) const noexcept;
std::shared_ptr<object::Droid> getDroid(const response::IdType& idArg) const noexcept;
private:
const std::map<Episode, SharedHero> heroes_;
const std::map<response::IdType, std::shared_ptr<Human>> humans_;
const std::map<response::IdType, std::shared_ptr<Droid>> droids_;
};
} // namespace graphql::learn
#endif // QUERYDATA_H