| // WARNING: This file is machine generated by fidlgen. |
| |
| #include <fidl/test/bindingsdenylist/cpp/fidl.h> |
| |
| #include "lib/fidl/cpp/internal/implementation.h" |
| |
| // |
| // Domain objects definitions (i.e. "natural types" in unified bindings) |
| // |
| |
| // |
| // Proxies and stubs definitions |
| // |
| #ifdef __Fuchsia__ |
| |
| namespace fidl { |
| namespace test { |
| namespace bindingsdenylist { |
| namespace _internal { |
| extern "C" const fidl_type_t |
| fidl_test_bindingsdenylist_OnlyLibfuzzerAndDepsLibfuzzerNeedsNonemptyProtocolRequestTable; |
| |
| extern "C" const fidl_type_t |
| fidl_test_bindingsdenylist_OnlyLibfuzzerAndDepsLibfuzzerNeedsNonemptyProtocolResponseTable; |
| |
| } // namespace _internal |
| OnlyLibfuzzerAndDeps::~OnlyLibfuzzerAndDeps() = default; |
| |
| const fidl_type_t* ::fidl::test::bindingsdenylist:: |
| OnlyLibfuzzerAndDeps_RequestDecoder::GetType(uint64_t ordinal, |
| bool* out_needs_response) { |
| switch (ordinal) { |
| case ::fidl::test::bindingsdenylist::internal:: |
| kOnlyLibfuzzerAndDeps_LibfuzzerNeedsNonemptyProtocol_Ordinal: |
| *out_needs_response = true; |
| return &::fidl::test::bindingsdenylist::_internal:: |
| fidl_test_bindingsdenylist_OnlyLibfuzzerAndDepsLibfuzzerNeedsNonemptyProtocolRequestTable; |
| default: |
| *out_needs_response = false; |
| return nullptr; |
| } |
| } |
| |
| const fidl_type_t* OnlyLibfuzzerAndDeps_ResponseDecoder::GetType( |
| uint64_t ordinal) { |
| switch (ordinal) { |
| case ::fidl::test::bindingsdenylist::internal:: |
| kOnlyLibfuzzerAndDeps_LibfuzzerNeedsNonemptyProtocol_Ordinal: |
| return &::fidl::test::bindingsdenylist::_internal:: |
| fidl_test_bindingsdenylist_OnlyLibfuzzerAndDepsLibfuzzerNeedsNonemptyProtocolResponseTable; |
| default: |
| return nullptr; |
| } |
| } |
| |
| OnlyLibfuzzerAndDeps_EventSender::~OnlyLibfuzzerAndDeps_EventSender() = default; |
| |
| OnlyLibfuzzerAndDeps_Sync::~OnlyLibfuzzerAndDeps_Sync() = default; |
| |
| OnlyLibfuzzerAndDeps_Proxy::OnlyLibfuzzerAndDeps_Proxy( |
| ::fidl::internal::ProxyController* controller) |
| : controller_(controller) { |
| (void)controller_; |
| } |
| |
| OnlyLibfuzzerAndDeps_Proxy::~OnlyLibfuzzerAndDeps_Proxy() = default; |
| |
| zx_status_t OnlyLibfuzzerAndDeps_Proxy::Dispatch_( |
| ::fidl::HLCPPIncomingMessage message) { |
| zx_status_t status = ZX_OK; |
| switch (message.ordinal()) { |
| default: { |
| status = ZX_ERR_NOT_SUPPORTED; |
| break; |
| } |
| } |
| return status; |
| } |
| |
| namespace { |
| |
| ::std::unique_ptr<::fidl::internal::SingleUseMessageHandler> |
| OnlyLibfuzzerAndDeps_LibfuzzerNeedsNonemptyProtocol_ResponseHandler( |
| OnlyLibfuzzerAndDeps::LibfuzzerNeedsNonemptyProtocolCallback&& callback) { |
| ZX_DEBUG_ASSERT_MSG(callback, |
| "Callback must not be empty for " |
| "OnlyLibfuzzerAndDeps::LibfuzzerNeedsNonemptyProtocol\n"); |
| return ::std::make_unique<::fidl::internal::SingleUseMessageHandler>( |
| [callback_ = |
| std::move(callback)](::fidl::HLCPPIncomingMessage&& message) { |
| callback_(); |
| return ZX_OK; |
| }, |
| &::fidl::test::bindingsdenylist::_internal:: |
| fidl_test_bindingsdenylist_OnlyLibfuzzerAndDepsLibfuzzerNeedsNonemptyProtocolResponseTable); |
| } |
| |
| } // namespace |
| void OnlyLibfuzzerAndDeps_Proxy::LibfuzzerNeedsNonemptyProtocol( |
| LibfuzzerNeedsNonemptyProtocolCallback callback) { |
| ::fidl::Encoder _encoder( |
| ::fidl::test::bindingsdenylist::internal:: |
| kOnlyLibfuzzerAndDeps_LibfuzzerNeedsNonemptyProtocol_Ordinal); |
| controller_->Send( |
| &::fidl::test::bindingsdenylist::_internal:: |
| fidl_test_bindingsdenylist_OnlyLibfuzzerAndDepsLibfuzzerNeedsNonemptyProtocolRequestTable, |
| ::fidl::test::bindingsdenylist::OnlyLibfuzzerAndDeps_RequestEncoder:: |
| LibfuzzerNeedsNonemptyProtocol(&_encoder), |
| OnlyLibfuzzerAndDeps_LibfuzzerNeedsNonemptyProtocol_ResponseHandler( |
| std::move(callback))); |
| } |
| |
| OnlyLibfuzzerAndDeps_Stub::OnlyLibfuzzerAndDeps_Stub( |
| ::fidl::test::bindingsdenylist::OnlyLibfuzzerAndDeps_Stub:: |
| OnlyLibfuzzerAndDeps_clazz* impl) |
| : impl_(impl) { |
| (void)impl_; |
| } |
| |
| OnlyLibfuzzerAndDeps_Stub::~OnlyLibfuzzerAndDeps_Stub() = default; |
| |
| namespace { |
| |
| class OnlyLibfuzzerAndDeps_LibfuzzerNeedsNonemptyProtocol_Responder final { |
| public: |
| OnlyLibfuzzerAndDeps_LibfuzzerNeedsNonemptyProtocol_Responder( |
| ::fidl::internal::PendingResponse response) |
| : response_(std::move(response)) {} |
| |
| void operator()() { |
| ::fidl::Encoder _encoder( |
| ::fidl::test::bindingsdenylist::internal:: |
| kOnlyLibfuzzerAndDeps_LibfuzzerNeedsNonemptyProtocol_Ordinal); |
| response_.Send( |
| &::fidl::test::bindingsdenylist::_internal:: |
| fidl_test_bindingsdenylist_OnlyLibfuzzerAndDepsLibfuzzerNeedsNonemptyProtocolResponseTable, |
| ::fidl::test::bindingsdenylist::OnlyLibfuzzerAndDeps_ResponseEncoder:: |
| LibfuzzerNeedsNonemptyProtocol(&_encoder)); |
| } |
| |
| private: |
| ::fidl::internal::PendingResponse response_; |
| }; |
| |
| } // namespace |
| |
| zx_status_t OnlyLibfuzzerAndDeps_Stub::Dispatch_( |
| ::fidl::HLCPPIncomingMessage message, |
| ::fidl::internal::PendingResponse response) { |
| bool needs_response; |
| const fidl_type_t* request_type = |
| ::fidl::test::bindingsdenylist::OnlyLibfuzzerAndDeps_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 ::fidl::test::bindingsdenylist::internal:: |
| kOnlyLibfuzzerAndDeps_LibfuzzerNeedsNonemptyProtocol_Ordinal: { |
| impl_->LibfuzzerNeedsNonemptyProtocol( |
| OnlyLibfuzzerAndDeps_LibfuzzerNeedsNonemptyProtocol_Responder( |
| std::move(response))); |
| break; |
| } |
| default: { |
| status = ZX_ERR_NOT_SUPPORTED; |
| break; |
| } |
| } |
| return status; |
| } |
| |
| OnlyLibfuzzerAndDeps_SyncProxy::OnlyLibfuzzerAndDeps_SyncProxy( |
| ::zx::channel channel) |
| : proxy_(::std::move(channel)) {} |
| |
| OnlyLibfuzzerAndDeps_SyncProxy::~OnlyLibfuzzerAndDeps_SyncProxy() = default; |
| |
| zx_status_t OnlyLibfuzzerAndDeps_SyncProxy::LibfuzzerNeedsNonemptyProtocol() { |
| ::fidl::Encoder _encoder( |
| ::fidl::test::bindingsdenylist::internal:: |
| kOnlyLibfuzzerAndDeps_LibfuzzerNeedsNonemptyProtocol_Ordinal); |
| ::fidl::IncomingMessageBuffer buffer_; |
| ::fidl::HLCPPIncomingMessage response_ = buffer_.CreateEmptyIncomingMessage(); |
| zx_status_t status_ = proxy_.Call( |
| &::fidl::test::bindingsdenylist::_internal:: |
| fidl_test_bindingsdenylist_OnlyLibfuzzerAndDepsLibfuzzerNeedsNonemptyProtocolRequestTable, |
| &::fidl::test::bindingsdenylist::_internal:: |
| fidl_test_bindingsdenylist_OnlyLibfuzzerAndDepsLibfuzzerNeedsNonemptyProtocolResponseTable, |
| ::fidl::test::bindingsdenylist::OnlyLibfuzzerAndDeps_RequestEncoder:: |
| LibfuzzerNeedsNonemptyProtocol(&_encoder), |
| &response_); |
| if (status_ != ZX_OK) return status_; |
| return ZX_OK; |
| } |
| } // namespace bindingsdenylist |
| } // namespace test |
| } // namespace fidl |
| #endif // __Fuchsia__ |
| |
| #ifdef __Fuchsia__ |
| |
| namespace fidl { |
| namespace test { |
| namespace bindingsdenylist { |
| OnlyCppAndDeps::~OnlyCppAndDeps() = default; |
| |
| const fidl_type_t* ::fidl::test::bindingsdenylist:: |
| OnlyCppAndDeps_RequestDecoder::GetType(uint64_t ordinal, |
| bool* out_needs_response) { |
| switch (ordinal) { |
| default: |
| *out_needs_response = false; |
| return nullptr; |
| } |
| } |
| |
| const fidl_type_t* OnlyCppAndDeps_ResponseDecoder::GetType(uint64_t ordinal) { |
| switch (ordinal) { |
| default: |
| return nullptr; |
| } |
| } |
| |
| OnlyCppAndDeps_EventSender::~OnlyCppAndDeps_EventSender() = default; |
| |
| OnlyCppAndDeps_Sync::~OnlyCppAndDeps_Sync() = default; |
| |
| OnlyCppAndDeps_Proxy::OnlyCppAndDeps_Proxy( |
| ::fidl::internal::ProxyController* controller) |
| : controller_(controller) { |
| (void)controller_; |
| } |
| |
| OnlyCppAndDeps_Proxy::~OnlyCppAndDeps_Proxy() = default; |
| |
| zx_status_t OnlyCppAndDeps_Proxy::Dispatch_( |
| ::fidl::HLCPPIncomingMessage message) { |
| zx_status_t status = ZX_OK; |
| switch (message.ordinal()) { |
| default: { |
| status = ZX_ERR_NOT_SUPPORTED; |
| break; |
| } |
| } |
| return status; |
| } |
| |
| OnlyCppAndDeps_Stub::OnlyCppAndDeps_Stub( |
| ::fidl::test::bindingsdenylist::OnlyCppAndDeps_Stub::OnlyCppAndDeps_clazz* |
| impl) |
| : impl_(impl) { |
| (void)impl_; |
| } |
| |
| OnlyCppAndDeps_Stub::~OnlyCppAndDeps_Stub() = default; |
| |
| namespace {} // namespace |
| |
| zx_status_t OnlyCppAndDeps_Stub::Dispatch_( |
| ::fidl::HLCPPIncomingMessage message, |
| ::fidl::internal::PendingResponse response) { |
| bool needs_response; |
| const fidl_type_t* request_type = |
| ::fidl::test::bindingsdenylist::OnlyCppAndDeps_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) { |
| default: { |
| status = ZX_ERR_NOT_SUPPORTED; |
| break; |
| } |
| } |
| return status; |
| } |
| |
| OnlyCppAndDeps_SyncProxy::OnlyCppAndDeps_SyncProxy(::zx::channel channel) |
| : proxy_(::std::move(channel)) {} |
| |
| OnlyCppAndDeps_SyncProxy::~OnlyCppAndDeps_SyncProxy() = default; |
| } // namespace bindingsdenylist |
| } // namespace test |
| } // namespace fidl |
| #endif // __Fuchsia__ |