blob: f66b84e7a949012e9af268cd0bd9a9a6499a6c03 [file] [log] [blame]
// WARNING: This file is machine generated by fidlgen.
#pragma once
#include <lib/fidl/internal.h>
#include <lib/fidl/txn_header.h>
#include <lib/fidl/llcpp/array.h>
#include <lib/fidl/llcpp/coding.h>
#include <lib/fidl/llcpp/connect_service.h>
#include <lib/fidl/llcpp/service_handler_interface.h>
#include <lib/fidl/llcpp/string_view.h>
#include <lib/fidl/llcpp/sync_call.h>
#include <lib/fidl/llcpp/traits.h>
#include <lib/fidl/llcpp/transaction.h>
#include <lib/fidl/llcpp/vector_view.h>
#include <lib/fit/function.h>
#include <lib/zx/channel.h>
#include <lib/zx/event.h>
#include <zircon/fidl.h>
namespace llcpp {
namespace fuchsia {
namespace device {
namespace schedule {
namespace work {
namespace test {
struct TestDevice_ScheduleWork_Response;
struct TestDevice_ScheduleWork_Result;
struct TestDevice_ScheduleWorkDifferentThread_Response;
struct TestDevice_ScheduleWorkDifferentThread_Result;
struct TestDevice_GetDoneEvent_Response;
struct TestDevice_GetDoneEvent_Result;
struct TestDevice_GetChannel_Response;
struct TestDevice_GetChannel_Result;
struct LatencyHistogram;
class TestDevice;
struct OwnedChannelDevice_ScheduleWork_Response;
struct OwnedChannelDevice_ScheduleWork_Result;
class OwnedChannelDevice;
extern "C" const fidl_type_t v1_fuchsia_device_schedule_work_test_TestDevice_ScheduleWork_ResultTable;
struct TestDevice_ScheduleWork_Result {
TestDevice_ScheduleWork_Result() : ordinal_(Ordinal::Invalid), envelope_{} {}
enum class Tag : fidl_xunion_tag_t {
kResponse = 1, // 0x1
kErr = 2, // 0x2
};
bool has_invalid_tag() const { return ordinal_ == Ordinal::Invalid; }
bool is_response() const { return ordinal() == Ordinal::kResponse; }
static TestDevice_ScheduleWork_Result WithResponse(::llcpp::fuchsia::device::schedule::work::test::TestDevice_ScheduleWork_Response* val) {
TestDevice_ScheduleWork_Result result;
result.set_response(val);
return result;
}
void set_response(::llcpp::fuchsia::device::schedule::work::test::TestDevice_ScheduleWork_Response* elem) {
ordinal_ = Ordinal::kResponse;
envelope_.data = static_cast<void*>(elem);
}
::llcpp::fuchsia::device::schedule::work::test::TestDevice_ScheduleWork_Response& mutable_response() {
ZX_ASSERT(ordinal() == Ordinal::kResponse);
return *static_cast<::llcpp::fuchsia::device::schedule::work::test::TestDevice_ScheduleWork_Response*>(envelope_.data);
}
const ::llcpp::fuchsia::device::schedule::work::test::TestDevice_ScheduleWork_Response& response() const {
ZX_ASSERT(ordinal() == Ordinal::kResponse);
return *static_cast<::llcpp::fuchsia::device::schedule::work::test::TestDevice_ScheduleWork_Response*>(envelope_.data);
}
bool is_err() const { return ordinal() == Ordinal::kErr; }
static TestDevice_ScheduleWork_Result WithErr(int32_t* val) {
TestDevice_ScheduleWork_Result result;
result.set_err(val);
return result;
}
void set_err(int32_t* elem) {
ordinal_ = Ordinal::kErr;
envelope_.data = static_cast<void*>(elem);
}
int32_t& mutable_err() {
ZX_ASSERT(ordinal() == Ordinal::kErr);
return *static_cast<int32_t*>(envelope_.data);
}
const int32_t& err() const {
ZX_ASSERT(ordinal() == Ordinal::kErr);
return *static_cast<int32_t*>(envelope_.data);
}
Tag which() const {
ZX_ASSERT(!has_invalid_tag());
return static_cast<Tag>(ordinal());
}
static constexpr const fidl_type_t* Type = &v1_fuchsia_device_schedule_work_test_TestDevice_ScheduleWork_ResultTable;
static constexpr uint32_t MaxNumHandles = 0;
static constexpr uint32_t PrimarySize = 24;
[[maybe_unused]]
static constexpr uint32_t MaxOutOfLine = 8;
static constexpr bool HasPointer = true;
private:
enum class Ordinal : fidl_xunion_tag_t {
Invalid = 0,
kResponse = 1, // 0x1
kErr = 2, // 0x2
};
Ordinal ordinal() const {
return ordinal_;
}
static void SizeAndOffsetAssertionHelper();
Ordinal ordinal_;
FIDL_ALIGNDECL
fidl_envelope_t envelope_;
};
extern "C" const fidl_type_t v1_fuchsia_device_schedule_work_test_TestDevice_ScheduleWorkDifferentThread_ResultTable;
struct TestDevice_ScheduleWorkDifferentThread_Result {
TestDevice_ScheduleWorkDifferentThread_Result() : ordinal_(Ordinal::Invalid), envelope_{} {}
enum class Tag : fidl_xunion_tag_t {
kResponse = 1, // 0x1
kErr = 2, // 0x2
};
bool has_invalid_tag() const { return ordinal_ == Ordinal::Invalid; }
bool is_response() const { return ordinal() == Ordinal::kResponse; }
static TestDevice_ScheduleWorkDifferentThread_Result WithResponse(::llcpp::fuchsia::device::schedule::work::test::TestDevice_ScheduleWorkDifferentThread_Response* val) {
TestDevice_ScheduleWorkDifferentThread_Result result;
result.set_response(val);
return result;
}
void set_response(::llcpp::fuchsia::device::schedule::work::test::TestDevice_ScheduleWorkDifferentThread_Response* elem) {
ordinal_ = Ordinal::kResponse;
envelope_.data = static_cast<void*>(elem);
}
::llcpp::fuchsia::device::schedule::work::test::TestDevice_ScheduleWorkDifferentThread_Response& mutable_response() {
ZX_ASSERT(ordinal() == Ordinal::kResponse);
return *static_cast<::llcpp::fuchsia::device::schedule::work::test::TestDevice_ScheduleWorkDifferentThread_Response*>(envelope_.data);
}
const ::llcpp::fuchsia::device::schedule::work::test::TestDevice_ScheduleWorkDifferentThread_Response& response() const {
ZX_ASSERT(ordinal() == Ordinal::kResponse);
return *static_cast<::llcpp::fuchsia::device::schedule::work::test::TestDevice_ScheduleWorkDifferentThread_Response*>(envelope_.data);
}
bool is_err() const { return ordinal() == Ordinal::kErr; }
static TestDevice_ScheduleWorkDifferentThread_Result WithErr(int32_t* val) {
TestDevice_ScheduleWorkDifferentThread_Result result;
result.set_err(val);
return result;
}
void set_err(int32_t* elem) {
ordinal_ = Ordinal::kErr;
envelope_.data = static_cast<void*>(elem);
}
int32_t& mutable_err() {
ZX_ASSERT(ordinal() == Ordinal::kErr);
return *static_cast<int32_t*>(envelope_.data);
}
const int32_t& err() const {
ZX_ASSERT(ordinal() == Ordinal::kErr);
return *static_cast<int32_t*>(envelope_.data);
}
Tag which() const {
ZX_ASSERT(!has_invalid_tag());
return static_cast<Tag>(ordinal());
}
static constexpr const fidl_type_t* Type = &v1_fuchsia_device_schedule_work_test_TestDevice_ScheduleWorkDifferentThread_ResultTable;
static constexpr uint32_t MaxNumHandles = 0;
static constexpr uint32_t PrimarySize = 24;
[[maybe_unused]]
static constexpr uint32_t MaxOutOfLine = 8;
static constexpr bool HasPointer = true;
private:
enum class Ordinal : fidl_xunion_tag_t {
Invalid = 0,
kResponse = 1, // 0x1
kErr = 2, // 0x2
};
Ordinal ordinal() const {
return ordinal_;
}
static void SizeAndOffsetAssertionHelper();
Ordinal ordinal_;
FIDL_ALIGNDECL
fidl_envelope_t envelope_;
};
extern "C" const fidl_type_t v1_fuchsia_device_schedule_work_test_TestDevice_GetDoneEvent_ResultTable;
struct TestDevice_GetDoneEvent_Result {
TestDevice_GetDoneEvent_Result() : ordinal_(Ordinal::Invalid), envelope_{} {}
enum class Tag : fidl_xunion_tag_t {
kResponse = 1, // 0x1
kErr = 2, // 0x2
};
bool has_invalid_tag() const { return ordinal_ == Ordinal::Invalid; }
bool is_response() const { return ordinal() == Ordinal::kResponse; }
static TestDevice_GetDoneEvent_Result WithResponse(::llcpp::fuchsia::device::schedule::work::test::TestDevice_GetDoneEvent_Response* val) {
TestDevice_GetDoneEvent_Result result;
result.set_response(val);
return result;
}
void set_response(::llcpp::fuchsia::device::schedule::work::test::TestDevice_GetDoneEvent_Response* elem) {
ordinal_ = Ordinal::kResponse;
envelope_.data = static_cast<void*>(elem);
}
::llcpp::fuchsia::device::schedule::work::test::TestDevice_GetDoneEvent_Response& mutable_response() {
ZX_ASSERT(ordinal() == Ordinal::kResponse);
return *static_cast<::llcpp::fuchsia::device::schedule::work::test::TestDevice_GetDoneEvent_Response*>(envelope_.data);
}
const ::llcpp::fuchsia::device::schedule::work::test::TestDevice_GetDoneEvent_Response& response() const {
ZX_ASSERT(ordinal() == Ordinal::kResponse);
return *static_cast<::llcpp::fuchsia::device::schedule::work::test::TestDevice_GetDoneEvent_Response*>(envelope_.data);
}
bool is_err() const { return ordinal() == Ordinal::kErr; }
static TestDevice_GetDoneEvent_Result WithErr(int32_t* val) {
TestDevice_GetDoneEvent_Result result;
result.set_err(val);
return result;
}
void set_err(int32_t* elem) {
ordinal_ = Ordinal::kErr;
envelope_.data = static_cast<void*>(elem);
}
int32_t& mutable_err() {
ZX_ASSERT(ordinal() == Ordinal::kErr);
return *static_cast<int32_t*>(envelope_.data);
}
const int32_t& err() const {
ZX_ASSERT(ordinal() == Ordinal::kErr);
return *static_cast<int32_t*>(envelope_.data);
}
Tag which() const {
ZX_ASSERT(!has_invalid_tag());
return static_cast<Tag>(ordinal());
}
static constexpr const fidl_type_t* Type = &v1_fuchsia_device_schedule_work_test_TestDevice_GetDoneEvent_ResultTable;
static constexpr uint32_t MaxNumHandles = 1;
static constexpr uint32_t PrimarySize = 24;
[[maybe_unused]]
static constexpr uint32_t MaxOutOfLine = 8;
static constexpr bool HasPointer = true;
private:
enum class Ordinal : fidl_xunion_tag_t {
Invalid = 0,
kResponse = 1, // 0x1
kErr = 2, // 0x2
};
Ordinal ordinal() const {
return ordinal_;
}
static void SizeAndOffsetAssertionHelper();
Ordinal ordinal_;
FIDL_ALIGNDECL
fidl_envelope_t envelope_;
};
extern "C" const fidl_type_t v1_fuchsia_device_schedule_work_test_TestDevice_GetChannel_ResultTable;
struct TestDevice_GetChannel_Result {
TestDevice_GetChannel_Result() : ordinal_(Ordinal::Invalid), envelope_{} {}
enum class Tag : fidl_xunion_tag_t {
kResponse = 1, // 0x1
kErr = 2, // 0x2
};
bool has_invalid_tag() const { return ordinal_ == Ordinal::Invalid; }
bool is_response() const { return ordinal() == Ordinal::kResponse; }
static TestDevice_GetChannel_Result WithResponse(::llcpp::fuchsia::device::schedule::work::test::TestDevice_GetChannel_Response* val) {
TestDevice_GetChannel_Result result;
result.set_response(val);
return result;
}
void set_response(::llcpp::fuchsia::device::schedule::work::test::TestDevice_GetChannel_Response* elem) {
ordinal_ = Ordinal::kResponse;
envelope_.data = static_cast<void*>(elem);
}
::llcpp::fuchsia::device::schedule::work::test::TestDevice_GetChannel_Response& mutable_response() {
ZX_ASSERT(ordinal() == Ordinal::kResponse);
return *static_cast<::llcpp::fuchsia::device::schedule::work::test::TestDevice_GetChannel_Response*>(envelope_.data);
}
const ::llcpp::fuchsia::device::schedule::work::test::TestDevice_GetChannel_Response& response() const {
ZX_ASSERT(ordinal() == Ordinal::kResponse);
return *static_cast<::llcpp::fuchsia::device::schedule::work::test::TestDevice_GetChannel_Response*>(envelope_.data);
}
bool is_err() const { return ordinal() == Ordinal::kErr; }
static TestDevice_GetChannel_Result WithErr(int32_t* val) {
TestDevice_GetChannel_Result result;
result.set_err(val);
return result;
}
void set_err(int32_t* elem) {
ordinal_ = Ordinal::kErr;
envelope_.data = static_cast<void*>(elem);
}
int32_t& mutable_err() {
ZX_ASSERT(ordinal() == Ordinal::kErr);
return *static_cast<int32_t*>(envelope_.data);
}
const int32_t& err() const {
ZX_ASSERT(ordinal() == Ordinal::kErr);
return *static_cast<int32_t*>(envelope_.data);
}
Tag which() const {
ZX_ASSERT(!has_invalid_tag());
return static_cast<Tag>(ordinal());
}
static constexpr const fidl_type_t* Type = &v1_fuchsia_device_schedule_work_test_TestDevice_GetChannel_ResultTable;
static constexpr uint32_t MaxNumHandles = 0;
static constexpr uint32_t PrimarySize = 24;
[[maybe_unused]]
static constexpr uint32_t MaxOutOfLine = 8;
static constexpr bool HasPointer = true;
private:
enum class Ordinal : fidl_xunion_tag_t {
Invalid = 0,
kResponse = 1, // 0x1
kErr = 2, // 0x2
};
Ordinal ordinal() const {
return ordinal_;
}
static void SizeAndOffsetAssertionHelper();
Ordinal ordinal_;
FIDL_ALIGNDECL
fidl_envelope_t envelope_;
};
extern "C" const fidl_type_t v1_fuchsia_device_schedule_work_test_OwnedChannelDevice_ScheduleWork_ResultTable;
struct OwnedChannelDevice_ScheduleWork_Result {
OwnedChannelDevice_ScheduleWork_Result() : ordinal_(Ordinal::Invalid), envelope_{} {}
enum class Tag : fidl_xunion_tag_t {
kResponse = 1, // 0x1
kErr = 2, // 0x2
};
bool has_invalid_tag() const { return ordinal_ == Ordinal::Invalid; }
bool is_response() const { return ordinal() == Ordinal::kResponse; }
static OwnedChannelDevice_ScheduleWork_Result WithResponse(::llcpp::fuchsia::device::schedule::work::test::OwnedChannelDevice_ScheduleWork_Response* val) {
OwnedChannelDevice_ScheduleWork_Result result;
result.set_response(val);
return result;
}
void set_response(::llcpp::fuchsia::device::schedule::work::test::OwnedChannelDevice_ScheduleWork_Response* elem) {
ordinal_ = Ordinal::kResponse;
envelope_.data = static_cast<void*>(elem);
}
::llcpp::fuchsia::device::schedule::work::test::OwnedChannelDevice_ScheduleWork_Response& mutable_response() {
ZX_ASSERT(ordinal() == Ordinal::kResponse);
return *static_cast<::llcpp::fuchsia::device::schedule::work::test::OwnedChannelDevice_ScheduleWork_Response*>(envelope_.data);
}
const ::llcpp::fuchsia::device::schedule::work::test::OwnedChannelDevice_ScheduleWork_Response& response() const {
ZX_ASSERT(ordinal() == Ordinal::kResponse);
return *static_cast<::llcpp::fuchsia::device::schedule::work::test::OwnedChannelDevice_ScheduleWork_Response*>(envelope_.data);
}
bool is_err() const { return ordinal() == Ordinal::kErr; }
static OwnedChannelDevice_ScheduleWork_Result WithErr(int32_t* val) {
OwnedChannelDevice_ScheduleWork_Result result;
result.set_err(val);
return result;
}
void set_err(int32_t* elem) {
ordinal_ = Ordinal::kErr;
envelope_.data = static_cast<void*>(elem);
}
int32_t& mutable_err() {
ZX_ASSERT(ordinal() == Ordinal::kErr);
return *static_cast<int32_t*>(envelope_.data);
}
const int32_t& err() const {
ZX_ASSERT(ordinal() == Ordinal::kErr);
return *static_cast<int32_t*>(envelope_.data);
}
Tag which() const {
ZX_ASSERT(!has_invalid_tag());
return static_cast<Tag>(ordinal());
}
static constexpr const fidl_type_t* Type = &v1_fuchsia_device_schedule_work_test_OwnedChannelDevice_ScheduleWork_ResultTable;
static constexpr uint32_t MaxNumHandles = 0;
static constexpr uint32_t PrimarySize = 24;
[[maybe_unused]]
static constexpr uint32_t MaxOutOfLine = 80;
static constexpr bool HasPointer = true;
private:
enum class Ordinal : fidl_xunion_tag_t {
Invalid = 0,
kResponse = 1, // 0x1
kErr = 2, // 0x2
};
Ordinal ordinal() const {
return ordinal_;
}
static void SizeAndOffsetAssertionHelper();
Ordinal ordinal_;
FIDL_ALIGNDECL
fidl_envelope_t envelope_;
};
extern "C" const fidl_type_t v1_fuchsia_device_schedule_work_test_TestDevice_ScheduleWork_ResponseTable;
struct TestDevice_ScheduleWork_Response {
static constexpr const fidl_type_t* Type = &v1_fuchsia_device_schedule_work_test_TestDevice_ScheduleWork_ResponseTable;
static constexpr uint32_t MaxNumHandles = 0;
static constexpr uint32_t PrimarySize = 1;
[[maybe_unused]]
static constexpr uint32_t MaxOutOfLine = 0;
static constexpr bool HasPointer = false;
uint8_t __reserved = {};
};
extern "C" const fidl_type_t v1_fuchsia_device_schedule_work_test_TestDevice_ScheduleWorkDifferentThread_ResponseTable;
struct TestDevice_ScheduleWorkDifferentThread_Response {
static constexpr const fidl_type_t* Type = &v1_fuchsia_device_schedule_work_test_TestDevice_ScheduleWorkDifferentThread_ResponseTable;
static constexpr uint32_t MaxNumHandles = 0;
static constexpr uint32_t PrimarySize = 1;
[[maybe_unused]]
static constexpr uint32_t MaxOutOfLine = 0;
static constexpr bool HasPointer = false;
uint8_t __reserved = {};
};
extern "C" const fidl_type_t v1_fuchsia_device_schedule_work_test_TestDevice_GetDoneEvent_ResponseTable;
struct TestDevice_GetDoneEvent_Response {
static constexpr const fidl_type_t* Type = &v1_fuchsia_device_schedule_work_test_TestDevice_GetDoneEvent_ResponseTable;
static constexpr uint32_t MaxNumHandles = 1;
static constexpr uint32_t PrimarySize = 4;
[[maybe_unused]]
static constexpr uint32_t MaxOutOfLine = 0;
static constexpr bool HasPointer = false;
::zx::event event = {};
};
extern "C" const fidl_type_t v1_fuchsia_device_schedule_work_test_TestDevice_GetChannel_ResponseTable;
struct TestDevice_GetChannel_Response {
static constexpr const fidl_type_t* Type = &v1_fuchsia_device_schedule_work_test_TestDevice_GetChannel_ResponseTable;
static constexpr uint32_t MaxNumHandles = 0;
static constexpr uint32_t PrimarySize = 1;
[[maybe_unused]]
static constexpr uint32_t MaxOutOfLine = 0;
static constexpr bool HasPointer = false;
uint8_t __reserved = {};
};
extern "C" const fidl_type_t v1_fuchsia_device_schedule_work_test_LatencyHistogramTable;
// Buckets are arranged as following:
// [0] => [0ns, 100ns]
// [1] => [100ns, 250ns]
// [2] => [250ns, 500ns]
// [3] => [500ns, 1us]
// [4] => [1us, 2us]
// [5] => [2us, 4us]
// [6] => [4us, 7us]
// [7] => [7us, 15us]
// [8] => [15us, 30us]
// [9] => [30us, infinity]
struct LatencyHistogram {
static constexpr const fidl_type_t* Type = &v1_fuchsia_device_schedule_work_test_LatencyHistogramTable;
static constexpr uint32_t MaxNumHandles = 0;
static constexpr uint32_t PrimarySize = 80;
[[maybe_unused]]
static constexpr uint32_t MaxOutOfLine = 0;
static constexpr bool HasPointer = false;
::fidl::Array<uint64_t, 10> buckets = {};
};
extern "C" const fidl_type_t v1_fuchsia_device_schedule_work_test_TestDeviceScheduleWorkRequestTable;
extern "C" const fidl_type_t v1_fuchsia_device_schedule_work_test_TestDeviceScheduleWorkResponseTable;
extern "C" const fidl_type_t v1_fuchsia_device_schedule_work_test_TestDeviceScheduleWorkDifferentThreadRequestTable;
extern "C" const fidl_type_t v1_fuchsia_device_schedule_work_test_TestDeviceScheduleWorkDifferentThreadResponseTable;
extern "C" const fidl_type_t v1_fuchsia_device_schedule_work_test_TestDeviceGetDoneEventRequestTable;
extern "C" const fidl_type_t v1_fuchsia_device_schedule_work_test_TestDeviceGetDoneEventResponseTable;
extern "C" const fidl_type_t v1_fuchsia_device_schedule_work_test_TestDeviceScheduledWorkRanRequestTable;
extern "C" const fidl_type_t v1_fuchsia_device_schedule_work_test_TestDeviceScheduledWorkRanResponseTable;
extern "C" const fidl_type_t v1_fuchsia_device_schedule_work_test_TestDeviceGetChannelRequestTable;
extern "C" const fidl_type_t v1_fuchsia_device_schedule_work_test_TestDeviceGetChannelResponseTable;
class TestDevice final {
TestDevice() = delete;
public:
struct ScheduleWorkResponse final {
FIDL_ALIGNDECL
fidl_message_header_t _hdr;
::llcpp::fuchsia::device::schedule::work::test::TestDevice_ScheduleWork_Result result;
static constexpr const fidl_type_t* Type = &v1_fuchsia_device_schedule_work_test_TestDeviceScheduleWorkResponseTable;
static constexpr uint32_t MaxNumHandles = 0;
static constexpr uint32_t PrimarySize = 40;
static constexpr uint32_t MaxOutOfLine = 8;
static constexpr bool HasFlexibleEnvelope = false;
static constexpr bool HasPointer = true;
static constexpr bool ContainsUnion = true;
static constexpr ::fidl::internal::TransactionalMessageKind MessageKind =
::fidl::internal::TransactionalMessageKind::kResponse;
};
struct ScheduleWorkRequest final {
FIDL_ALIGNDECL
fidl_message_header_t _hdr;
uint32_t batch_size;
uint32_t num_work_items;
static constexpr const fidl_type_t* Type = &v1_fuchsia_device_schedule_work_test_TestDeviceScheduleWorkRequestTable;
static constexpr uint32_t MaxNumHandles = 0;
static constexpr uint32_t PrimarySize = 24;
static constexpr uint32_t MaxOutOfLine = 0;
static constexpr uint32_t AltPrimarySize = 24;
static constexpr uint32_t AltMaxOutOfLine = 0;
static constexpr bool HasFlexibleEnvelope = false;
static constexpr bool HasPointer = false;
static constexpr bool ContainsUnion = false;
static constexpr ::fidl::internal::TransactionalMessageKind MessageKind =
::fidl::internal::TransactionalMessageKind::kRequest;
using ResponseType = ScheduleWorkResponse;
};
struct ScheduleWorkDifferentThreadResponse final {
FIDL_ALIGNDECL
fidl_message_header_t _hdr;
::llcpp::fuchsia::device::schedule::work::test::TestDevice_ScheduleWorkDifferentThread_Result result;
static constexpr const fidl_type_t* Type = &v1_fuchsia_device_schedule_work_test_TestDeviceScheduleWorkDifferentThreadResponseTable;
static constexpr uint32_t MaxNumHandles = 0;
static constexpr uint32_t PrimarySize = 40;
static constexpr uint32_t MaxOutOfLine = 8;
static constexpr bool HasFlexibleEnvelope = false;
static constexpr bool HasPointer = true;
static constexpr bool ContainsUnion = true;
static constexpr ::fidl::internal::TransactionalMessageKind MessageKind =
::fidl::internal::TransactionalMessageKind::kResponse;
};
using ScheduleWorkDifferentThreadRequest = ::fidl::AnyZeroArgMessage;
struct GetDoneEventResponse final {
FIDL_ALIGNDECL
fidl_message_header_t _hdr;
::llcpp::fuchsia::device::schedule::work::test::TestDevice_GetDoneEvent_Result result;
static constexpr const fidl_type_t* Type = &v1_fuchsia_device_schedule_work_test_TestDeviceGetDoneEventResponseTable;
static constexpr uint32_t MaxNumHandles = 1;
static constexpr uint32_t PrimarySize = 40;
static constexpr uint32_t MaxOutOfLine = 8;
static constexpr bool HasFlexibleEnvelope = false;
static constexpr bool HasPointer = true;
static constexpr bool ContainsUnion = true;
static constexpr ::fidl::internal::TransactionalMessageKind MessageKind =
::fidl::internal::TransactionalMessageKind::kResponse;
};
using GetDoneEventRequest = ::fidl::AnyZeroArgMessage;
struct ScheduledWorkRanResponse final {
FIDL_ALIGNDECL
fidl_message_header_t _hdr;
uint32_t work_items_run;
::llcpp::fuchsia::device::schedule::work::test::LatencyHistogram histogram;
static constexpr const fidl_type_t* Type = &v1_fuchsia_device_schedule_work_test_TestDeviceScheduledWorkRanResponseTable;
static constexpr uint32_t MaxNumHandles = 0;
static constexpr uint32_t PrimarySize = 104;
static constexpr uint32_t MaxOutOfLine = 0;
static constexpr bool HasFlexibleEnvelope = false;
static constexpr bool HasPointer = false;
static constexpr bool ContainsUnion = false;
static constexpr ::fidl::internal::TransactionalMessageKind MessageKind =
::fidl::internal::TransactionalMessageKind::kResponse;
};
using ScheduledWorkRanRequest = ::fidl::AnyZeroArgMessage;
struct GetChannelResponse final {
FIDL_ALIGNDECL
fidl_message_header_t _hdr;
::llcpp::fuchsia::device::schedule::work::test::TestDevice_GetChannel_Result result;
static constexpr const fidl_type_t* Type = &v1_fuchsia_device_schedule_work_test_TestDeviceGetChannelResponseTable;
static constexpr uint32_t MaxNumHandles = 0;
static constexpr uint32_t PrimarySize = 40;
static constexpr uint32_t MaxOutOfLine = 8;
static constexpr bool HasFlexibleEnvelope = false;
static constexpr bool HasPointer = true;
static constexpr bool ContainsUnion = true;
static constexpr ::fidl::internal::TransactionalMessageKind MessageKind =
::fidl::internal::TransactionalMessageKind::kResponse;
};
struct GetChannelRequest final {
FIDL_ALIGNDECL
fidl_message_header_t _hdr;
::zx::channel test;
static constexpr const fidl_type_t* Type = &v1_fuchsia_device_schedule_work_test_TestDeviceGetChannelRequestTable;
static constexpr uint32_t MaxNumHandles = 1;
static constexpr uint32_t PrimarySize = 24;
static constexpr uint32_t MaxOutOfLine = 0;
static constexpr uint32_t AltPrimarySize = 24;
static constexpr uint32_t AltMaxOutOfLine = 0;
static constexpr bool HasFlexibleEnvelope = false;
static constexpr bool HasPointer = false;
static constexpr bool ContainsUnion = false;
static constexpr ::fidl::internal::TransactionalMessageKind MessageKind =
::fidl::internal::TransactionalMessageKind::kRequest;
using ResponseType = GetChannelResponse;
};
// Collection of return types of FIDL calls in this interface.
class ResultOf final {
ResultOf() = delete;
private:
template <typename ResponseType>
class ScheduleWork_Impl final : private ::fidl::internal::OwnedSyncCallBase<ResponseType> {
using Super = ::fidl::internal::OwnedSyncCallBase<ResponseType>;
public:
ScheduleWork_Impl(::zx::unowned_channel _client_end, uint32_t batch_size, uint32_t num_work_items);
~ScheduleWork_Impl() = default;
ScheduleWork_Impl(ScheduleWork_Impl&& other) = default;
ScheduleWork_Impl& operator=(ScheduleWork_Impl&& other) = default;
using Super::status;
using Super::error;
using Super::ok;
using Super::Unwrap;
using Super::value;
using Super::operator->;
using Super::operator*;
};
template <typename ResponseType>
class ScheduleWorkDifferentThread_Impl final : private ::fidl::internal::OwnedSyncCallBase<ResponseType> {
using Super = ::fidl::internal::OwnedSyncCallBase<ResponseType>;
public:
ScheduleWorkDifferentThread_Impl(::zx::unowned_channel _client_end);
~ScheduleWorkDifferentThread_Impl() = default;
ScheduleWorkDifferentThread_Impl(ScheduleWorkDifferentThread_Impl&& other) = default;
ScheduleWorkDifferentThread_Impl& operator=(ScheduleWorkDifferentThread_Impl&& other) = default;
using Super::status;
using Super::error;
using Super::ok;
using Super::Unwrap;
using Super::value;
using Super::operator->;
using Super::operator*;
};
template <typename ResponseType>
class GetDoneEvent_Impl final : private ::fidl::internal::OwnedSyncCallBase<ResponseType> {
using Super = ::fidl::internal::OwnedSyncCallBase<ResponseType>;
public:
GetDoneEvent_Impl(::zx::unowned_channel _client_end);
~GetDoneEvent_Impl() = default;
GetDoneEvent_Impl(GetDoneEvent_Impl&& other) = default;
GetDoneEvent_Impl& operator=(GetDoneEvent_Impl&& other) = default;
using Super::status;
using Super::error;
using Super::ok;
using Super::Unwrap;
using Super::value;
using Super::operator->;
using Super::operator*;
};
template <typename ResponseType>
class ScheduledWorkRan_Impl final : private ::fidl::internal::OwnedSyncCallBase<ResponseType> {
using Super = ::fidl::internal::OwnedSyncCallBase<ResponseType>;
public:
ScheduledWorkRan_Impl(::zx::unowned_channel _client_end);
~ScheduledWorkRan_Impl() = default;
ScheduledWorkRan_Impl(ScheduledWorkRan_Impl&& other) = default;
ScheduledWorkRan_Impl& operator=(ScheduledWorkRan_Impl&& other) = default;
using Super::status;
using Super::error;
using Super::ok;
using Super::Unwrap;
using Super::value;
using Super::operator->;
using Super::operator*;
};
template <typename ResponseType>
class GetChannel_Impl final : private ::fidl::internal::OwnedSyncCallBase<ResponseType> {
using Super = ::fidl::internal::OwnedSyncCallBase<ResponseType>;
public:
GetChannel_Impl(::zx::unowned_channel _client_end, ::zx::channel test);
~GetChannel_Impl() = default;
GetChannel_Impl(GetChannel_Impl&& other) = default;
GetChannel_Impl& operator=(GetChannel_Impl&& other) = default;
using Super::status;
using Super::error;
using Super::ok;
using Super::Unwrap;
using Super::value;
using Super::operator->;
using Super::operator*;
};
public:
using ScheduleWork = ScheduleWork_Impl<ScheduleWorkResponse>;
using ScheduleWorkDifferentThread = ScheduleWorkDifferentThread_Impl<ScheduleWorkDifferentThreadResponse>;
using GetDoneEvent = GetDoneEvent_Impl<GetDoneEventResponse>;
using ScheduledWorkRan = ScheduledWorkRan_Impl<ScheduledWorkRanResponse>;
using GetChannel = GetChannel_Impl<GetChannelResponse>;
};
// Collection of return types of FIDL calls in this interface,
// when the caller-allocate flavor or in-place call is used.
class UnownedResultOf final {
UnownedResultOf() = delete;
private:
template <typename ResponseType>
class ScheduleWork_Impl final : private ::fidl::internal::UnownedSyncCallBase<ResponseType> {
using Super = ::fidl::internal::UnownedSyncCallBase<ResponseType>;
public:
ScheduleWork_Impl(::zx::unowned_channel _client_end, ::fidl::BytePart _request_buffer, uint32_t batch_size, uint32_t num_work_items, ::fidl::BytePart _response_buffer);
~ScheduleWork_Impl() = default;
ScheduleWork_Impl(ScheduleWork_Impl&& other) = default;
ScheduleWork_Impl& operator=(ScheduleWork_Impl&& other) = default;
using Super::status;
using Super::error;
using Super::ok;
using Super::Unwrap;
using Super::value;
using Super::operator->;
using Super::operator*;
};
template <typename ResponseType>
class ScheduleWorkDifferentThread_Impl final : private ::fidl::internal::UnownedSyncCallBase<ResponseType> {
using Super = ::fidl::internal::UnownedSyncCallBase<ResponseType>;
public:
ScheduleWorkDifferentThread_Impl(::zx::unowned_channel _client_end, ::fidl::BytePart _response_buffer);
~ScheduleWorkDifferentThread_Impl() = default;
ScheduleWorkDifferentThread_Impl(ScheduleWorkDifferentThread_Impl&& other) = default;
ScheduleWorkDifferentThread_Impl& operator=(ScheduleWorkDifferentThread_Impl&& other) = default;
using Super::status;
using Super::error;
using Super::ok;
using Super::Unwrap;
using Super::value;
using Super::operator->;
using Super::operator*;
};
template <typename ResponseType>
class GetDoneEvent_Impl final : private ::fidl::internal::UnownedSyncCallBase<ResponseType> {
using Super = ::fidl::internal::UnownedSyncCallBase<ResponseType>;
public:
GetDoneEvent_Impl(::zx::unowned_channel _client_end, ::fidl::BytePart _response_buffer);
~GetDoneEvent_Impl() = default;
GetDoneEvent_Impl(GetDoneEvent_Impl&& other) = default;
GetDoneEvent_Impl& operator=(GetDoneEvent_Impl&& other) = default;
using Super::status;
using Super::error;
using Super::ok;
using Super::Unwrap;
using Super::value;
using Super::operator->;
using Super::operator*;
};
template <typename ResponseType>
class ScheduledWorkRan_Impl final : private ::fidl::internal::UnownedSyncCallBase<ResponseType> {
using Super = ::fidl::internal::UnownedSyncCallBase<ResponseType>;
public:
ScheduledWorkRan_Impl(::zx::unowned_channel _client_end, ::fidl::BytePart _response_buffer);
~ScheduledWorkRan_Impl() = default;
ScheduledWorkRan_Impl(ScheduledWorkRan_Impl&& other) = default;
ScheduledWorkRan_Impl& operator=(ScheduledWorkRan_Impl&& other) = default;
using Super::status;
using Super::error;
using Super::ok;
using Super::Unwrap;
using Super::value;
using Super::operator->;
using Super::operator*;
};
template <typename ResponseType>
class GetChannel_Impl final : private ::fidl::internal::UnownedSyncCallBase<ResponseType> {
using Super = ::fidl::internal::UnownedSyncCallBase<ResponseType>;
public:
GetChannel_Impl(::zx::unowned_channel _client_end, ::fidl::BytePart _request_buffer, ::zx::channel test, ::fidl::BytePart _response_buffer);
~GetChannel_Impl() = default;
GetChannel_Impl(GetChannel_Impl&& other) = default;
GetChannel_Impl& operator=(GetChannel_Impl&& other) = default;
using Super::status;
using Super::error;
using Super::ok;
using Super::Unwrap;
using Super::value;
using Super::operator->;
using Super::operator*;
};
public:
using ScheduleWork = ScheduleWork_Impl<ScheduleWorkResponse>;
using ScheduleWorkDifferentThread = ScheduleWorkDifferentThread_Impl<ScheduleWorkDifferentThreadResponse>;
using GetDoneEvent = GetDoneEvent_Impl<GetDoneEventResponse>;
using ScheduledWorkRan = ScheduledWorkRan_Impl<ScheduledWorkRanResponse>;
using GetChannel = GetChannel_Impl<GetChannelResponse>;
};
class SyncClient final {
public:
explicit SyncClient(::zx::channel channel) : channel_(std::move(channel)) {}
~SyncClient() = default;
SyncClient(SyncClient&&) = default;
SyncClient& operator=(SyncClient&&) = default;
const ::zx::channel& channel() const { return channel_; }
::zx::channel* mutable_channel() { return &channel_; }
// Schedules work. |batch_size| refers to how many work_items to keep
// outstanding at any given time, while |num_work_items| refers to total
// number of work items.
// Allocates 72 bytes of message buffer on the stack. No heap allocation necessary.
ResultOf::ScheduleWork ScheduleWork(uint32_t batch_size, uint32_t num_work_items);
// Schedules work. |batch_size| refers to how many work_items to keep
// outstanding at any given time, while |num_work_items| refers to total
// number of work items.
// Caller provides the backing storage for FIDL message via request and response buffers.
UnownedResultOf::ScheduleWork ScheduleWork(::fidl::BytePart _request_buffer, uint32_t batch_size, uint32_t num_work_items, ::fidl::BytePart _response_buffer);
// Spawns a thread which schedules work.
// Allocates 64 bytes of message buffer on the stack. No heap allocation necessary.
ResultOf::ScheduleWorkDifferentThread ScheduleWorkDifferentThread();
// Spawns a thread which schedules work.
// Caller provides the backing storage for FIDL message via request and response buffers.
UnownedResultOf::ScheduleWorkDifferentThread ScheduleWorkDifferentThread(::fidl::BytePart _response_buffer);
// Triggers once all outstanding work is complete.
// Allocates 64 bytes of message buffer on the stack. No heap allocation necessary.
ResultOf::GetDoneEvent GetDoneEvent();
// Triggers once all outstanding work is complete.
// Caller provides the backing storage for FIDL message via request and response buffers.
UnownedResultOf::GetDoneEvent GetDoneEvent(::fidl::BytePart _response_buffer);
// Returns whether how many work items ran since last time it was invoked.
// Allocates 120 bytes of message buffer on the stack. No heap allocation necessary.
ResultOf::ScheduledWorkRan ScheduledWorkRan();
// Returns whether how many work items ran since last time it was invoked.
// Caller provides the backing storage for FIDL message via request and response buffers.
UnownedResultOf::ScheduledWorkRan ScheduledWorkRan(::fidl::BytePart _response_buffer);
// Spawns an thread with a dedicated async loop.
// Allocates 72 bytes of message buffer on the stack. No heap allocation necessary.
ResultOf::GetChannel GetChannel(::zx::channel test);
// Spawns an thread with a dedicated async loop.
// Caller provides the backing storage for FIDL message via request and response buffers.
UnownedResultOf::GetChannel GetChannel(::fidl::BytePart _request_buffer, ::zx::channel test, ::fidl::BytePart _response_buffer);
private:
::zx::channel channel_;
};
// Methods to make a sync FIDL call directly on an unowned channel, avoiding setting up a client.
class Call final {
Call() = delete;
public:
// Schedules work. |batch_size| refers to how many work_items to keep
// outstanding at any given time, while |num_work_items| refers to total
// number of work items.
// Allocates 72 bytes of message buffer on the stack. No heap allocation necessary.
static ResultOf::ScheduleWork ScheduleWork(::zx::unowned_channel _client_end, uint32_t batch_size, uint32_t num_work_items);
// Schedules work. |batch_size| refers to how many work_items to keep
// outstanding at any given time, while |num_work_items| refers to total
// number of work items.
// Caller provides the backing storage for FIDL message via request and response buffers.
static UnownedResultOf::ScheduleWork ScheduleWork(::zx::unowned_channel _client_end, ::fidl::BytePart _request_buffer, uint32_t batch_size, uint32_t num_work_items, ::fidl::BytePart _response_buffer);
// Spawns a thread which schedules work.
// Allocates 64 bytes of message buffer on the stack. No heap allocation necessary.
static ResultOf::ScheduleWorkDifferentThread ScheduleWorkDifferentThread(::zx::unowned_channel _client_end);
// Spawns a thread which schedules work.
// Caller provides the backing storage for FIDL message via request and response buffers.
static UnownedResultOf::ScheduleWorkDifferentThread ScheduleWorkDifferentThread(::zx::unowned_channel _client_end, ::fidl::BytePart _response_buffer);
// Triggers once all outstanding work is complete.
// Allocates 64 bytes of message buffer on the stack. No heap allocation necessary.
static ResultOf::GetDoneEvent GetDoneEvent(::zx::unowned_channel _client_end);
// Triggers once all outstanding work is complete.
// Caller provides the backing storage for FIDL message via request and response buffers.
static UnownedResultOf::GetDoneEvent GetDoneEvent(::zx::unowned_channel _client_end, ::fidl::BytePart _response_buffer);
// Returns whether how many work items ran since last time it was invoked.
// Allocates 120 bytes of message buffer on the stack. No heap allocation necessary.
static ResultOf::ScheduledWorkRan ScheduledWorkRan(::zx::unowned_channel _client_end);
// Returns whether how many work items ran since last time it was invoked.
// Caller provides the backing storage for FIDL message via request and response buffers.
static UnownedResultOf::ScheduledWorkRan ScheduledWorkRan(::zx::unowned_channel _client_end, ::fidl::BytePart _response_buffer);
// Spawns an thread with a dedicated async loop.
// Allocates 72 bytes of message buffer on the stack. No heap allocation necessary.
static ResultOf::GetChannel GetChannel(::zx::unowned_channel _client_end, ::zx::channel test);
// Spawns an thread with a dedicated async loop.
// Caller provides the backing storage for FIDL message via request and response buffers.
static UnownedResultOf::GetChannel GetChannel(::zx::unowned_channel _client_end, ::fidl::BytePart _request_buffer, ::zx::channel test, ::fidl::BytePart _response_buffer);
};
// Messages are encoded and decoded in-place when these methods are used.
// Additionally, requests must be already laid-out according to the FIDL wire-format.
class InPlace final {
InPlace() = delete;
public:
// Schedules work. |batch_size| refers to how many work_items to keep
// outstanding at any given time, while |num_work_items| refers to total
// number of work items.
static ::fidl::DecodeResult<ScheduleWorkResponse> ScheduleWork(::zx::unowned_channel _client_end, ::fidl::DecodedMessage<ScheduleWorkRequest> params, ::fidl::BytePart response_buffer);
// Spawns a thread which schedules work.
static ::fidl::DecodeResult<ScheduleWorkDifferentThreadResponse> ScheduleWorkDifferentThread(::zx::unowned_channel _client_end, ::fidl::BytePart response_buffer);
// Triggers once all outstanding work is complete.
static ::fidl::DecodeResult<GetDoneEventResponse> GetDoneEvent(::zx::unowned_channel _client_end, ::fidl::BytePart response_buffer);
// Returns whether how many work items ran since last time it was invoked.
static ::fidl::DecodeResult<ScheduledWorkRanResponse> ScheduledWorkRan(::zx::unowned_channel _client_end, ::fidl::BytePart response_buffer);
// Spawns an thread with a dedicated async loop.
static ::fidl::DecodeResult<GetChannelResponse> GetChannel(::zx::unowned_channel _client_end, ::fidl::DecodedMessage<GetChannelRequest> params, ::fidl::BytePart response_buffer);
};
// Pure-virtual interface to be implemented by a server.
class Interface {
public:
Interface() = default;
virtual ~Interface() = default;
using _Outer = TestDevice;
using _Base = ::fidl::CompleterBase;
class ScheduleWorkCompleterBase : public _Base {
public:
void Reply(::llcpp::fuchsia::device::schedule::work::test::TestDevice_ScheduleWork_Result result);
void ReplySuccess();
void ReplyError(int32_t error);
void Reply(::fidl::BytePart _buffer, ::llcpp::fuchsia::device::schedule::work::test::TestDevice_ScheduleWork_Result result);
void ReplySuccess(::fidl::BytePart _buffer);
void Reply(::fidl::DecodedMessage<ScheduleWorkResponse> params);
protected:
using ::fidl::CompleterBase::CompleterBase;
};
using ScheduleWorkCompleter = ::fidl::Completer<ScheduleWorkCompleterBase>;
virtual void ScheduleWork(uint32_t batch_size, uint32_t num_work_items, ScheduleWorkCompleter::Sync _completer) = 0;
class ScheduleWorkDifferentThreadCompleterBase : public _Base {
public:
void Reply(::llcpp::fuchsia::device::schedule::work::test::TestDevice_ScheduleWorkDifferentThread_Result result);
void ReplySuccess();
void ReplyError(int32_t error);
void Reply(::fidl::BytePart _buffer, ::llcpp::fuchsia::device::schedule::work::test::TestDevice_ScheduleWorkDifferentThread_Result result);
void ReplySuccess(::fidl::BytePart _buffer);
void Reply(::fidl::DecodedMessage<ScheduleWorkDifferentThreadResponse> params);
protected:
using ::fidl::CompleterBase::CompleterBase;
};
using ScheduleWorkDifferentThreadCompleter = ::fidl::Completer<ScheduleWorkDifferentThreadCompleterBase>;
virtual void ScheduleWorkDifferentThread(ScheduleWorkDifferentThreadCompleter::Sync _completer) = 0;
class GetDoneEventCompleterBase : public _Base {
public:
void Reply(::llcpp::fuchsia::device::schedule::work::test::TestDevice_GetDoneEvent_Result result);
void ReplySuccess(::zx::event event);
void ReplyError(int32_t error);
void Reply(::fidl::BytePart _buffer, ::llcpp::fuchsia::device::schedule::work::test::TestDevice_GetDoneEvent_Result result);
void ReplySuccess(::fidl::BytePart _buffer, ::zx::event event);
void Reply(::fidl::DecodedMessage<GetDoneEventResponse> params);
protected:
using ::fidl::CompleterBase::CompleterBase;
};
using GetDoneEventCompleter = ::fidl::Completer<GetDoneEventCompleterBase>;
virtual void GetDoneEvent(GetDoneEventCompleter::Sync _completer) = 0;
class ScheduledWorkRanCompleterBase : public _Base {
public:
void Reply(uint32_t work_items_run, ::llcpp::fuchsia::device::schedule::work::test::LatencyHistogram histogram);
void Reply(::fidl::BytePart _buffer, uint32_t work_items_run, ::llcpp::fuchsia::device::schedule::work::test::LatencyHistogram histogram);
void Reply(::fidl::DecodedMessage<ScheduledWorkRanResponse> params);
protected:
using ::fidl::CompleterBase::CompleterBase;
};
using ScheduledWorkRanCompleter = ::fidl::Completer<ScheduledWorkRanCompleterBase>;
virtual void ScheduledWorkRan(ScheduledWorkRanCompleter::Sync _completer) = 0;
class GetChannelCompleterBase : public _Base {
public:
void Reply(::llcpp::fuchsia::device::schedule::work::test::TestDevice_GetChannel_Result result);
void ReplySuccess();
void ReplyError(int32_t error);
void Reply(::fidl::BytePart _buffer, ::llcpp::fuchsia::device::schedule::work::test::TestDevice_GetChannel_Result result);
void ReplySuccess(::fidl::BytePart _buffer);
void Reply(::fidl::DecodedMessage<GetChannelResponse> params);
protected:
using ::fidl::CompleterBase::CompleterBase;
};
using GetChannelCompleter = ::fidl::Completer<GetChannelCompleterBase>;
virtual void GetChannel(::zx::channel test, GetChannelCompleter::Sync _completer) = 0;
};
// Attempts to dispatch the incoming message to a handler function in the server implementation.
// If there is no matching handler, it returns false, leaving the message and transaction intact.
// In all other cases, it consumes the message and returns true.
// It is possible to chain multiple TryDispatch functions in this manner.
static bool TryDispatch(Interface* impl, fidl_msg_t* msg, ::fidl::Transaction* txn);
// Dispatches the incoming message to one of the handlers functions in the interface.
// If there is no matching handler, it closes all the handles in |msg| and closes the channel with
// a |ZX_ERR_NOT_SUPPORTED| epitaph, before returning false. The message should then be discarded.
static bool Dispatch(Interface* impl, fidl_msg_t* msg, ::fidl::Transaction* txn);
// Same as |Dispatch|, but takes a |void*| instead of |Interface*|. Only used with |fidl::Bind|
// to reduce template expansion.
// Do not call this method manually. Use |Dispatch| instead.
static bool TypeErasedDispatch(void* impl, fidl_msg_t* msg, ::fidl::Transaction* txn) {
return Dispatch(static_cast<Interface*>(impl), msg, txn);
}
// Helper functions to fill in the transaction header in a |DecodedMessage<TransactionalMessage>|.
class SetTransactionHeaderFor final {
SetTransactionHeaderFor() = delete;
public:
static void ScheduleWorkRequest(const ::fidl::DecodedMessage<TestDevice::ScheduleWorkRequest>& _msg);
static void ScheduleWorkResponse(const ::fidl::DecodedMessage<TestDevice::ScheduleWorkResponse>& _msg);
static void ScheduleWorkDifferentThreadRequest(const ::fidl::DecodedMessage<TestDevice::ScheduleWorkDifferentThreadRequest>& _msg);
static void ScheduleWorkDifferentThreadResponse(const ::fidl::DecodedMessage<TestDevice::ScheduleWorkDifferentThreadResponse>& _msg);
static void GetDoneEventRequest(const ::fidl::DecodedMessage<TestDevice::GetDoneEventRequest>& _msg);
static void GetDoneEventResponse(const ::fidl::DecodedMessage<TestDevice::GetDoneEventResponse>& _msg);
static void ScheduledWorkRanRequest(const ::fidl::DecodedMessage<TestDevice::ScheduledWorkRanRequest>& _msg);
static void ScheduledWorkRanResponse(const ::fidl::DecodedMessage<TestDevice::ScheduledWorkRanResponse>& _msg);
static void GetChannelRequest(const ::fidl::DecodedMessage<TestDevice::GetChannelRequest>& _msg);
static void GetChannelResponse(const ::fidl::DecodedMessage<TestDevice::GetChannelResponse>& _msg);
};
};
extern "C" const fidl_type_t v1_fuchsia_device_schedule_work_test_OwnedChannelDevice_ScheduleWork_ResponseTable;
struct OwnedChannelDevice_ScheduleWork_Response {
static constexpr const fidl_type_t* Type = &v1_fuchsia_device_schedule_work_test_OwnedChannelDevice_ScheduleWork_ResponseTable;
static constexpr uint32_t MaxNumHandles = 0;
static constexpr uint32_t PrimarySize = 80;
[[maybe_unused]]
static constexpr uint32_t MaxOutOfLine = 0;
static constexpr bool HasPointer = false;
::llcpp::fuchsia::device::schedule::work::test::LatencyHistogram histogram = {};
};
extern "C" const fidl_type_t v1_fuchsia_device_schedule_work_test_OwnedChannelDeviceScheduleWorkRequestTable;
extern "C" const fidl_type_t v1_fuchsia_device_schedule_work_test_OwnedChannelDeviceScheduleWorkResponseTable;
class OwnedChannelDevice final {
OwnedChannelDevice() = delete;
public:
struct ScheduleWorkResponse final {
FIDL_ALIGNDECL
fidl_message_header_t _hdr;
::llcpp::fuchsia::device::schedule::work::test::OwnedChannelDevice_ScheduleWork_Result result;
static constexpr const fidl_type_t* Type = &v1_fuchsia_device_schedule_work_test_OwnedChannelDeviceScheduleWorkResponseTable;
static constexpr uint32_t MaxNumHandles = 0;
static constexpr uint32_t PrimarySize = 40;
static constexpr uint32_t MaxOutOfLine = 80;
static constexpr bool HasFlexibleEnvelope = false;
static constexpr bool HasPointer = true;
static constexpr bool ContainsUnion = true;
static constexpr ::fidl::internal::TransactionalMessageKind MessageKind =
::fidl::internal::TransactionalMessageKind::kResponse;
};
struct ScheduleWorkRequest final {
FIDL_ALIGNDECL
fidl_message_header_t _hdr;
uint32_t batch_size;
uint32_t num_work_items;
static constexpr const fidl_type_t* Type = &v1_fuchsia_device_schedule_work_test_OwnedChannelDeviceScheduleWorkRequestTable;
static constexpr uint32_t MaxNumHandles = 0;
static constexpr uint32_t PrimarySize = 24;
static constexpr uint32_t MaxOutOfLine = 0;
static constexpr uint32_t AltPrimarySize = 24;
static constexpr uint32_t AltMaxOutOfLine = 0;
static constexpr bool HasFlexibleEnvelope = false;
static constexpr bool HasPointer = false;
static constexpr bool ContainsUnion = false;
static constexpr ::fidl::internal::TransactionalMessageKind MessageKind =
::fidl::internal::TransactionalMessageKind::kRequest;
using ResponseType = ScheduleWorkResponse;
};
// Collection of return types of FIDL calls in this interface.
class ResultOf final {
ResultOf() = delete;
private:
template <typename ResponseType>
class ScheduleWork_Impl final : private ::fidl::internal::OwnedSyncCallBase<ResponseType> {
using Super = ::fidl::internal::OwnedSyncCallBase<ResponseType>;
public:
ScheduleWork_Impl(::zx::unowned_channel _client_end, uint32_t batch_size, uint32_t num_work_items);
~ScheduleWork_Impl() = default;
ScheduleWork_Impl(ScheduleWork_Impl&& other) = default;
ScheduleWork_Impl& operator=(ScheduleWork_Impl&& other) = default;
using Super::status;
using Super::error;
using Super::ok;
using Super::Unwrap;
using Super::value;
using Super::operator->;
using Super::operator*;
};
public:
using ScheduleWork = ScheduleWork_Impl<ScheduleWorkResponse>;
};
// Collection of return types of FIDL calls in this interface,
// when the caller-allocate flavor or in-place call is used.
class UnownedResultOf final {
UnownedResultOf() = delete;
private:
template <typename ResponseType>
class ScheduleWork_Impl final : private ::fidl::internal::UnownedSyncCallBase<ResponseType> {
using Super = ::fidl::internal::UnownedSyncCallBase<ResponseType>;
public:
ScheduleWork_Impl(::zx::unowned_channel _client_end, ::fidl::BytePart _request_buffer, uint32_t batch_size, uint32_t num_work_items, ::fidl::BytePart _response_buffer);
~ScheduleWork_Impl() = default;
ScheduleWork_Impl(ScheduleWork_Impl&& other) = default;
ScheduleWork_Impl& operator=(ScheduleWork_Impl&& other) = default;
using Super::status;
using Super::error;
using Super::ok;
using Super::Unwrap;
using Super::value;
using Super::operator->;
using Super::operator*;
};
public:
using ScheduleWork = ScheduleWork_Impl<ScheduleWorkResponse>;
};
class SyncClient final {
public:
explicit SyncClient(::zx::channel channel) : channel_(std::move(channel)) {}
~SyncClient() = default;
SyncClient(SyncClient&&) = default;
SyncClient& operator=(SyncClient&&) = default;
const ::zx::channel& channel() const { return channel_; }
::zx::channel* mutable_channel() { return &channel_; }
// Schedules work and blocks until it completes. |batch_size| refers to how
// many work_items to keep outstanding at any given time, while
// |num_work_items| refers to total number of work items.
// Allocates 144 bytes of message buffer on the stack. No heap allocation necessary.
ResultOf::ScheduleWork ScheduleWork(uint32_t batch_size, uint32_t num_work_items);
// Schedules work and blocks until it completes. |batch_size| refers to how
// many work_items to keep outstanding at any given time, while
// |num_work_items| refers to total number of work items.
// Caller provides the backing storage for FIDL message via request and response buffers.
UnownedResultOf::ScheduleWork ScheduleWork(::fidl::BytePart _request_buffer, uint32_t batch_size, uint32_t num_work_items, ::fidl::BytePart _response_buffer);
private:
::zx::channel channel_;
};
// Methods to make a sync FIDL call directly on an unowned channel, avoiding setting up a client.
class Call final {
Call() = delete;
public:
// Schedules work and blocks until it completes. |batch_size| refers to how
// many work_items to keep outstanding at any given time, while
// |num_work_items| refers to total number of work items.
// Allocates 144 bytes of message buffer on the stack. No heap allocation necessary.
static ResultOf::ScheduleWork ScheduleWork(::zx::unowned_channel _client_end, uint32_t batch_size, uint32_t num_work_items);
// Schedules work and blocks until it completes. |batch_size| refers to how
// many work_items to keep outstanding at any given time, while
// |num_work_items| refers to total number of work items.
// Caller provides the backing storage for FIDL message via request and response buffers.
static UnownedResultOf::ScheduleWork ScheduleWork(::zx::unowned_channel _client_end, ::fidl::BytePart _request_buffer, uint32_t batch_size, uint32_t num_work_items, ::fidl::BytePart _response_buffer);
};
// Messages are encoded and decoded in-place when these methods are used.
// Additionally, requests must be already laid-out according to the FIDL wire-format.
class InPlace final {
InPlace() = delete;
public:
// Schedules work and blocks until it completes. |batch_size| refers to how
// many work_items to keep outstanding at any given time, while
// |num_work_items| refers to total number of work items.
static ::fidl::DecodeResult<ScheduleWorkResponse> ScheduleWork(::zx::unowned_channel _client_end, ::fidl::DecodedMessage<ScheduleWorkRequest> params, ::fidl::BytePart response_buffer);
};
// Pure-virtual interface to be implemented by a server.
class Interface {
public:
Interface() = default;
virtual ~Interface() = default;
using _Outer = OwnedChannelDevice;
using _Base = ::fidl::CompleterBase;
class ScheduleWorkCompleterBase : public _Base {
public:
void Reply(::llcpp::fuchsia::device::schedule::work::test::OwnedChannelDevice_ScheduleWork_Result result);
void ReplySuccess(::llcpp::fuchsia::device::schedule::work::test::LatencyHistogram histogram);
void ReplyError(int32_t error);
void Reply(::fidl::BytePart _buffer, ::llcpp::fuchsia::device::schedule::work::test::OwnedChannelDevice_ScheduleWork_Result result);
void ReplySuccess(::fidl::BytePart _buffer, ::llcpp::fuchsia::device::schedule::work::test::LatencyHistogram histogram);
void Reply(::fidl::DecodedMessage<ScheduleWorkResponse> params);
protected:
using ::fidl::CompleterBase::CompleterBase;
};
using ScheduleWorkCompleter = ::fidl::Completer<ScheduleWorkCompleterBase>;
virtual void ScheduleWork(uint32_t batch_size, uint32_t num_work_items, ScheduleWorkCompleter::Sync _completer) = 0;
};
// Attempts to dispatch the incoming message to a handler function in the server implementation.
// If there is no matching handler, it returns false, leaving the message and transaction intact.
// In all other cases, it consumes the message and returns true.
// It is possible to chain multiple TryDispatch functions in this manner.
static bool TryDispatch(Interface* impl, fidl_msg_t* msg, ::fidl::Transaction* txn);
// Dispatches the incoming message to one of the handlers functions in the interface.
// If there is no matching handler, it closes all the handles in |msg| and closes the channel with
// a |ZX_ERR_NOT_SUPPORTED| epitaph, before returning false. The message should then be discarded.
static bool Dispatch(Interface* impl, fidl_msg_t* msg, ::fidl::Transaction* txn);
// Same as |Dispatch|, but takes a |void*| instead of |Interface*|. Only used with |fidl::Bind|
// to reduce template expansion.
// Do not call this method manually. Use |Dispatch| instead.
static bool TypeErasedDispatch(void* impl, fidl_msg_t* msg, ::fidl::Transaction* txn) {
return Dispatch(static_cast<Interface*>(impl), msg, txn);
}
// Helper functions to fill in the transaction header in a |DecodedMessage<TransactionalMessage>|.
class SetTransactionHeaderFor final {
SetTransactionHeaderFor() = delete;
public:
static void ScheduleWorkRequest(const ::fidl::DecodedMessage<OwnedChannelDevice::ScheduleWorkRequest>& _msg);
static void ScheduleWorkResponse(const ::fidl::DecodedMessage<OwnedChannelDevice::ScheduleWorkResponse>& _msg);
};
};
} // namespace test
} // namespace work
} // namespace schedule
} // namespace device
} // namespace fuchsia
} // namespace llcpp
namespace fidl {
template <>
struct IsFidlType<::llcpp::fuchsia::device::schedule::work::test::TestDevice_ScheduleWork_Response> : public std::true_type {};
static_assert(std::is_standard_layout_v<::llcpp::fuchsia::device::schedule::work::test::TestDevice_ScheduleWork_Response>);
static_assert(offsetof(::llcpp::fuchsia::device::schedule::work::test::TestDevice_ScheduleWork_Response, __reserved) == 0);
static_assert(sizeof(::llcpp::fuchsia::device::schedule::work::test::TestDevice_ScheduleWork_Response) == ::llcpp::fuchsia::device::schedule::work::test::TestDevice_ScheduleWork_Response::PrimarySize);
template <>
struct IsFidlType<::llcpp::fuchsia::device::schedule::work::test::TestDevice_ScheduleWork_Result> : public std::true_type {};
static_assert(std::is_standard_layout_v<::llcpp::fuchsia::device::schedule::work::test::TestDevice_ScheduleWork_Result>);
template <>
struct IsFidlType<::llcpp::fuchsia::device::schedule::work::test::TestDevice_ScheduleWorkDifferentThread_Response> : public std::true_type {};
static_assert(std::is_standard_layout_v<::llcpp::fuchsia::device::schedule::work::test::TestDevice_ScheduleWorkDifferentThread_Response>);
static_assert(offsetof(::llcpp::fuchsia::device::schedule::work::test::TestDevice_ScheduleWorkDifferentThread_Response, __reserved) == 0);
static_assert(sizeof(::llcpp::fuchsia::device::schedule::work::test::TestDevice_ScheduleWorkDifferentThread_Response) == ::llcpp::fuchsia::device::schedule::work::test::TestDevice_ScheduleWorkDifferentThread_Response::PrimarySize);
template <>
struct IsFidlType<::llcpp::fuchsia::device::schedule::work::test::TestDevice_ScheduleWorkDifferentThread_Result> : public std::true_type {};
static_assert(std::is_standard_layout_v<::llcpp::fuchsia::device::schedule::work::test::TestDevice_ScheduleWorkDifferentThread_Result>);
template <>
struct IsFidlType<::llcpp::fuchsia::device::schedule::work::test::TestDevice_GetDoneEvent_Response> : public std::true_type {};
static_assert(std::is_standard_layout_v<::llcpp::fuchsia::device::schedule::work::test::TestDevice_GetDoneEvent_Response>);
static_assert(offsetof(::llcpp::fuchsia::device::schedule::work::test::TestDevice_GetDoneEvent_Response, event) == 0);
static_assert(sizeof(::llcpp::fuchsia::device::schedule::work::test::TestDevice_GetDoneEvent_Response) == ::llcpp::fuchsia::device::schedule::work::test::TestDevice_GetDoneEvent_Response::PrimarySize);
template <>
struct IsFidlType<::llcpp::fuchsia::device::schedule::work::test::TestDevice_GetDoneEvent_Result> : public std::true_type {};
static_assert(std::is_standard_layout_v<::llcpp::fuchsia::device::schedule::work::test::TestDevice_GetDoneEvent_Result>);
template <>
struct IsFidlType<::llcpp::fuchsia::device::schedule::work::test::TestDevice_GetChannel_Response> : public std::true_type {};
static_assert(std::is_standard_layout_v<::llcpp::fuchsia::device::schedule::work::test::TestDevice_GetChannel_Response>);
static_assert(offsetof(::llcpp::fuchsia::device::schedule::work::test::TestDevice_GetChannel_Response, __reserved) == 0);
static_assert(sizeof(::llcpp::fuchsia::device::schedule::work::test::TestDevice_GetChannel_Response) == ::llcpp::fuchsia::device::schedule::work::test::TestDevice_GetChannel_Response::PrimarySize);
template <>
struct IsFidlType<::llcpp::fuchsia::device::schedule::work::test::TestDevice_GetChannel_Result> : public std::true_type {};
static_assert(std::is_standard_layout_v<::llcpp::fuchsia::device::schedule::work::test::TestDevice_GetChannel_Result>);
template <>
struct IsFidlType<::llcpp::fuchsia::device::schedule::work::test::LatencyHistogram> : public std::true_type {};
static_assert(std::is_standard_layout_v<::llcpp::fuchsia::device::schedule::work::test::LatencyHistogram>);
static_assert(offsetof(::llcpp::fuchsia::device::schedule::work::test::LatencyHistogram, buckets) == 0);
static_assert(sizeof(::llcpp::fuchsia::device::schedule::work::test::LatencyHistogram) == ::llcpp::fuchsia::device::schedule::work::test::LatencyHistogram::PrimarySize);
template <>
struct IsFidlType<::llcpp::fuchsia::device::schedule::work::test::TestDevice::ScheduleWorkRequest> : public std::true_type {};
template <>
struct IsFidlMessage<::llcpp::fuchsia::device::schedule::work::test::TestDevice::ScheduleWorkRequest> : public std::true_type {};
static_assert(sizeof(::llcpp::fuchsia::device::schedule::work::test::TestDevice::ScheduleWorkRequest)
== ::llcpp::fuchsia::device::schedule::work::test::TestDevice::ScheduleWorkRequest::PrimarySize);
static_assert(offsetof(::llcpp::fuchsia::device::schedule::work::test::TestDevice::ScheduleWorkRequest, batch_size) == 16);
static_assert(offsetof(::llcpp::fuchsia::device::schedule::work::test::TestDevice::ScheduleWorkRequest, num_work_items) == 20);
template <>
struct IsFidlType<::llcpp::fuchsia::device::schedule::work::test::TestDevice::ScheduleWorkResponse> : public std::true_type {};
template <>
struct IsFidlMessage<::llcpp::fuchsia::device::schedule::work::test::TestDevice::ScheduleWorkResponse> : public std::true_type {};
static_assert(sizeof(::llcpp::fuchsia::device::schedule::work::test::TestDevice::ScheduleWorkResponse)
== ::llcpp::fuchsia::device::schedule::work::test::TestDevice::ScheduleWorkResponse::PrimarySize);
static_assert(offsetof(::llcpp::fuchsia::device::schedule::work::test::TestDevice::ScheduleWorkResponse, result) == 16);
template <>
struct IsFidlType<::llcpp::fuchsia::device::schedule::work::test::TestDevice::ScheduleWorkDifferentThreadResponse> : public std::true_type {};
template <>
struct IsFidlMessage<::llcpp::fuchsia::device::schedule::work::test::TestDevice::ScheduleWorkDifferentThreadResponse> : public std::true_type {};
static_assert(sizeof(::llcpp::fuchsia::device::schedule::work::test::TestDevice::ScheduleWorkDifferentThreadResponse)
== ::llcpp::fuchsia::device::schedule::work::test::TestDevice::ScheduleWorkDifferentThreadResponse::PrimarySize);
static_assert(offsetof(::llcpp::fuchsia::device::schedule::work::test::TestDevice::ScheduleWorkDifferentThreadResponse, result) == 16);
template <>
struct IsFidlType<::llcpp::fuchsia::device::schedule::work::test::TestDevice::GetDoneEventResponse> : public std::true_type {};
template <>
struct IsFidlMessage<::llcpp::fuchsia::device::schedule::work::test::TestDevice::GetDoneEventResponse> : public std::true_type {};
static_assert(sizeof(::llcpp::fuchsia::device::schedule::work::test::TestDevice::GetDoneEventResponse)
== ::llcpp::fuchsia::device::schedule::work::test::TestDevice::GetDoneEventResponse::PrimarySize);
static_assert(offsetof(::llcpp::fuchsia::device::schedule::work::test::TestDevice::GetDoneEventResponse, result) == 16);
template <>
struct IsFidlType<::llcpp::fuchsia::device::schedule::work::test::TestDevice::ScheduledWorkRanResponse> : public std::true_type {};
template <>
struct IsFidlMessage<::llcpp::fuchsia::device::schedule::work::test::TestDevice::ScheduledWorkRanResponse> : public std::true_type {};
static_assert(sizeof(::llcpp::fuchsia::device::schedule::work::test::TestDevice::ScheduledWorkRanResponse)
== ::llcpp::fuchsia::device::schedule::work::test::TestDevice::ScheduledWorkRanResponse::PrimarySize);
static_assert(offsetof(::llcpp::fuchsia::device::schedule::work::test::TestDevice::ScheduledWorkRanResponse, work_items_run) == 16);
static_assert(offsetof(::llcpp::fuchsia::device::schedule::work::test::TestDevice::ScheduledWorkRanResponse, histogram) == 24);
template <>
struct IsFidlType<::llcpp::fuchsia::device::schedule::work::test::TestDevice::GetChannelRequest> : public std::true_type {};
template <>
struct IsFidlMessage<::llcpp::fuchsia::device::schedule::work::test::TestDevice::GetChannelRequest> : public std::true_type {};
static_assert(sizeof(::llcpp::fuchsia::device::schedule::work::test::TestDevice::GetChannelRequest)
== ::llcpp::fuchsia::device::schedule::work::test::TestDevice::GetChannelRequest::PrimarySize);
static_assert(offsetof(::llcpp::fuchsia::device::schedule::work::test::TestDevice::GetChannelRequest, test) == 16);
template <>
struct IsFidlType<::llcpp::fuchsia::device::schedule::work::test::TestDevice::GetChannelResponse> : public std::true_type {};
template <>
struct IsFidlMessage<::llcpp::fuchsia::device::schedule::work::test::TestDevice::GetChannelResponse> : public std::true_type {};
static_assert(sizeof(::llcpp::fuchsia::device::schedule::work::test::TestDevice::GetChannelResponse)
== ::llcpp::fuchsia::device::schedule::work::test::TestDevice::GetChannelResponse::PrimarySize);
static_assert(offsetof(::llcpp::fuchsia::device::schedule::work::test::TestDevice::GetChannelResponse, result) == 16);
template <>
struct IsFidlType<::llcpp::fuchsia::device::schedule::work::test::OwnedChannelDevice_ScheduleWork_Response> : public std::true_type {};
static_assert(std::is_standard_layout_v<::llcpp::fuchsia::device::schedule::work::test::OwnedChannelDevice_ScheduleWork_Response>);
static_assert(offsetof(::llcpp::fuchsia::device::schedule::work::test::OwnedChannelDevice_ScheduleWork_Response, histogram) == 0);
static_assert(sizeof(::llcpp::fuchsia::device::schedule::work::test::OwnedChannelDevice_ScheduleWork_Response) == ::llcpp::fuchsia::device::schedule::work::test::OwnedChannelDevice_ScheduleWork_Response::PrimarySize);
template <>
struct IsFidlType<::llcpp::fuchsia::device::schedule::work::test::OwnedChannelDevice_ScheduleWork_Result> : public std::true_type {};
static_assert(std::is_standard_layout_v<::llcpp::fuchsia::device::schedule::work::test::OwnedChannelDevice_ScheduleWork_Result>);
template <>
struct IsFidlType<::llcpp::fuchsia::device::schedule::work::test::OwnedChannelDevice::ScheduleWorkRequest> : public std::true_type {};
template <>
struct IsFidlMessage<::llcpp::fuchsia::device::schedule::work::test::OwnedChannelDevice::ScheduleWorkRequest> : public std::true_type {};
static_assert(sizeof(::llcpp::fuchsia::device::schedule::work::test::OwnedChannelDevice::ScheduleWorkRequest)
== ::llcpp::fuchsia::device::schedule::work::test::OwnedChannelDevice::ScheduleWorkRequest::PrimarySize);
static_assert(offsetof(::llcpp::fuchsia::device::schedule::work::test::OwnedChannelDevice::ScheduleWorkRequest, batch_size) == 16);
static_assert(offsetof(::llcpp::fuchsia::device::schedule::work::test::OwnedChannelDevice::ScheduleWorkRequest, num_work_items) == 20);
template <>
struct IsFidlType<::llcpp::fuchsia::device::schedule::work::test::OwnedChannelDevice::ScheduleWorkResponse> : public std::true_type {};
template <>
struct IsFidlMessage<::llcpp::fuchsia::device::schedule::work::test::OwnedChannelDevice::ScheduleWorkResponse> : public std::true_type {};
static_assert(sizeof(::llcpp::fuchsia::device::schedule::work::test::OwnedChannelDevice::ScheduleWorkResponse)
== ::llcpp::fuchsia::device::schedule::work::test::OwnedChannelDevice::ScheduleWorkResponse::PrimarySize);
static_assert(offsetof(::llcpp::fuchsia::device::schedule::work::test::OwnedChannelDevice::ScheduleWorkResponse, result) == 16);
} // namespace fidl