chromium/mojo/public/cpp/bindings/array_data_view.h

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

#ifndef MOJO_PUBLIC_CPP_BINDINGS_ARRAY_DATA_VIEW_H_
#define MOJO_PUBLIC_CPP_BINDINGS_ARRAY_DATA_VIEW_H_

#include <type_traits>

#include "base/memory/raw_ptr_exclusion.h"
#include "mojo/public/cpp/bindings/lib/array_internal.h"
#include "mojo/public/cpp/bindings/lib/bindings_internal.h"
#include "mojo/public/cpp/bindings/lib/serialization_forward.h"

namespace mojo {

class Message;

namespace internal {

template <typename T, typename EnableType = void>
class ArrayDataViewImpl;

ArrayDataViewImpl<T, typename std::enable_if<BelongsTo<T, MojomTypeCategory::kPOD>::value>::type>;

ArrayDataViewImpl<T, typename std::enable_if<BelongsTo<T, MojomTypeCategory::kBoolean>::value>::type>;

ArrayDataViewImpl<T, typename std::enable_if<BelongsTo<T, MojomTypeCategory::kEnum>::value>::type>;

ArrayDataViewImpl<T, typename std::enable_if<BelongsTo<T, MojomTypeCategory::kEnum>::value>::type>;

ArrayDataViewImpl<T, typename std::enable_if<BelongsTo<T, MojomTypeCategory::kAssociatedInterface | MojomTypeCategory::kAssociatedInterfaceRequest | MojomTypeCategory::kInterface | MojomTypeCategory::kInterfaceRequest>::value>::type>;

ArrayDataViewImpl<T, typename std::enable_if<BelongsTo<T, MojomTypeCategory::kHandle>::value>::type>;

ArrayDataViewImpl<T, typename std::enable_if<BelongsTo<T, MojomTypeCategory::kArray | MojomTypeCategory::kMap | MojomTypeCategory::kString | MojomTypeCategory::kStruct>::value>::type>;

ArrayDataViewImpl<T, typename std::enable_if<BelongsTo<T, MojomTypeCategory::kUnion>::value>::type>;

}  // namespace internal

template <typename K, typename V>
class MapDataView;

template <typename T>
class ArrayDataView : public internal::ArrayDataViewImpl<T> {};

}  // namespace mojo

#endif  // MOJO_PUBLIC_CPP_BINDINGS_ARRAY_DATA_VIEW_H_