// 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 MOJO_PUBLIC_CPP_BINDINGS_NATIVE_STRUCT_H_ #define MOJO_PUBLIC_CPP_BINDINGS_NATIVE_STRUCT_H_ #include "mojo/public/cpp/bindings/array.h" #include "mojo/public/cpp/bindings/lib/native_struct_data.h" #include "mojo/public/cpp/bindings/struct_ptr.h" #include "mojo/public/cpp/bindings/type_converter.h" namespace mojo { class NativeStruct; using NativeStructPtr = StructPtr; // Native-only structs correspond to "[Native] struct Foo;" definitions in // mojom. class NativeStruct { public: using Data_ = internal::NativeStruct_Data; static NativeStructPtr New(); template static NativeStructPtr From(const U& u) { return TypeConverter::Convert(u); } template U To() const { return TypeConverter::Convert(*this); } NativeStruct(); ~NativeStruct(); NativeStructPtr Clone() const; bool Equals(const NativeStruct& other) const; Array data; }; } // namespace mojo #endif // MOJO_PUBLIC_CPP_BINDINGS_NATIVE_STRUCT_H_