| // WARNING: This file is machine generated by fidlgen. |
| |
| #include <fidl/test/inheritancewithrecursivedecl/cpp/fidl.h> |
| |
| #include "lib/fidl/cpp/internal/implementation.h" |
| |
| // |
| // Domain objects definitions (i.e. "natural types" in unified bindings) |
| // |
| namespace fidl { |
| namespace test { |
| namespace inheritancewithrecursivedecl { |
| |
| } // namespace inheritancewithrecursivedecl |
| } // namespace test |
| } // namespace fidl |
| |
| // |
| // Proxies and stubs definitions |
| // |
| namespace fidl { |
| namespace test { |
| namespace inheritancewithrecursivedecl { |
| |
| #ifdef __Fuchsia__ |
| namespace { |
| |
| extern "C" const fidl_type_t |
| fidl_test_inheritancewithrecursivedecl_ParentFirstRequestTable; |
| |
| } // namespace |
| |
| Parent::~Parent() = default; |
| |
| const fidl_type_t* Parent_RequestDecoder::GetType(uint64_t ordinal, |
| bool* out_needs_response) { |
| switch (ordinal) { |
| case internal::kParent_First_Ordinal: |
| *out_needs_response = false; |
| return &fidl_test_inheritancewithrecursivedecl_ParentFirstRequestTable; |
| default: |
| *out_needs_response = false; |
| return nullptr; |
| } |
| } |
| |
| const fidl_type_t* Parent_ResponseDecoder::GetType(uint64_t ordinal) { |
| switch (ordinal) { |
| default: |
| return nullptr; |
| } |
| } |
| |
| Parent_EventSender::~Parent_EventSender() = default; |
| |
| Parent_Sync::~Parent_Sync() = default; |
| |
| Parent_Proxy::Parent_Proxy(::fidl::internal::ProxyController* controller) |
| : controller_(controller) { |
| (void)controller_; |
| } |
| |
| Parent_Proxy::~Parent_Proxy() = default; |
| |
| zx_status_t Parent_Proxy::Dispatch_(::fidl::HLCPPIncomingMessage message) { |
| zx_status_t status = ZX_OK; |
| switch (message.ordinal()) { |
| default: { |
| status = ZX_ERR_NOT_SUPPORTED; |
| break; |
| } |
| } |
| return status; |
| } |
| |
| void Parent_Proxy::First( |
| ::fidl::InterfaceRequest<::fidl::test::inheritancewithrecursivedecl::Parent> |
| request) { |
| ::fidl::Encoder _encoder(internal::kParent_First_Ordinal); |
| controller_->Send( |
| &fidl_test_inheritancewithrecursivedecl_ParentFirstRequestTable, |
| Parent_RequestEncoder::First(&_encoder, &request), nullptr); |
| } |
| |
| Parent_Stub::Parent_Stub(Parent_clazz* impl) : impl_(impl) { (void)impl_; } |
| |
| Parent_Stub::~Parent_Stub() = default; |
| |
| namespace {} // namespace |
| |
| zx_status_t Parent_Stub::Dispatch_(::fidl::HLCPPIncomingMessage message, |
| ::fidl::internal::PendingResponse response) { |
| bool needs_response; |
| const fidl_type_t* request_type = |
| Parent_RequestDecoder::GetType(message.ordinal(), &needs_response); |
| if (request_type == nullptr) { |
| return ZX_ERR_NOT_SUPPORTED; |
| } |
| if (response.needs_response() != needs_response) { |
| if (needs_response) { |
| FIDL_REPORT_DECODING_ERROR(message, request_type, |
| "Message needing a response with no txid"); |
| } else { |
| FIDL_REPORT_DECODING_ERROR(message, request_type, |
| "Message not needing a response with a txid"); |
| } |
| return ZX_ERR_INVALID_ARGS; |
| } |
| const char* error_msg = nullptr; |
| zx_status_t status = message.Decode(request_type, &error_msg); |
| if (status != ZX_OK) { |
| FIDL_REPORT_DECODING_ERROR(message, request_type, error_msg); |
| return status; |
| } |
| uint64_t ordinal = message.ordinal(); |
| switch (ordinal) { |
| case internal::kParent_First_Ordinal: { |
| ::fidl::Decoder decoder(std::move(message)); |
| impl_->First(::fidl::DecodeAs<::fidl::InterfaceRequest< |
| ::fidl::test::inheritancewithrecursivedecl::Parent>>( |
| &decoder, 16)); |
| break; |
| } |
| default: { |
| status = ZX_ERR_NOT_SUPPORTED; |
| break; |
| } |
| } |
| return status; |
| } |
| |
| Parent_SyncProxy::Parent_SyncProxy(::zx::channel channel) |
| : proxy_(::std::move(channel)) {} |
| |
| Parent_SyncProxy::~Parent_SyncProxy() = default; |
| |
| zx_status_t Parent_SyncProxy::First( |
| ::fidl::InterfaceRequest<::fidl::test::inheritancewithrecursivedecl::Parent> |
| request) { |
| ::fidl::Encoder _encoder(internal::kParent_First_Ordinal); |
| return proxy_.Send( |
| &fidl_test_inheritancewithrecursivedecl_ParentFirstRequestTable, |
| Parent_RequestEncoder::First(&_encoder, &request)); |
| } |
| |
| #endif // __Fuchsia__ |
| |
| #ifdef __Fuchsia__ |
| namespace { |
| |
| extern "C" const fidl_type_t |
| fidl_test_inheritancewithrecursivedecl_ChildFirstRequestTable; |
| |
| extern "C" const fidl_type_t |
| fidl_test_inheritancewithrecursivedecl_ChildSecondRequestTable; |
| |
| } // namespace |
| |
| Child::~Child() = default; |
| |
| const fidl_type_t* Child_RequestDecoder::GetType(uint64_t ordinal, |
| bool* out_needs_response) { |
| switch (ordinal) { |
| case internal::kChild_First_Ordinal: |
| *out_needs_response = false; |
| return &fidl_test_inheritancewithrecursivedecl_ChildFirstRequestTable; |
| case internal::kChild_Second_Ordinal: |
| *out_needs_response = false; |
| return &fidl_test_inheritancewithrecursivedecl_ChildSecondRequestTable; |
| default: |
| *out_needs_response = false; |
| return nullptr; |
| } |
| } |
| |
| const fidl_type_t* Child_ResponseDecoder::GetType(uint64_t ordinal) { |
| switch (ordinal) { |
| default: |
| return nullptr; |
| } |
| } |
| |
| Child_EventSender::~Child_EventSender() = default; |
| |
| Child_Sync::~Child_Sync() = default; |
| |
| Child_Proxy::Child_Proxy(::fidl::internal::ProxyController* controller) |
| : controller_(controller) { |
| (void)controller_; |
| } |
| |
| Child_Proxy::~Child_Proxy() = default; |
| |
| zx_status_t Child_Proxy::Dispatch_(::fidl::HLCPPIncomingMessage message) { |
| zx_status_t status = ZX_OK; |
| switch (message.ordinal()) { |
| default: { |
| status = ZX_ERR_NOT_SUPPORTED; |
| break; |
| } |
| } |
| return status; |
| } |
| |
| void Child_Proxy::First( |
| ::fidl::InterfaceRequest<::fidl::test::inheritancewithrecursivedecl::Parent> |
| request) { |
| ::fidl::Encoder _encoder(internal::kChild_First_Ordinal); |
| controller_->Send( |
| &fidl_test_inheritancewithrecursivedecl_ChildFirstRequestTable, |
| Child_RequestEncoder::First(&_encoder, &request), nullptr); |
| } |
| void Child_Proxy::Second( |
| ::fidl::InterfaceRequest<::fidl::test::inheritancewithrecursivedecl::Parent> |
| request) { |
| ::fidl::Encoder _encoder(internal::kChild_Second_Ordinal); |
| controller_->Send( |
| &fidl_test_inheritancewithrecursivedecl_ChildSecondRequestTable, |
| Child_RequestEncoder::Second(&_encoder, &request), nullptr); |
| } |
| |
| Child_Stub::Child_Stub(Child_clazz* impl) : impl_(impl) { (void)impl_; } |
| |
| Child_Stub::~Child_Stub() = default; |
| |
| namespace {} // namespace |
| |
| zx_status_t Child_Stub::Dispatch_(::fidl::HLCPPIncomingMessage message, |
| ::fidl::internal::PendingResponse response) { |
| bool needs_response; |
| const fidl_type_t* request_type = |
| Child_RequestDecoder::GetType(message.ordinal(), &needs_response); |
| if (request_type == nullptr) { |
| return ZX_ERR_NOT_SUPPORTED; |
| } |
| if (response.needs_response() != needs_response) { |
| if (needs_response) { |
| FIDL_REPORT_DECODING_ERROR(message, request_type, |
| "Message needing a response with no txid"); |
| } else { |
| FIDL_REPORT_DECODING_ERROR(message, request_type, |
| "Message not needing a response with a txid"); |
| } |
| return ZX_ERR_INVALID_ARGS; |
| } |
| const char* error_msg = nullptr; |
| zx_status_t status = message.Decode(request_type, &error_msg); |
| if (status != ZX_OK) { |
| FIDL_REPORT_DECODING_ERROR(message, request_type, error_msg); |
| return status; |
| } |
| uint64_t ordinal = message.ordinal(); |
| switch (ordinal) { |
| case internal::kChild_First_Ordinal: { |
| ::fidl::Decoder decoder(std::move(message)); |
| impl_->First(::fidl::DecodeAs<::fidl::InterfaceRequest< |
| ::fidl::test::inheritancewithrecursivedecl::Parent>>( |
| &decoder, 16)); |
| break; |
| } |
| case internal::kChild_Second_Ordinal: { |
| ::fidl::Decoder decoder(std::move(message)); |
| impl_->Second(::fidl::DecodeAs<::fidl::InterfaceRequest< |
| ::fidl::test::inheritancewithrecursivedecl::Parent>>( |
| &decoder, 16)); |
| break; |
| } |
| default: { |
| status = ZX_ERR_NOT_SUPPORTED; |
| break; |
| } |
| } |
| return status; |
| } |
| |
| Child_SyncProxy::Child_SyncProxy(::zx::channel channel) |
| : proxy_(::std::move(channel)) {} |
| |
| Child_SyncProxy::~Child_SyncProxy() = default; |
| |
| zx_status_t Child_SyncProxy::First( |
| ::fidl::InterfaceRequest<::fidl::test::inheritancewithrecursivedecl::Parent> |
| request) { |
| ::fidl::Encoder _encoder(internal::kChild_First_Ordinal); |
| return proxy_.Send( |
| &fidl_test_inheritancewithrecursivedecl_ChildFirstRequestTable, |
| Child_RequestEncoder::First(&_encoder, &request)); |
| } |
| |
| zx_status_t Child_SyncProxy::Second( |
| ::fidl::InterfaceRequest<::fidl::test::inheritancewithrecursivedecl::Parent> |
| request) { |
| ::fidl::Encoder _encoder(internal::kChild_Second_Ordinal); |
| return proxy_.Send( |
| &fidl_test_inheritancewithrecursivedecl_ChildSecondRequestTable, |
| Child_RequestEncoder::Second(&_encoder, &request)); |
| } |
| |
| #endif // __Fuchsia__ |
| |
| } // namespace inheritancewithrecursivedecl |
| } // namespace test |
| } // namespace fidl |