Index: mojo/public/cpp/bindings/gen/sample_service.mojom.h |
diff --git a/mojo/public/cpp/bindings/gen/sample_service.mojom.h b/mojo/public/cpp/bindings/gen/sample_service.mojom.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..0544fee1464900259178435b71e50db8814d919a |
--- /dev/null |
+++ b/mojo/public/cpp/bindings/gen/sample_service.mojom.h |
@@ -0,0 +1,431 @@ |
+// Copyright 2013 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_INTERFACES_BINDINGS_TESTS_SAMPLE_SERVICE_MOJOM_H_ |
+#define MOJO_PUBLIC_INTERFACES_BINDINGS_TESTS_SAMPLE_SERVICE_MOJOM_H_ |
+ |
+#include "mojo/public/cpp/bindings/array.h" |
+#include "mojo/public/cpp/bindings/callback.h" |
+#include "mojo/public/cpp/bindings/interface_impl.h" |
+#include "mojo/public/cpp/bindings/interface_ptr.h" |
+#include "mojo/public/cpp/bindings/message_filter.h" |
+#include "mojo/public/cpp/bindings/no_interface.h" |
+#include "mojo/public/cpp/bindings/string.h" |
+#include "mojo/public/cpp/bindings/struct_ptr.h" |
+#include "mojo/public/interfaces/bindings/tests/sample_service.mojom-internal.h" |
+#include "mojo/public/interfaces/bindings/tests/sample_import.mojom.h" |
+#include "mojo/public/interfaces/bindings/tests/sample_import2.mojom.h" |
+namespace sample { |
+ |
+extern const uint8_t kThree; |
+ |
+class Service; |
+typedef mojo::InterfacePtr<Service> ServicePtr; |
+ |
+class ServiceClient; |
+typedef mojo::InterfacePtr<ServiceClient> ServiceClientPtr; |
+ |
+class Port; |
+typedef mojo::InterfacePtr<Port> PortPtr; |
+ |
+class Bar; |
+ |
+typedef mojo::InlinedStructPtr<Bar> BarPtr; |
+ |
+class Bar { |
+ public: |
+ typedef internal::Bar_Data Data_; |
+ enum Type { |
+ TYPE_VERTICAL = 1<<0, |
+ TYPE_HORIZONTAL = (1<<1)+0, |
+ TYPE_BOTH = Bar::TYPE_VERTICAL|Bar::TYPE_HORIZONTAL, |
+ TYPE_INVALID, |
+ }; |
+ static BarPtr New(); |
+ |
+ template <typename U> |
+ static BarPtr From(const U& u) { |
+ return mojo::TypeConverter<BarPtr, U>::ConvertFrom(u); |
+ } |
+ |
+ Bar(); |
+ ~Bar(); |
+ |
+ uint8_t alpha; |
+ uint8_t beta; |
+ uint8_t gamma; |
+ Bar::Type type; |
+}; |
+ |
+ |
+ |
+class Foo; |
+ |
+typedef mojo::StructPtr<Foo> FooPtr; |
+ |
+ |
+class DefaultsTestInner; |
+ |
+typedef mojo::InlinedStructPtr<DefaultsTestInner> DefaultsTestInnerPtr; |
+ |
+class DefaultsTestInner { |
+ public: |
+ typedef internal::DefaultsTestInner_Data Data_; |
+ static DefaultsTestInnerPtr New(); |
+ |
+ template <typename U> |
+ static DefaultsTestInnerPtr From(const U& u) { |
+ return mojo::TypeConverter<DefaultsTestInnerPtr, U>::ConvertFrom(u); |
+ } |
+ |
+ DefaultsTestInner(); |
+ ~DefaultsTestInner(); |
+ |
+ int32_t x; |
+}; |
+ |
+ |
+ |
+class DefaultsTest; |
+ |
+typedef mojo::StructPtr<DefaultsTest> DefaultsTestPtr; |
+ |
+ |
+class StructWithHoleV1; |
+ |
+typedef mojo::InlinedStructPtr<StructWithHoleV1> StructWithHoleV1Ptr; |
+ |
+class StructWithHoleV1 { |
+ public: |
+ typedef internal::StructWithHoleV1_Data Data_; |
+ static StructWithHoleV1Ptr New(); |
+ |
+ template <typename U> |
+ static StructWithHoleV1Ptr From(const U& u) { |
+ return mojo::TypeConverter<StructWithHoleV1Ptr, U>::ConvertFrom(u); |
+ } |
+ |
+ StructWithHoleV1(); |
+ ~StructWithHoleV1(); |
+ |
+ int32_t v1; |
+ int64_t v2; |
+}; |
+ |
+ |
+ |
+class StructWithHoleV2; |
+ |
+typedef mojo::InlinedStructPtr<StructWithHoleV2> StructWithHoleV2Ptr; |
+ |
+class StructWithHoleV2 { |
+ public: |
+ typedef internal::StructWithHoleV2_Data Data_; |
+ static StructWithHoleV2Ptr New(); |
+ |
+ template <typename U> |
+ static StructWithHoleV2Ptr From(const U& u) { |
+ return mojo::TypeConverter<StructWithHoleV2Ptr, U>::ConvertFrom(u); |
+ } |
+ |
+ StructWithHoleV2(); |
+ ~StructWithHoleV2(); |
+ |
+ int32_t v1; |
+ int64_t v2; |
+ int32_t v3; |
qsr
2014/05/27 07:00:46
I might be missing something obvious, but shouldn'
darin (slow to review)
2014/05/27 18:01:23
These structs do not need to be packed. They are j
|
+}; |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+class Foo { |
+ public: |
+ typedef internal::Foo_Data Data_; |
+ static const char* kFooby; |
+ static FooPtr New(); |
+ |
+ template <typename U> |
+ static FooPtr From(const U& u) { |
+ return mojo::TypeConverter<FooPtr, U>::ConvertFrom(u); |
+ } |
+ |
+ Foo(); |
+ ~Foo(); |
+ |
+ mojo::String name; |
+ int32_t x; |
+ int32_t y; |
+ bool a; |
+ bool b; |
+ bool c; |
+ BarPtr bar; |
+ mojo::Array<BarPtr> extra_bars; |
+ mojo::Array<uint8_t> data; |
+ mojo::ScopedMessagePipeHandle source; |
+ mojo::Array<mojo::ScopedDataPipeConsumerHandle> input_streams; |
+ mojo::Array<mojo::ScopedDataPipeProducerHandle> output_streams; |
+ mojo::Array<mojo::Array<bool> > array_of_array_of_bools; |
+ mojo::Array<mojo::Array<mojo::Array<mojo::String> > > multi_array_of_strings; |
+}; |
+ |
+ |
+ |
+ |
+ |
+class DefaultsTest { |
+ public: |
+ typedef internal::DefaultsTest_Data Data_; |
+ static DefaultsTestPtr New(); |
+ |
+ template <typename U> |
+ static DefaultsTestPtr From(const U& u) { |
+ return mojo::TypeConverter<DefaultsTestPtr, U>::ConvertFrom(u); |
+ } |
+ |
+ DefaultsTest(); |
+ ~DefaultsTest(); |
+ |
+ int8_t a0; |
+ uint8_t a1; |
+ int16_t a2; |
+ uint16_t a3; |
+ int32_t a4; |
+ uint32_t a5; |
+ int64_t a6; |
+ uint64_t a7; |
+ int32_t a8; |
+ int32_t a9; |
+ int32_t a10; |
+ bool a11; |
+ bool a12; |
+ float a13; |
+ double a14; |
+ double a15; |
+ double a16; |
+ double a17; |
+ DefaultsTestInnerPtr a18; |
+ mojo::Array<uint8_t> a19; |
+ mojo::String a20; |
+}; |
+ |
+ |
+ |
+ |
+ |
+class ServiceProxy; |
+class ServiceStub; |
+ |
+class ServiceRequestValidator; |
+ |
+class ServiceClient; |
+ |
+ |
+class Service { |
+ public: |
+ typedef ServiceProxy Proxy_; |
+ typedef ServiceStub Stub_; |
+ |
+ typedef ServiceRequestValidator RequestValidator_; |
+ typedef mojo::PassThroughFilter ResponseValidator_; |
+ |
+ typedef ServiceClient Client; |
+ |
+ static const uint8_t kFavoriteBaz; |
+ |
+ enum BazOptions { |
+ BAZ_REGULAR = 0, |
+ BAZ_EXTRA, |
+ }; |
+ virtual ~Service() {} |
+ virtual void Frobinate(FooPtr foo, Service::BazOptions baz, PortPtr port) = 0; |
+}; |
+ |
+ |
+class ServiceClientProxy; |
+class ServiceClientStub; |
+ |
+class ServiceClientRequestValidator; |
+ |
+ |
+class ServiceClient { |
+ public: |
+ typedef ServiceClientProxy Proxy_; |
+ typedef ServiceClientStub Stub_; |
+ |
+ typedef ServiceClientRequestValidator RequestValidator_; |
+ typedef mojo::PassThroughFilter ResponseValidator_; |
+ |
+ typedef mojo::NoInterface Client; |
+ |
+ virtual ~ServiceClient() {} |
+ virtual void DidFrobinate(int32_t result) = 0; |
+}; |
+ |
+ |
+class PortProxy; |
+class PortStub; |
+ |
+class PortRequestValidator; |
+ |
+ |
+class Port { |
+ public: |
+ typedef PortProxy Proxy_; |
+ typedef PortStub Stub_; |
+ |
+ typedef PortRequestValidator RequestValidator_; |
+ typedef mojo::PassThroughFilter ResponseValidator_; |
+ |
+ typedef mojo::NoInterface Client; |
+ |
+ virtual ~Port() {} |
+ virtual void PostMessage(const mojo::String& message_text, PortPtr port) = 0; |
+}; |
+ |
+ |
+class ServiceProxy : public Service { |
+ public: |
+ explicit ServiceProxy(mojo::MessageReceiver* receiver); |
+ virtual void Frobinate( |
+ FooPtr foo, Service::BazOptions baz, PortPtr port |
+ ) MOJO_OVERRIDE; |
+ |
+ private: |
+ mojo::MessageReceiver* receiver_; |
+}; |
+ |
+ |
+class ServiceClientProxy : public ServiceClient { |
+ public: |
+ explicit ServiceClientProxy(mojo::MessageReceiver* receiver); |
+ virtual void DidFrobinate( |
+ int32_t result |
+ ) MOJO_OVERRIDE; |
+ |
+ private: |
+ mojo::MessageReceiver* receiver_; |
+}; |
+ |
+ |
+class PortProxy : public Port { |
+ public: |
+ explicit PortProxy(mojo::MessageReceiver* receiver); |
+ virtual void PostMessage( |
+ const mojo::String& message_text, PortPtr port |
+ ) MOJO_OVERRIDE; |
+ |
+ private: |
+ mojo::MessageReceiver* receiver_; |
+}; |
+ |
+class ServiceStub : public mojo::MessageReceiver { |
+ public: |
+ ServiceStub(); |
+ void set_sink(Service* sink) { sink_ = sink; } |
+ Service* sink() { return sink_; } |
+ |
+ virtual bool Accept(mojo::Message* message) MOJO_OVERRIDE; |
+ virtual bool AcceptWithResponder(mojo::Message* message, |
+ mojo::MessageReceiver* responder) |
+ MOJO_OVERRIDE; |
+ |
+ private: |
+ Service* sink_; |
+}; |
+ |
+class ServiceClientStub : public mojo::MessageReceiver { |
+ public: |
+ ServiceClientStub(); |
+ void set_sink(ServiceClient* sink) { sink_ = sink; } |
+ ServiceClient* sink() { return sink_; } |
+ |
+ virtual bool Accept(mojo::Message* message) MOJO_OVERRIDE; |
+ virtual bool AcceptWithResponder(mojo::Message* message, |
+ mojo::MessageReceiver* responder) |
+ MOJO_OVERRIDE; |
+ |
+ private: |
+ ServiceClient* sink_; |
+}; |
+ |
+class PortStub : public mojo::MessageReceiver { |
+ public: |
+ PortStub(); |
+ void set_sink(Port* sink) { sink_ = sink; } |
+ Port* sink() { return sink_; } |
+ |
+ virtual bool Accept(mojo::Message* message) MOJO_OVERRIDE; |
+ virtual bool AcceptWithResponder(mojo::Message* message, |
+ mojo::MessageReceiver* responder) |
+ MOJO_OVERRIDE; |
+ |
+ private: |
+ Port* sink_; |
+}; |
+ |
+class ServiceRequestValidator : public mojo::MessageFilter { |
+ public: |
+ explicit ServiceRequestValidator(mojo::MessageReceiver* sink = NULL); |
+ |
+ virtual bool Accept(mojo::Message* message) MOJO_OVERRIDE; |
+}; |
+ |
+class ServiceClientRequestValidator : public mojo::MessageFilter { |
+ public: |
+ explicit ServiceClientRequestValidator(mojo::MessageReceiver* sink = NULL); |
+ |
+ virtual bool Accept(mojo::Message* message) MOJO_OVERRIDE; |
+}; |
+ |
+class PortRequestValidator : public mojo::MessageFilter { |
+ public: |
+ explicit PortRequestValidator(mojo::MessageReceiver* sink = NULL); |
+ |
+ virtual bool Accept(mojo::Message* message) MOJO_OVERRIDE; |
+}; |
+ |
+ |
+size_t GetSerializedSize_(const BarPtr& input); |
+void Serialize_(BarPtr input, mojo::internal::Buffer* buffer, |
+ internal::Bar_Data** output); |
+void Deserialize_(internal::Bar_Data* input, |
+ BarPtr* output); |
+ |
+size_t GetSerializedSize_(const FooPtr& input); |
+void Serialize_(FooPtr input, mojo::internal::Buffer* buffer, |
+ internal::Foo_Data** output); |
+void Deserialize_(internal::Foo_Data* input, |
+ FooPtr* output); |
+ |
+size_t GetSerializedSize_(const DefaultsTestInnerPtr& input); |
+void Serialize_(DefaultsTestInnerPtr input, mojo::internal::Buffer* buffer, |
+ internal::DefaultsTestInner_Data** output); |
+void Deserialize_(internal::DefaultsTestInner_Data* input, |
+ DefaultsTestInnerPtr* output); |
+ |
+size_t GetSerializedSize_(const DefaultsTestPtr& input); |
+void Serialize_(DefaultsTestPtr input, mojo::internal::Buffer* buffer, |
+ internal::DefaultsTest_Data** output); |
+void Deserialize_(internal::DefaultsTest_Data* input, |
+ DefaultsTestPtr* output); |
+ |
+size_t GetSerializedSize_(const StructWithHoleV1Ptr& input); |
+void Serialize_(StructWithHoleV1Ptr input, mojo::internal::Buffer* buffer, |
+ internal::StructWithHoleV1_Data** output); |
+void Deserialize_(internal::StructWithHoleV1_Data* input, |
+ StructWithHoleV1Ptr* output); |
+ |
+size_t GetSerializedSize_(const StructWithHoleV2Ptr& input); |
+void Serialize_(StructWithHoleV2Ptr input, mojo::internal::Buffer* buffer, |
+ internal::StructWithHoleV2_Data** output); |
+void Deserialize_(internal::StructWithHoleV2_Data* input, |
+ StructWithHoleV2Ptr* output); |
+ |
+} // namespace sample |
+ |
+#endif // MOJO_PUBLIC_INTERFACES_BINDINGS_TESTS_SAMPLE_SERVICE_MOJOM_H_ |