aboutsummaryrefslogtreecommitdiff
path: root/deps/v8/third_party/inspector_protocol/lib/Forward_h.template
blob: 7cc47b4f0f09f2193e42ee7b5e040cbd36a51036 (plain)
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
// This file is generated by Forward_h.template.

// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef {{"_".join(config.protocol.namespace)}}_Forward_h
#define {{"_".join(config.protocol.namespace)}}_Forward_h

{% if config.lib.export_header %}
#include {{format_include(config.lib.export_header)}}
{% endif %}
#include {{format_include(config.lib.string_header)}}

#include <cstddef>
#include <memory>
#include <vector>
#include <unordered_map>
#include <unordered_set>

#include "{{config.bindings_lib.header}}"

{% for namespace in config.protocol.namespace %}
namespace {{namespace}} {
{% endfor %}

class DictionaryValue;
class DispatchResponse;
class ErrorSupport;
class FundamentalValue;
class ListValue;
class Object;
using Response = DispatchResponse;
class SerializedValue;
class StringValue;
class UberDispatcher;
class Value;

namespace detail {
template <typename T>
struct ArrayTypedef { typedef std::vector<std::unique_ptr<T>> type; };

template <>
struct ArrayTypedef<String> { typedef std::vector<String> type; };

template <>
struct ArrayTypedef<int> { typedef std::vector<int> type; };

template <>
struct ArrayTypedef<double> { typedef std::vector<double> type; };

template <>
struct ArrayTypedef<bool> { typedef std::vector<bool> type; };
}  // namespace detail

template <typename T>
using Array = typename detail::ArrayTypedef<T>::type;

namespace detail {
using {{config.bindings_lib.namespace}}::glue::detail::PtrMaybe;
using {{config.bindings_lib.namespace}}::glue::detail::ValueMaybe;

template <typename T>
struct MaybeTypedef { typedef PtrMaybe<T> type; };

template <>
struct MaybeTypedef<bool> { typedef ValueMaybe<bool> type; };

template <>
struct MaybeTypedef<int> { typedef ValueMaybe<int> type; };

template <>
struct MaybeTypedef<double> { typedef ValueMaybe<double> type; };

template <>
struct MaybeTypedef<String> { typedef ValueMaybe<String> type; };

template <>
struct MaybeTypedef<Binary> { typedef ValueMaybe<Binary> type; };
}  // namespace detail

template <typename T>
using Maybe = typename detail::MaybeTypedef<T>::type;

{% for namespace in config.protocol.namespace %}
} // namespace {{namespace}}
{% endfor %}

#endif // !defined({{"_".join(config.protocol.namespace)}}_Forward_h)