blob: 0fee560187862ed56d3a3785b3d60deaf31db942 [file] [log] [blame]
// WARNING: This file is machine generated by fidlgen.
#pragma once
#include "lib/fidl/cpp/internal/header.h"
namespace fidl {
namespace test {
namespace json {
#ifdef __Fuchsia__
class super;
using superPtr = ::fidl::InterfacePtr<super>;
class super_Proxy;
class super_Stub;
class super_EventSender;
class super_Sync;
using superSyncPtr = ::fidl::SynchronousInterfacePtr<super>;
class super_SyncProxy;
using superHandle = ::fidl::InterfaceHandle<super>;
namespace internal {
constexpr uint64_t ksuper_foo_Ordinal = 0x2f16c1bc00000000lu;
constexpr uint64_t ksuper_foo_GenOrdinal = 0x4f6c089228ba7c92lu;
} // namespace internal
#endif // __Fuchsia__
#ifdef __Fuchsia__
class sub;
using subPtr = ::fidl::InterfacePtr<sub>;
class sub_Proxy;
class sub_Stub;
class sub_EventSender;
class sub_Sync;
using subSyncPtr = ::fidl::SynchronousInterfacePtr<sub>;
class sub_SyncProxy;
using subHandle = ::fidl::InterfaceHandle<sub>;
namespace internal {
constexpr uint64_t ksub_foo_Ordinal = 0x2f16c1bc00000000lu;
constexpr uint64_t ksub_foo_GenOrdinal = 0x4f6c089228ba7c92lu;
} // namespace internal
#endif // __Fuchsia__
#ifdef __Fuchsia__
class super {
public:
using Proxy_ = super_Proxy;
using Stub_ = super_Stub;
using EventSender_ = super_EventSender;
using Sync_ = super_Sync;
virtual ~super();
using fooCallback = fit::function<void(int64_t)>;
virtual void foo(::std::string s, fooCallback callback) = 0;
};
class super_RequestEncoder {
public:
static ::fidl::Message foo(::fidl::Encoder* _encoder, ::std::string* s) {
_encoder->Alloc(32 - sizeof(fidl_message_header_t));
::fidl::Encode(_encoder, s, 16);
return _encoder->GetMessage();
}
};
class super_RequestDecoder {
public:
super_RequestDecoder() = default;
virtual ~super_RequestDecoder() = default;
static const fidl_type_t* GetType(uint64_t ordinal, bool* out_needs_response);
zx_status_t Decode_(::fidl::Message request) {
bool needs_response;
const fidl_type_t* request_type =
GetType(request.ordinal(), &needs_response);
if (request_type == nullptr) {
return ZX_ERR_NOT_SUPPORTED;
}
const char* error_msg = nullptr;
zx_status_t status = request.Decode(request_type, &error_msg);
if (status != ZX_OK) {
FIDL_REPORT_DECODING_ERROR(request, request_type, error_msg);
return status;
}
::fidl::Decoder request_decoder(std::move(request));
switch (request.ordinal()) {
case internal::ksuper_foo_Ordinal:
case internal::ksuper_foo_GenOrdinal: {
auto arg0 = ::fidl::DecodeAs<::std::string>(&request_decoder, 16);
foo(std::move(arg0));
break;
}
default: {
status = ZX_ERR_NOT_SUPPORTED;
break;
}
}
return status;
}
virtual void foo(::std::string s) = 0;
};
class super_ResponseEncoder {
public:
static ::fidl::Message foo(::fidl::Encoder* _encoder, int64_t* y) {
_encoder->Alloc(24 - sizeof(fidl_message_header_t));
::fidl::Encode(_encoder, y, 16);
return _encoder->GetMessage();
}
};
class super_ResponseDecoder {
public:
super_ResponseDecoder() = default;
virtual ~super_ResponseDecoder() = default;
static const fidl_type_t* GetType(uint64_t ordinal);
zx_status_t Decode_(::fidl::Message response) {
const fidl_type_t* response_type = GetType(response.ordinal());
if (response_type == nullptr) {
return ZX_ERR_NOT_SUPPORTED;
}
const char* error_msg = nullptr;
zx_status_t status = response.Decode(response_type, &error_msg);
if (status != ZX_OK) {
FIDL_REPORT_DECODING_ERROR(response, response_type, error_msg);
return status;
}
::fidl::Decoder response_decoder(std::move(response));
switch (response.ordinal()) {
case internal::ksuper_foo_Ordinal:
case internal::ksuper_foo_GenOrdinal: {
auto arg0 = ::fidl::DecodeAs<int64_t>(&response_decoder, 16);
foo(std::move(arg0));
break;
}
default: {
break;
}
}
return ZX_OK;
}
virtual void foo(int64_t y) = 0;
};
class super_EventSender {
public:
virtual ~super_EventSender();
};
class super_Sync {
public:
using Proxy_ = super_SyncProxy;
virtual ~super_Sync();
virtual zx_status_t foo(::std::string s, int64_t* out_y) = 0;
};
class super_Proxy final : public ::fidl::internal::Proxy, public super {
public:
explicit super_Proxy(::fidl::internal::ProxyController* controller);
~super_Proxy() override;
zx_status_t Dispatch_(::fidl::Message message) override;
void foo(::std::string s, fooCallback callback) override;
private:
super_Proxy(const super_Proxy&) = delete;
super_Proxy& operator=(const super_Proxy&) = delete;
::fidl::internal::ProxyController* controller_;
};
class super_Stub final : public ::fidl::internal::Stub,
public super_EventSender {
public:
typedef class ::fidl::test::json::super super_clazz;
explicit super_Stub(super_clazz* impl);
~super_Stub() override;
zx_status_t Dispatch_(::fidl::Message message,
::fidl::internal::PendingResponse response) override;
private:
super_clazz* impl_;
};
class super_SyncProxy : public super_Sync {
public:
explicit super_SyncProxy(::zx::channel channel);
~super_SyncProxy() override;
zx_status_t foo(::std::string s, int64_t* out_y) override;
private:
::fidl::internal::SynchronousProxy proxy_;
friend class ::fidl::SynchronousInterfacePtr<super>;
};
#endif // __Fuchsia__
#ifdef __Fuchsia__
class sub {
public:
using Proxy_ = sub_Proxy;
using Stub_ = sub_Stub;
using EventSender_ = sub_EventSender;
using Sync_ = sub_Sync;
virtual ~sub();
using fooCallback = fit::function<void(int64_t)>;
virtual void foo(::std::string s, fooCallback callback) = 0;
};
class sub_RequestEncoder {
public:
static ::fidl::Message foo(::fidl::Encoder* _encoder, ::std::string* s) {
_encoder->Alloc(32 - sizeof(fidl_message_header_t));
::fidl::Encode(_encoder, s, 16);
return _encoder->GetMessage();
}
};
class sub_RequestDecoder {
public:
sub_RequestDecoder() = default;
virtual ~sub_RequestDecoder() = default;
static const fidl_type_t* GetType(uint64_t ordinal, bool* out_needs_response);
zx_status_t Decode_(::fidl::Message request) {
bool needs_response;
const fidl_type_t* request_type =
GetType(request.ordinal(), &needs_response);
if (request_type == nullptr) {
return ZX_ERR_NOT_SUPPORTED;
}
const char* error_msg = nullptr;
zx_status_t status = request.Decode(request_type, &error_msg);
if (status != ZX_OK) {
FIDL_REPORT_DECODING_ERROR(request, request_type, error_msg);
return status;
}
::fidl::Decoder request_decoder(std::move(request));
switch (request.ordinal()) {
case internal::ksub_foo_Ordinal:
case internal::ksub_foo_GenOrdinal: {
auto arg0 = ::fidl::DecodeAs<::std::string>(&request_decoder, 16);
foo(std::move(arg0));
break;
}
default: {
status = ZX_ERR_NOT_SUPPORTED;
break;
}
}
return status;
}
virtual void foo(::std::string s) = 0;
};
class sub_ResponseEncoder {
public:
static ::fidl::Message foo(::fidl::Encoder* _encoder, int64_t* y) {
_encoder->Alloc(24 - sizeof(fidl_message_header_t));
::fidl::Encode(_encoder, y, 16);
return _encoder->GetMessage();
}
};
class sub_ResponseDecoder {
public:
sub_ResponseDecoder() = default;
virtual ~sub_ResponseDecoder() = default;
static const fidl_type_t* GetType(uint64_t ordinal);
zx_status_t Decode_(::fidl::Message response) {
const fidl_type_t* response_type = GetType(response.ordinal());
if (response_type == nullptr) {
return ZX_ERR_NOT_SUPPORTED;
}
const char* error_msg = nullptr;
zx_status_t status = response.Decode(response_type, &error_msg);
if (status != ZX_OK) {
FIDL_REPORT_DECODING_ERROR(response, response_type, error_msg);
return status;
}
::fidl::Decoder response_decoder(std::move(response));
switch (response.ordinal()) {
case internal::ksub_foo_Ordinal:
case internal::ksub_foo_GenOrdinal: {
auto arg0 = ::fidl::DecodeAs<int64_t>(&response_decoder, 16);
foo(std::move(arg0));
break;
}
default: {
break;
}
}
return ZX_OK;
}
virtual void foo(int64_t y) = 0;
};
class sub_EventSender {
public:
virtual ~sub_EventSender();
};
class sub_Sync {
public:
using Proxy_ = sub_SyncProxy;
virtual ~sub_Sync();
virtual zx_status_t foo(::std::string s, int64_t* out_y) = 0;
};
class sub_Proxy final : public ::fidl::internal::Proxy, public sub {
public:
explicit sub_Proxy(::fidl::internal::ProxyController* controller);
~sub_Proxy() override;
zx_status_t Dispatch_(::fidl::Message message) override;
void foo(::std::string s, fooCallback callback) override;
private:
sub_Proxy(const sub_Proxy&) = delete;
sub_Proxy& operator=(const sub_Proxy&) = delete;
::fidl::internal::ProxyController* controller_;
};
class sub_Stub final : public ::fidl::internal::Stub, public sub_EventSender {
public:
typedef class ::fidl::test::json::sub sub_clazz;
explicit sub_Stub(sub_clazz* impl);
~sub_Stub() override;
zx_status_t Dispatch_(::fidl::Message message,
::fidl::internal::PendingResponse response) override;
private:
sub_clazz* impl_;
};
class sub_SyncProxy : public sub_Sync {
public:
explicit sub_SyncProxy(::zx::channel channel);
~sub_SyncProxy() override;
zx_status_t foo(::std::string s, int64_t* out_y) override;
private:
::fidl::internal::SynchronousProxy proxy_;
friend class ::fidl::SynchronousInterfacePtr<sub>;
};
#endif // __Fuchsia__
} // namespace json
} // namespace test
} // namespace fidl
namespace fidl {} // namespace fidl