blob: 02d5e456f9c17140798c1784ec7696456da0036c [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 handles {
class Handles;
#ifdef __Fuchsia__
class SomeProtocol;
using SomeProtocolPtr = ::fidl::InterfacePtr<SomeProtocol>;
class SomeProtocol_Proxy;
class SomeProtocol_Stub;
class SomeProtocol_EventSender;
class SomeProtocol_Sync;
using SomeProtocolSyncPtr = ::fidl::SynchronousInterfacePtr<SomeProtocol>;
class SomeProtocol_SyncProxy;
using SomeProtocolHandle = ::fidl::InterfaceHandle<SomeProtocol>;
namespace internal {} // namespace internal
#endif // __Fuchsia__
class Handles final {
public:
static const fidl_type_t* FidlType;
::zx::handle plain_handle{};
::zx::bti bti_handle{};
::zx::channel channel_handle{};
::zx::clock clock_handle{};
::zx::debuglog debuglog_handle{};
::zx::event event_handle{};
::zx::eventpair eventpair_handle{};
::zx::exception exception_handle{};
::zx::fifo fifo_handle{};
::zx::guest guest_handle{};
::zx::interrupt interrupt_handle{};
::zx::iommu iommu_handle{};
::zx::job job_handle{};
::zx::pager pager_handle{};
::zx::pcidevice pcidevice_handle{};
::zx::pmt pmt_handle{};
::zx::port port_handle{};
::zx::process process_handle{};
::zx::profile profile_handle{};
::zx::resource resource_handle{};
::zx::socket socket_handle{};
::zx::suspendtoken suspendtoken_handle{};
::zx::thread thread_handle{};
::zx::timer timer_handle{};
::zx::vcpu vcpu_handle{};
::zx::vmar vmar_handle{};
::zx::vmo vmo_handle{};
::zx::vmo rights_handle{};
::zx::handle aliased_plain_handle_field{};
::zx::handle aliased_subtype_handle_field{};
::zx::handle aliased_rights_handle_field{};
::fidl::InterfaceHandle<class SomeProtocol> some_protocol{};
::fidl::InterfaceRequest<SomeProtocol> request_some_protocol{};
static inline ::std::unique_ptr<Handles> New() {
return ::std::make_unique<Handles>();
}
void Encode(::fidl::Encoder* _encoder, size_t _offset);
static void Decode(::fidl::Decoder* _decoder, Handles* value, size_t _offset);
zx_status_t Clone(Handles* result) const;
};
inline zx_status_t Clone(const ::fidl::test::handles::Handles& _value,
::fidl::test::handles::Handles* _result) {
return _value.Clone(_result);
}
using HandlesPtr = ::std::unique_ptr<Handles>;
#ifdef __Fuchsia__
class SomeProtocol {
public:
using Proxy_ = SomeProtocol_Proxy;
using Stub_ = SomeProtocol_Stub;
using EventSender_ = SomeProtocol_EventSender;
using Sync_ = SomeProtocol_Sync;
virtual ~SomeProtocol();
};
class SomeProtocol_RequestEncoder {
public:
};
class SomeProtocol_RequestDecoder {
public:
SomeProtocol_RequestDecoder() = default;
virtual ~SomeProtocol_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()) {
default: {
status = ZX_ERR_NOT_SUPPORTED;
break;
}
}
return status;
}
};
class SomeProtocol_ResponseEncoder {
public:
};
class SomeProtocol_ResponseDecoder {
public:
SomeProtocol_ResponseDecoder() = default;
virtual ~SomeProtocol_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()) {
default: {
break;
}
}
return ZX_OK;
}
};
class SomeProtocol_EventSender {
public:
virtual ~SomeProtocol_EventSender();
};
class SomeProtocol_Sync {
public:
using Proxy_ = SomeProtocol_SyncProxy;
virtual ~SomeProtocol_Sync();
};
class SomeProtocol_Proxy final : public ::fidl::internal::Proxy,
public SomeProtocol {
public:
explicit SomeProtocol_Proxy(::fidl::internal::ProxyController* controller);
~SomeProtocol_Proxy() override;
zx_status_t Dispatch_(::fidl::Message message) override;
private:
SomeProtocol_Proxy(const SomeProtocol_Proxy&) = delete;
SomeProtocol_Proxy& operator=(const SomeProtocol_Proxy&) = delete;
::fidl::internal::ProxyController* controller_;
};
class SomeProtocol_Stub final : public ::fidl::internal::Stub,
public SomeProtocol_EventSender {
public:
typedef class ::fidl::test::handles::SomeProtocol SomeProtocol_clazz;
explicit SomeProtocol_Stub(SomeProtocol_clazz* impl);
~SomeProtocol_Stub() override;
zx_status_t Dispatch_(::fidl::Message message,
::fidl::internal::PendingResponse response) override;
private:
SomeProtocol_clazz* impl_;
};
class SomeProtocol_SyncProxy : public SomeProtocol_Sync {
public:
explicit SomeProtocol_SyncProxy(::zx::channel channel);
~SomeProtocol_SyncProxy() override;
private:
::fidl::internal::SynchronousProxy proxy_;
friend class ::fidl::SynchronousInterfacePtr<SomeProtocol>;
};
#endif // __Fuchsia__
} // namespace handles
} // namespace test
} // namespace fidl
namespace fidl {
template <>
struct CodingTraits<::fidl::test::handles::Handles>
: public EncodableCodingTraits<::fidl::test::handles::Handles, 132> {};
inline zx_status_t Clone(const ::fidl::test::handles::Handles& value,
::fidl::test::handles::Handles* result) {
return ::fidl::test::handles::Clone(value, result);
}
template <>
struct Equality<::fidl::test::handles::Handles> {
bool operator()(const ::fidl::test::handles::Handles& _lhs,
const ::fidl::test::handles::Handles& _rhs) const {
if (!::fidl::Equals(_lhs.plain_handle, _rhs.plain_handle)) {
return false;
}
if (!::fidl::Equals(_lhs.bti_handle, _rhs.bti_handle)) {
return false;
}
if (!::fidl::Equals(_lhs.channel_handle, _rhs.channel_handle)) {
return false;
}
if (!::fidl::Equals(_lhs.clock_handle, _rhs.clock_handle)) {
return false;
}
if (!::fidl::Equals(_lhs.debuglog_handle, _rhs.debuglog_handle)) {
return false;
}
if (!::fidl::Equals(_lhs.event_handle, _rhs.event_handle)) {
return false;
}
if (!::fidl::Equals(_lhs.eventpair_handle, _rhs.eventpair_handle)) {
return false;
}
if (!::fidl::Equals(_lhs.exception_handle, _rhs.exception_handle)) {
return false;
}
if (!::fidl::Equals(_lhs.fifo_handle, _rhs.fifo_handle)) {
return false;
}
if (!::fidl::Equals(_lhs.guest_handle, _rhs.guest_handle)) {
return false;
}
if (!::fidl::Equals(_lhs.interrupt_handle, _rhs.interrupt_handle)) {
return false;
}
if (!::fidl::Equals(_lhs.iommu_handle, _rhs.iommu_handle)) {
return false;
}
if (!::fidl::Equals(_lhs.job_handle, _rhs.job_handle)) {
return false;
}
if (!::fidl::Equals(_lhs.pager_handle, _rhs.pager_handle)) {
return false;
}
if (!::fidl::Equals(_lhs.pcidevice_handle, _rhs.pcidevice_handle)) {
return false;
}
if (!::fidl::Equals(_lhs.pmt_handle, _rhs.pmt_handle)) {
return false;
}
if (!::fidl::Equals(_lhs.port_handle, _rhs.port_handle)) {
return false;
}
if (!::fidl::Equals(_lhs.process_handle, _rhs.process_handle)) {
return false;
}
if (!::fidl::Equals(_lhs.profile_handle, _rhs.profile_handle)) {
return false;
}
if (!::fidl::Equals(_lhs.resource_handle, _rhs.resource_handle)) {
return false;
}
if (!::fidl::Equals(_lhs.socket_handle, _rhs.socket_handle)) {
return false;
}
if (!::fidl::Equals(_lhs.suspendtoken_handle, _rhs.suspendtoken_handle)) {
return false;
}
if (!::fidl::Equals(_lhs.thread_handle, _rhs.thread_handle)) {
return false;
}
if (!::fidl::Equals(_lhs.timer_handle, _rhs.timer_handle)) {
return false;
}
if (!::fidl::Equals(_lhs.vcpu_handle, _rhs.vcpu_handle)) {
return false;
}
if (!::fidl::Equals(_lhs.vmar_handle, _rhs.vmar_handle)) {
return false;
}
if (!::fidl::Equals(_lhs.vmo_handle, _rhs.vmo_handle)) {
return false;
}
if (!::fidl::Equals(_lhs.rights_handle, _rhs.rights_handle)) {
return false;
}
if (!::fidl::Equals(_lhs.aliased_plain_handle_field,
_rhs.aliased_plain_handle_field)) {
return false;
}
if (!::fidl::Equals(_lhs.aliased_subtype_handle_field,
_rhs.aliased_subtype_handle_field)) {
return false;
}
if (!::fidl::Equals(_lhs.aliased_rights_handle_field,
_rhs.aliased_rights_handle_field)) {
return false;
}
if (!::fidl::Equals(_lhs.some_protocol, _rhs.some_protocol)) {
return false;
}
if (!::fidl::Equals(_lhs.request_some_protocol,
_rhs.request_some_protocol)) {
return false;
}
return true;
}
};
} // namespace fidl