| // 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.crdtp.dir}}/glue.h" |
| |
| {% 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.crdtp.namespace}}::glue::detail::PtrMaybe; |
| using {{config.crdtp.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) |