Skip to content

Instantly share code, notes, and snippets.

@jmillan
Created January 9, 2023 20:25
Show Gist options
  • Save jmillan/7bce14e205b407f0ae495e7ee7479b03 to your computer and use it in GitHub Desktop.
Save jmillan/7bce14e205b407f0ae495e7ee7479b03 to your computer and use it in GitHub Desktop.
response_generated
// automatically generated by the FlatBuffers compiler, do not modify
#ifndef FLATBUFFERS_GENERATED_RESPONSE_FBS_RESPONSE_H_
#define FLATBUFFERS_GENERATED_RESPONSE_FBS_RESPONSE_H_
#include "flatbuffers/flatbuffers.h"
// Ensure the included flatbuffers.h is the same version as when this file was
// generated, otherwise it may not be compatible.
static_assert(FLATBUFFERS_VERSION_MAJOR == 22 &&
FLATBUFFERS_VERSION_MINOR == 11 &&
FLATBUFFERS_VERSION_REVISION == 23,
"Non-compatible flatbuffers version included");
#include "consumer_generated.h"
#include "dataConsumer_generated.h"
#include "dataProducer_generated.h"
#include "producer_generated.h"
#include "router_generated.h"
#include "transport_generated.h"
#include "webRtcServer_generated.h"
#include "worker_generated.h"
namespace FBS {
namespace Response {
struct Response;
struct ResponseBuilder;
inline const flatbuffers::TypeTable *ResponseTypeTable();
enum class Body : uint8_t {
NONE = 0,
FBS_Worker_DumpResponse = 1,
FBS_Worker_ResourceUsageResponse = 2,
FBS_WebRtcServer_DumpResponse = 3,
FBS_Router_DumpResponse = 4,
FBS_Transport_ProduceResponse = 5,
FBS_Transport_ConsumeResponse = 6,
FBS_Transport_RestartIceResponse = 7,
FBS_PlainTransport_ConnectResponse = 8,
FBS_PlainTransport_DumpResponse = 9,
FBS_PlainTransport_GetStatsResponse = 10,
FBS_PipeTransport_ConnectResponse = 11,
FBS_PipeTransport_DumpResponse = 12,
FBS_PipeTransport_GetStatsResponse = 13,
FBS_DirectTransport_DumpResponse = 14,
FBS_DirectTransport_GetStatsResponse = 15,
FBS_WebRtcTransport_ConnectResponse = 16,
FBS_WebRtcTransport_DumpResponse = 17,
FBS_WebRtcTransport_GetStatsResponse = 18,
FBS_Producer_DumpResponse = 19,
FBS_Producer_GetStatsResponse = 20,
FBS_Consumer_DumpResponse = 21,
FBS_Consumer_GetStatsResponse = 22,
FBS_Consumer_SetPreferredLayersResponse = 23,
FBS_Consumer_SetPriorityResponse = 24,
FBS_DataProducer_DumpResponse = 25,
FBS_DataProducer_GetStatsResponse = 26,
FBS_DataConsumer_GetBufferedAmountResponse = 27,
FBS_DataConsumer_DumpResponse = 28,
FBS_DataConsumer_GetStatsResponse = 29,
MIN = NONE,
MAX = FBS_DataConsumer_GetStatsResponse
};
inline const Body (&EnumValuesBody())[30] {
static const Body values[] = {
Body::NONE,
Body::FBS_Worker_DumpResponse,
Body::FBS_Worker_ResourceUsageResponse,
Body::FBS_WebRtcServer_DumpResponse,
Body::FBS_Router_DumpResponse,
Body::FBS_Transport_ProduceResponse,
Body::FBS_Transport_ConsumeResponse,
Body::FBS_Transport_RestartIceResponse,
Body::FBS_PlainTransport_ConnectResponse,
Body::FBS_PlainTransport_DumpResponse,
Body::FBS_PlainTransport_GetStatsResponse,
Body::FBS_PipeTransport_ConnectResponse,
Body::FBS_PipeTransport_DumpResponse,
Body::FBS_PipeTransport_GetStatsResponse,
Body::FBS_DirectTransport_DumpResponse,
Body::FBS_DirectTransport_GetStatsResponse,
Body::FBS_WebRtcTransport_ConnectResponse,
Body::FBS_WebRtcTransport_DumpResponse,
Body::FBS_WebRtcTransport_GetStatsResponse,
Body::FBS_Producer_DumpResponse,
Body::FBS_Producer_GetStatsResponse,
Body::FBS_Consumer_DumpResponse,
Body::FBS_Consumer_GetStatsResponse,
Body::FBS_Consumer_SetPreferredLayersResponse,
Body::FBS_Consumer_SetPriorityResponse,
Body::FBS_DataProducer_DumpResponse,
Body::FBS_DataProducer_GetStatsResponse,
Body::FBS_DataConsumer_GetBufferedAmountResponse,
Body::FBS_DataConsumer_DumpResponse,
Body::FBS_DataConsumer_GetStatsResponse
};
return values;
}
inline const char * const *EnumNamesBody() {
static const char * const names[31] = {
"NONE",
"FBS_Worker_DumpResponse",
"FBS_Worker_ResourceUsageResponse",
"FBS_WebRtcServer_DumpResponse",
"FBS_Router_DumpResponse",
"FBS_Transport_ProduceResponse",
"FBS_Transport_ConsumeResponse",
"FBS_Transport_RestartIceResponse",
"FBS_PlainTransport_ConnectResponse",
"FBS_PlainTransport_DumpResponse",
"FBS_PlainTransport_GetStatsResponse",
"FBS_PipeTransport_ConnectResponse",
"FBS_PipeTransport_DumpResponse",
"FBS_PipeTransport_GetStatsResponse",
"FBS_DirectTransport_DumpResponse",
"FBS_DirectTransport_GetStatsResponse",
"FBS_WebRtcTransport_ConnectResponse",
"FBS_WebRtcTransport_DumpResponse",
"FBS_WebRtcTransport_GetStatsResponse",
"FBS_Producer_DumpResponse",
"FBS_Producer_GetStatsResponse",
"FBS_Consumer_DumpResponse",
"FBS_Consumer_GetStatsResponse",
"FBS_Consumer_SetPreferredLayersResponse",
"FBS_Consumer_SetPriorityResponse",
"FBS_DataProducer_DumpResponse",
"FBS_DataProducer_GetStatsResponse",
"FBS_DataConsumer_GetBufferedAmountResponse",
"FBS_DataConsumer_DumpResponse",
"FBS_DataConsumer_GetStatsResponse",
nullptr
};
return names;
}
inline const char *EnumNameBody(Body e) {
if (flatbuffers::IsOutRange(e, Body::NONE, Body::FBS_DataConsumer_GetStatsResponse)) return "";
const size_t index = static_cast<size_t>(e);
return EnumNamesBody()[index];
}
template<typename T> struct BodyTraits {
static const Body enum_value = Body::NONE;
};
template<> struct BodyTraits<FBS::Worker::DumpResponse> {
static const Body enum_value = Body::FBS_Worker_DumpResponse;
};
template<> struct BodyTraits<FBS::Worker::ResourceUsageResponse> {
static const Body enum_value = Body::FBS_Worker_ResourceUsageResponse;
};
template<> struct BodyTraits<FBS::WebRtcServer::DumpResponse> {
static const Body enum_value = Body::FBS_WebRtcServer_DumpResponse;
};
template<> struct BodyTraits<FBS::Router::DumpResponse> {
static const Body enum_value = Body::FBS_Router_DumpResponse;
};
template<> struct BodyTraits<FBS::Transport::ProduceResponse> {
static const Body enum_value = Body::FBS_Transport_ProduceResponse;
};
template<> struct BodyTraits<FBS::Transport::ConsumeResponse> {
static const Body enum_value = Body::FBS_Transport_ConsumeResponse;
};
template<> struct BodyTraits<FBS::Transport::RestartIceResponse> {
static const Body enum_value = Body::FBS_Transport_RestartIceResponse;
};
template<> struct BodyTraits<FBS::PlainTransport::ConnectResponse> {
static const Body enum_value = Body::FBS_PlainTransport_ConnectResponse;
};
template<> struct BodyTraits<FBS::PlainTransport::DumpResponse> {
static const Body enum_value = Body::FBS_PlainTransport_DumpResponse;
};
template<> struct BodyTraits<FBS::PlainTransport::GetStatsResponse> {
static const Body enum_value = Body::FBS_PlainTransport_GetStatsResponse;
};
template<> struct BodyTraits<FBS::PipeTransport::ConnectResponse> {
static const Body enum_value = Body::FBS_PipeTransport_ConnectResponse;
};
template<> struct BodyTraits<FBS::PipeTransport::DumpResponse> {
static const Body enum_value = Body::FBS_PipeTransport_DumpResponse;
};
template<> struct BodyTraits<FBS::PipeTransport::GetStatsResponse> {
static const Body enum_value = Body::FBS_PipeTransport_GetStatsResponse;
};
template<> struct BodyTraits<FBS::DirectTransport::DumpResponse> {
static const Body enum_value = Body::FBS_DirectTransport_DumpResponse;
};
template<> struct BodyTraits<FBS::DirectTransport::GetStatsResponse> {
static const Body enum_value = Body::FBS_DirectTransport_GetStatsResponse;
};
template<> struct BodyTraits<FBS::WebRtcTransport::ConnectResponse> {
static const Body enum_value = Body::FBS_WebRtcTransport_ConnectResponse;
};
template<> struct BodyTraits<FBS::WebRtcTransport::DumpResponse> {
static const Body enum_value = Body::FBS_WebRtcTransport_DumpResponse;
};
template<> struct BodyTraits<FBS::WebRtcTransport::GetStatsResponse> {
static const Body enum_value = Body::FBS_WebRtcTransport_GetStatsResponse;
};
template<> struct BodyTraits<FBS::Producer::DumpResponse> {
static const Body enum_value = Body::FBS_Producer_DumpResponse;
};
template<> struct BodyTraits<FBS::Producer::GetStatsResponse> {
static const Body enum_value = Body::FBS_Producer_GetStatsResponse;
};
template<> struct BodyTraits<FBS::Consumer::DumpResponse> {
static const Body enum_value = Body::FBS_Consumer_DumpResponse;
};
template<> struct BodyTraits<FBS::Consumer::GetStatsResponse> {
static const Body enum_value = Body::FBS_Consumer_GetStatsResponse;
};
template<> struct BodyTraits<FBS::Consumer::SetPreferredLayersResponse> {
static const Body enum_value = Body::FBS_Consumer_SetPreferredLayersResponse;
};
template<> struct BodyTraits<FBS::Consumer::SetPriorityResponse> {
static const Body enum_value = Body::FBS_Consumer_SetPriorityResponse;
};
template<> struct BodyTraits<FBS::DataProducer::DumpResponse> {
static const Body enum_value = Body::FBS_DataProducer_DumpResponse;
};
template<> struct BodyTraits<FBS::DataProducer::GetStatsResponse> {
static const Body enum_value = Body::FBS_DataProducer_GetStatsResponse;
};
template<> struct BodyTraits<FBS::DataConsumer::GetBufferedAmountResponse> {
static const Body enum_value = Body::FBS_DataConsumer_GetBufferedAmountResponse;
};
template<> struct BodyTraits<FBS::DataConsumer::DumpResponse> {
static const Body enum_value = Body::FBS_DataConsumer_DumpResponse;
};
template<> struct BodyTraits<FBS::DataConsumer::GetStatsResponse> {
static const Body enum_value = Body::FBS_DataConsumer_GetStatsResponse;
};
bool VerifyBody(flatbuffers::Verifier &verifier, const void *obj, Body type);
bool VerifyBodyVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector<flatbuffers::Offset<void>> *values, const flatbuffers::Vector<Body> *types);
struct Response FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
typedef ResponseBuilder Builder;
static const flatbuffers::TypeTable *MiniReflectTypeTable() {
return ResponseTypeTable();
}
enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
VT_ID = 4,
VT_ACCEPTED = 6,
VT_BODY_TYPE = 8,
VT_BODY = 10,
VT_ERROR = 12,
VT_REASON = 14
};
uint32_t id() const {
return GetField<uint32_t>(VT_ID, 0);
}
bool accepted() const {
return GetField<uint8_t>(VT_ACCEPTED, 0) != 0;
}
FBS::Response::Body body_type() const {
return static_cast<FBS::Response::Body>(GetField<uint8_t>(VT_BODY_TYPE, 0));
}
const void *body() const {
return GetPointer<const void *>(VT_BODY);
}
template<typename T> const T *body_as() const;
const FBS::Worker::DumpResponse *body_as_FBS_Worker_DumpResponse() const {
return body_type() == FBS::Response::Body::FBS_Worker_DumpResponse ? static_cast<const FBS::Worker::DumpResponse *>(body()) : nullptr;
}
const FBS::Worker::ResourceUsageResponse *body_as_FBS_Worker_ResourceUsageResponse() const {
return body_type() == FBS::Response::Body::FBS_Worker_ResourceUsageResponse ? static_cast<const FBS::Worker::ResourceUsageResponse *>(body()) : nullptr;
}
const FBS::WebRtcServer::DumpResponse *body_as_FBS_WebRtcServer_DumpResponse() const {
return body_type() == FBS::Response::Body::FBS_WebRtcServer_DumpResponse ? static_cast<const FBS::WebRtcServer::DumpResponse *>(body()) : nullptr;
}
const FBS::Router::DumpResponse *body_as_FBS_Router_DumpResponse() const {
return body_type() == FBS::Response::Body::FBS_Router_DumpResponse ? static_cast<const FBS::Router::DumpResponse *>(body()) : nullptr;
}
const FBS::Transport::ProduceResponse *body_as_FBS_Transport_ProduceResponse() const {
return body_type() == FBS::Response::Body::FBS_Transport_ProduceResponse ? static_cast<const FBS::Transport::ProduceResponse *>(body()) : nullptr;
}
const FBS::Transport::ConsumeResponse *body_as_FBS_Transport_ConsumeResponse() const {
return body_type() == FBS::Response::Body::FBS_Transport_ConsumeResponse ? static_cast<const FBS::Transport::ConsumeResponse *>(body()) : nullptr;
}
const FBS::Transport::RestartIceResponse *body_as_FBS_Transport_RestartIceResponse() const {
return body_type() == FBS::Response::Body::FBS_Transport_RestartIceResponse ? static_cast<const FBS::Transport::RestartIceResponse *>(body()) : nullptr;
}
const FBS::PlainTransport::ConnectResponse *body_as_FBS_PlainTransport_ConnectResponse() const {
return body_type() == FBS::Response::Body::FBS_PlainTransport_ConnectResponse ? static_cast<const FBS::PlainTransport::ConnectResponse *>(body()) : nullptr;
}
const FBS::PlainTransport::DumpResponse *body_as_FBS_PlainTransport_DumpResponse() const {
return body_type() == FBS::Response::Body::FBS_PlainTransport_DumpResponse ? static_cast<const FBS::PlainTransport::DumpResponse *>(body()) : nullptr;
}
const FBS::PlainTransport::GetStatsResponse *body_as_FBS_PlainTransport_GetStatsResponse() const {
return body_type() == FBS::Response::Body::FBS_PlainTransport_GetStatsResponse ? static_cast<const FBS::PlainTransport::GetStatsResponse *>(body()) : nullptr;
}
const FBS::PipeTransport::ConnectResponse *body_as_FBS_PipeTransport_ConnectResponse() const {
return body_type() == FBS::Response::Body::FBS_PipeTransport_ConnectResponse ? static_cast<const FBS::PipeTransport::ConnectResponse *>(body()) : nullptr;
}
const FBS::PipeTransport::DumpResponse *body_as_FBS_PipeTransport_DumpResponse() const {
return body_type() == FBS::Response::Body::FBS_PipeTransport_DumpResponse ? static_cast<const FBS::PipeTransport::DumpResponse *>(body()) : nullptr;
}
const FBS::PipeTransport::GetStatsResponse *body_as_FBS_PipeTransport_GetStatsResponse() const {
return body_type() == FBS::Response::Body::FBS_PipeTransport_GetStatsResponse ? static_cast<const FBS::PipeTransport::GetStatsResponse *>(body()) : nullptr;
}
const FBS::DirectTransport::DumpResponse *body_as_FBS_DirectTransport_DumpResponse() const {
return body_type() == FBS::Response::Body::FBS_DirectTransport_DumpResponse ? static_cast<const FBS::DirectTransport::DumpResponse *>(body()) : nullptr;
}
const FBS::DirectTransport::GetStatsResponse *body_as_FBS_DirectTransport_GetStatsResponse() const {
return body_type() == FBS::Response::Body::FBS_DirectTransport_GetStatsResponse ? static_cast<const FBS::DirectTransport::GetStatsResponse *>(body()) : nullptr;
}
const FBS::WebRtcTransport::ConnectResponse *body_as_FBS_WebRtcTransport_ConnectResponse() const {
return body_type() == FBS::Response::Body::FBS_WebRtcTransport_ConnectResponse ? static_cast<const FBS::WebRtcTransport::ConnectResponse *>(body()) : nullptr;
}
const FBS::WebRtcTransport::DumpResponse *body_as_FBS_WebRtcTransport_DumpResponse() const {
return body_type() == FBS::Response::Body::FBS_WebRtcTransport_DumpResponse ? static_cast<const FBS::WebRtcTransport::DumpResponse *>(body()) : nullptr;
}
const FBS::WebRtcTransport::GetStatsResponse *body_as_FBS_WebRtcTransport_GetStatsResponse() const {
return body_type() == FBS::Response::Body::FBS_WebRtcTransport_GetStatsResponse ? static_cast<const FBS::WebRtcTransport::GetStatsResponse *>(body()) : nullptr;
}
const FBS::Producer::DumpResponse *body_as_FBS_Producer_DumpResponse() const {
return body_type() == FBS::Response::Body::FBS_Producer_DumpResponse ? static_cast<const FBS::Producer::DumpResponse *>(body()) : nullptr;
}
const FBS::Producer::GetStatsResponse *body_as_FBS_Producer_GetStatsResponse() const {
return body_type() == FBS::Response::Body::FBS_Producer_GetStatsResponse ? static_cast<const FBS::Producer::GetStatsResponse *>(body()) : nullptr;
}
const FBS::Consumer::DumpResponse *body_as_FBS_Consumer_DumpResponse() const {
return body_type() == FBS::Response::Body::FBS_Consumer_DumpResponse ? static_cast<const FBS::Consumer::DumpResponse *>(body()) : nullptr;
}
const FBS::Consumer::GetStatsResponse *body_as_FBS_Consumer_GetStatsResponse() const {
return body_type() == FBS::Response::Body::FBS_Consumer_GetStatsResponse ? static_cast<const FBS::Consumer::GetStatsResponse *>(body()) : nullptr;
}
const FBS::Consumer::SetPreferredLayersResponse *body_as_FBS_Consumer_SetPreferredLayersResponse() const {
return body_type() == FBS::Response::Body::FBS_Consumer_SetPreferredLayersResponse ? static_cast<const FBS::Consumer::SetPreferredLayersResponse *>(body()) : nullptr;
}
const FBS::Consumer::SetPriorityResponse *body_as_FBS_Consumer_SetPriorityResponse() const {
return body_type() == FBS::Response::Body::FBS_Consumer_SetPriorityResponse ? static_cast<const FBS::Consumer::SetPriorityResponse *>(body()) : nullptr;
}
const FBS::DataProducer::DumpResponse *body_as_FBS_DataProducer_DumpResponse() const {
return body_type() == FBS::Response::Body::FBS_DataProducer_DumpResponse ? static_cast<const FBS::DataProducer::DumpResponse *>(body()) : nullptr;
}
const FBS::DataProducer::GetStatsResponse *body_as_FBS_DataProducer_GetStatsResponse() const {
return body_type() == FBS::Response::Body::FBS_DataProducer_GetStatsResponse ? static_cast<const FBS::DataProducer::GetStatsResponse *>(body()) : nullptr;
}
const FBS::DataConsumer::GetBufferedAmountResponse *body_as_FBS_DataConsumer_GetBufferedAmountResponse() const {
return body_type() == FBS::Response::Body::FBS_DataConsumer_GetBufferedAmountResponse ? static_cast<const FBS::DataConsumer::GetBufferedAmountResponse *>(body()) : nullptr;
}
const FBS::DataConsumer::DumpResponse *body_as_FBS_DataConsumer_DumpResponse() const {
return body_type() == FBS::Response::Body::FBS_DataConsumer_DumpResponse ? static_cast<const FBS::DataConsumer::DumpResponse *>(body()) : nullptr;
}
const FBS::DataConsumer::GetStatsResponse *body_as_FBS_DataConsumer_GetStatsResponse() const {
return body_type() == FBS::Response::Body::FBS_DataConsumer_GetStatsResponse ? static_cast<const FBS::DataConsumer::GetStatsResponse *>(body()) : nullptr;
}
const flatbuffers::String *error() const {
return GetPointer<const flatbuffers::String *>(VT_ERROR);
}
const flatbuffers::String *reason() const {
return GetPointer<const flatbuffers::String *>(VT_REASON);
}
bool Verify(flatbuffers::Verifier &verifier) const {
return VerifyTableStart(verifier) &&
VerifyField<uint32_t>(verifier, VT_ID, 4) &&
VerifyField<uint8_t>(verifier, VT_ACCEPTED, 1) &&
VerifyField<uint8_t>(verifier, VT_BODY_TYPE, 1) &&
VerifyOffset(verifier, VT_BODY) &&
VerifyBody(verifier, body(), body_type()) &&
VerifyOffset(verifier, VT_ERROR) &&
verifier.VerifyString(error()) &&
VerifyOffset(verifier, VT_REASON) &&
verifier.VerifyString(reason()) &&
verifier.EndTable();
}
};
template<> inline const FBS::Worker::DumpResponse *Response::body_as<FBS::Worker::DumpResponse>() const {
return body_as_FBS_Worker_DumpResponse();
}
template<> inline const FBS::Worker::ResourceUsageResponse *Response::body_as<FBS::Worker::ResourceUsageResponse>() const {
return body_as_FBS_Worker_ResourceUsageResponse();
}
template<> inline const FBS::WebRtcServer::DumpResponse *Response::body_as<FBS::WebRtcServer::DumpResponse>() const {
return body_as_FBS_WebRtcServer_DumpResponse();
}
template<> inline const FBS::Router::DumpResponse *Response::body_as<FBS::Router::DumpResponse>() const {
return body_as_FBS_Router_DumpResponse();
}
template<> inline const FBS::Transport::ProduceResponse *Response::body_as<FBS::Transport::ProduceResponse>() const {
return body_as_FBS_Transport_ProduceResponse();
}
template<> inline const FBS::Transport::ConsumeResponse *Response::body_as<FBS::Transport::ConsumeResponse>() const {
return body_as_FBS_Transport_ConsumeResponse();
}
template<> inline const FBS::Transport::RestartIceResponse *Response::body_as<FBS::Transport::RestartIceResponse>() const {
return body_as_FBS_Transport_RestartIceResponse();
}
template<> inline const FBS::PlainTransport::ConnectResponse *Response::body_as<FBS::PlainTransport::ConnectResponse>() const {
return body_as_FBS_PlainTransport_ConnectResponse();
}
template<> inline const FBS::PlainTransport::DumpResponse *Response::body_as<FBS::PlainTransport::DumpResponse>() const {
return body_as_FBS_PlainTransport_DumpResponse();
}
template<> inline const FBS::PlainTransport::GetStatsResponse *Response::body_as<FBS::PlainTransport::GetStatsResponse>() const {
return body_as_FBS_PlainTransport_GetStatsResponse();
}
template<> inline const FBS::PipeTransport::ConnectResponse *Response::body_as<FBS::PipeTransport::ConnectResponse>() const {
return body_as_FBS_PipeTransport_ConnectResponse();
}
template<> inline const FBS::PipeTransport::DumpResponse *Response::body_as<FBS::PipeTransport::DumpResponse>() const {
return body_as_FBS_PipeTransport_DumpResponse();
}
template<> inline const FBS::PipeTransport::GetStatsResponse *Response::body_as<FBS::PipeTransport::GetStatsResponse>() const {
return body_as_FBS_PipeTransport_GetStatsResponse();
}
template<> inline const FBS::DirectTransport::DumpResponse *Response::body_as<FBS::DirectTransport::DumpResponse>() const {
return body_as_FBS_DirectTransport_DumpResponse();
}
template<> inline const FBS::DirectTransport::GetStatsResponse *Response::body_as<FBS::DirectTransport::GetStatsResponse>() const {
return body_as_FBS_DirectTransport_GetStatsResponse();
}
template<> inline const FBS::WebRtcTransport::ConnectResponse *Response::body_as<FBS::WebRtcTransport::ConnectResponse>() const {
return body_as_FBS_WebRtcTransport_ConnectResponse();
}
template<> inline const FBS::WebRtcTransport::DumpResponse *Response::body_as<FBS::WebRtcTransport::DumpResponse>() const {
return body_as_FBS_WebRtcTransport_DumpResponse();
}
template<> inline const FBS::WebRtcTransport::GetStatsResponse *Response::body_as<FBS::WebRtcTransport::GetStatsResponse>() const {
return body_as_FBS_WebRtcTransport_GetStatsResponse();
}
template<> inline const FBS::Producer::DumpResponse *Response::body_as<FBS::Producer::DumpResponse>() const {
return body_as_FBS_Producer_DumpResponse();
}
template<> inline const FBS::Producer::GetStatsResponse *Response::body_as<FBS::Producer::GetStatsResponse>() const {
return body_as_FBS_Producer_GetStatsResponse();
}
template<> inline const FBS::Consumer::DumpResponse *Response::body_as<FBS::Consumer::DumpResponse>() const {
return body_as_FBS_Consumer_DumpResponse();
}
template<> inline const FBS::Consumer::GetStatsResponse *Response::body_as<FBS::Consumer::GetStatsResponse>() const {
return body_as_FBS_Consumer_GetStatsResponse();
}
template<> inline const FBS::Consumer::SetPreferredLayersResponse *Response::body_as<FBS::Consumer::SetPreferredLayersResponse>() const {
return body_as_FBS_Consumer_SetPreferredLayersResponse();
}
template<> inline const FBS::Consumer::SetPriorityResponse *Response::body_as<FBS::Consumer::SetPriorityResponse>() const {
return body_as_FBS_Consumer_SetPriorityResponse();
}
template<> inline const FBS::DataProducer::DumpResponse *Response::body_as<FBS::DataProducer::DumpResponse>() const {
return body_as_FBS_DataProducer_DumpResponse();
}
template<> inline const FBS::DataProducer::GetStatsResponse *Response::body_as<FBS::DataProducer::GetStatsResponse>() const {
return body_as_FBS_DataProducer_GetStatsResponse();
}
template<> inline const FBS::DataConsumer::GetBufferedAmountResponse *Response::body_as<FBS::DataConsumer::GetBufferedAmountResponse>() const {
return body_as_FBS_DataConsumer_GetBufferedAmountResponse();
}
template<> inline const FBS::DataConsumer::DumpResponse *Response::body_as<FBS::DataConsumer::DumpResponse>() const {
return body_as_FBS_DataConsumer_DumpResponse();
}
template<> inline const FBS::DataConsumer::GetStatsResponse *Response::body_as<FBS::DataConsumer::GetStatsResponse>() const {
return body_as_FBS_DataConsumer_GetStatsResponse();
}
struct ResponseBuilder {
typedef Response Table;
flatbuffers::FlatBufferBuilder &fbb_;
flatbuffers::uoffset_t start_;
void add_id(uint32_t id) {
fbb_.AddElement<uint32_t>(Response::VT_ID, id, 0);
}
void add_accepted(bool accepted) {
fbb_.AddElement<uint8_t>(Response::VT_ACCEPTED, static_cast<uint8_t>(accepted), 0);
}
void add_body_type(FBS::Response::Body body_type) {
fbb_.AddElement<uint8_t>(Response::VT_BODY_TYPE, static_cast<uint8_t>(body_type), 0);
}
void add_body(flatbuffers::Offset<void> body) {
fbb_.AddOffset(Response::VT_BODY, body);
}
void add_error(flatbuffers::Offset<flatbuffers::String> error) {
fbb_.AddOffset(Response::VT_ERROR, error);
}
void add_reason(flatbuffers::Offset<flatbuffers::String> reason) {
fbb_.AddOffset(Response::VT_REASON, reason);
}
explicit ResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb)
: fbb_(_fbb) {
start_ = fbb_.StartTable();
}
flatbuffers::Offset<Response> Finish() {
const auto end = fbb_.EndTable(start_);
auto o = flatbuffers::Offset<Response>(end);
return o;
}
};
inline flatbuffers::Offset<Response> CreateResponse(
flatbuffers::FlatBufferBuilder &_fbb,
uint32_t id = 0,
bool accepted = false,
FBS::Response::Body body_type = FBS::Response::Body::NONE,
flatbuffers::Offset<void> body = 0,
flatbuffers::Offset<flatbuffers::String> error = 0,
flatbuffers::Offset<flatbuffers::String> reason = 0) {
ResponseBuilder builder_(_fbb);
builder_.add_reason(reason);
builder_.add_error(error);
builder_.add_body(body);
builder_.add_id(id);
builder_.add_body_type(body_type);
builder_.add_accepted(accepted);
return builder_.Finish();
}
inline flatbuffers::Offset<Response> CreateResponseDirect(
flatbuffers::FlatBufferBuilder &_fbb,
uint32_t id = 0,
bool accepted = false,
FBS::Response::Body body_type = FBS::Response::Body::NONE,
flatbuffers::Offset<void> body = 0,
const char *error = nullptr,
const char *reason = nullptr) {
auto error__ = error ? _fbb.CreateString(error) : 0;
auto reason__ = reason ? _fbb.CreateString(reason) : 0;
return FBS::Response::CreateResponse(
_fbb,
id,
accepted,
body_type,
body,
error__,
reason__);
}
inline bool VerifyBody(flatbuffers::Verifier &verifier, const void *obj, Body type) {
switch (type) {
case Body::NONE: {
return true;
}
case Body::FBS_Worker_DumpResponse: {
auto ptr = reinterpret_cast<const FBS::Worker::DumpResponse *>(obj);
return verifier.VerifyTable(ptr);
}
case Body::FBS_Worker_ResourceUsageResponse: {
auto ptr = reinterpret_cast<const FBS::Worker::ResourceUsageResponse *>(obj);
return verifier.VerifyTable(ptr);
}
case Body::FBS_WebRtcServer_DumpResponse: {
auto ptr = reinterpret_cast<const FBS::WebRtcServer::DumpResponse *>(obj);
return verifier.VerifyTable(ptr);
}
case Body::FBS_Router_DumpResponse: {
auto ptr = reinterpret_cast<const FBS::Router::DumpResponse *>(obj);
return verifier.VerifyTable(ptr);
}
case Body::FBS_Transport_ProduceResponse: {
auto ptr = reinterpret_cast<const FBS::Transport::ProduceResponse *>(obj);
return verifier.VerifyTable(ptr);
}
case Body::FBS_Transport_ConsumeResponse: {
auto ptr = reinterpret_cast<const FBS::Transport::ConsumeResponse *>(obj);
return verifier.VerifyTable(ptr);
}
case Body::FBS_Transport_RestartIceResponse: {
auto ptr = reinterpret_cast<const FBS::Transport::RestartIceResponse *>(obj);
return verifier.VerifyTable(ptr);
}
case Body::FBS_PlainTransport_ConnectResponse: {
auto ptr = reinterpret_cast<const FBS::PlainTransport::ConnectResponse *>(obj);
return verifier.VerifyTable(ptr);
}
case Body::FBS_PlainTransport_DumpResponse: {
auto ptr = reinterpret_cast<const FBS::PlainTransport::DumpResponse *>(obj);
return verifier.VerifyTable(ptr);
}
case Body::FBS_PlainTransport_GetStatsResponse: {
auto ptr = reinterpret_cast<const FBS::PlainTransport::GetStatsResponse *>(obj);
return verifier.VerifyTable(ptr);
}
case Body::FBS_PipeTransport_ConnectResponse: {
auto ptr = reinterpret_cast<const FBS::PipeTransport::ConnectResponse *>(obj);
return verifier.VerifyTable(ptr);
}
case Body::FBS_PipeTransport_DumpResponse: {
auto ptr = reinterpret_cast<const FBS::PipeTransport::DumpResponse *>(obj);
return verifier.VerifyTable(ptr);
}
case Body::FBS_PipeTransport_GetStatsResponse: {
auto ptr = reinterpret_cast<const FBS::PipeTransport::GetStatsResponse *>(obj);
return verifier.VerifyTable(ptr);
}
case Body::FBS_DirectTransport_DumpResponse: {
auto ptr = reinterpret_cast<const FBS::DirectTransport::DumpResponse *>(obj);
return verifier.VerifyTable(ptr);
}
case Body::FBS_DirectTransport_GetStatsResponse: {
auto ptr = reinterpret_cast<const FBS::DirectTransport::GetStatsResponse *>(obj);
return verifier.VerifyTable(ptr);
}
case Body::FBS_WebRtcTransport_ConnectResponse: {
auto ptr = reinterpret_cast<const FBS::WebRtcTransport::ConnectResponse *>(obj);
return verifier.VerifyTable(ptr);
}
case Body::FBS_WebRtcTransport_DumpResponse: {
auto ptr = reinterpret_cast<const FBS::WebRtcTransport::DumpResponse *>(obj);
return verifier.VerifyTable(ptr);
}
case Body::FBS_WebRtcTransport_GetStatsResponse: {
auto ptr = reinterpret_cast<const FBS::WebRtcTransport::GetStatsResponse *>(obj);
return verifier.VerifyTable(ptr);
}
case Body::FBS_Producer_DumpResponse: {
auto ptr = reinterpret_cast<const FBS::Producer::DumpResponse *>(obj);
return verifier.VerifyTable(ptr);
}
case Body::FBS_Producer_GetStatsResponse: {
auto ptr = reinterpret_cast<const FBS::Producer::GetStatsResponse *>(obj);
return verifier.VerifyTable(ptr);
}
case Body::FBS_Consumer_DumpResponse: {
auto ptr = reinterpret_cast<const FBS::Consumer::DumpResponse *>(obj);
return verifier.VerifyTable(ptr);
}
case Body::FBS_Consumer_GetStatsResponse: {
auto ptr = reinterpret_cast<const FBS::Consumer::GetStatsResponse *>(obj);
return verifier.VerifyTable(ptr);
}
case Body::FBS_Consumer_SetPreferredLayersResponse: {
auto ptr = reinterpret_cast<const FBS::Consumer::SetPreferredLayersResponse *>(obj);
return verifier.VerifyTable(ptr);
}
case Body::FBS_Consumer_SetPriorityResponse: {
auto ptr = reinterpret_cast<const FBS::Consumer::SetPriorityResponse *>(obj);
return verifier.VerifyTable(ptr);
}
case Body::FBS_DataProducer_DumpResponse: {
auto ptr = reinterpret_cast<const FBS::DataProducer::DumpResponse *>(obj);
return verifier.VerifyTable(ptr);
}
case Body::FBS_DataProducer_GetStatsResponse: {
auto ptr = reinterpret_cast<const FBS::DataProducer::GetStatsResponse *>(obj);
return verifier.VerifyTable(ptr);
}
case Body::FBS_DataConsumer_GetBufferedAmountResponse: {
auto ptr = reinterpret_cast<const FBS::DataConsumer::GetBufferedAmountResponse *>(obj);
return verifier.VerifyTable(ptr);
}
case Body::FBS_DataConsumer_DumpResponse: {
auto ptr = reinterpret_cast<const FBS::DataConsumer::DumpResponse *>(obj);
return verifier.VerifyTable(ptr);
}
case Body::FBS_DataConsumer_GetStatsResponse: {
auto ptr = reinterpret_cast<const FBS::DataConsumer::GetStatsResponse *>(obj);
return verifier.VerifyTable(ptr);
}
default: return true;
}
}
inline bool VerifyBodyVector(flatbuffers::Verifier &verifier, const flatbuffers::Vector<flatbuffers::Offset<void>> *values, const flatbuffers::Vector<Body> *types) {
if (!values || !types) return !values && !types;
if (values->size() != types->size()) return false;
for (flatbuffers::uoffset_t i = 0; i < values->size(); ++i) {
if (!VerifyBody(
verifier, values->Get(i), types->GetEnum<Body>(i))) {
return false;
}
}
return true;
}
inline const flatbuffers::TypeTable *BodyTypeTable() {
static const flatbuffers::TypeCode type_codes[] = {
{ flatbuffers::ET_SEQUENCE, 0, -1 },
{ flatbuffers::ET_SEQUENCE, 0, 0 },
{ flatbuffers::ET_SEQUENCE, 0, 1 },
{ flatbuffers::ET_SEQUENCE, 0, 2 },
{ flatbuffers::ET_SEQUENCE, 0, 3 },
{ flatbuffers::ET_SEQUENCE, 0, 4 },
{ flatbuffers::ET_SEQUENCE, 0, 5 },
{ flatbuffers::ET_SEQUENCE, 0, 6 },
{ flatbuffers::ET_SEQUENCE, 0, 7 },
{ flatbuffers::ET_SEQUENCE, 0, 8 },
{ flatbuffers::ET_SEQUENCE, 0, 9 },
{ flatbuffers::ET_SEQUENCE, 0, 10 },
{ flatbuffers::ET_SEQUENCE, 0, 11 },
{ flatbuffers::ET_SEQUENCE, 0, 12 },
{ flatbuffers::ET_SEQUENCE, 0, 13 },
{ flatbuffers::ET_SEQUENCE, 0, 14 },
{ flatbuffers::ET_SEQUENCE, 0, 15 },
{ flatbuffers::ET_SEQUENCE, 0, 16 },
{ flatbuffers::ET_SEQUENCE, 0, 17 },
{ flatbuffers::ET_SEQUENCE, 0, 18 },
{ flatbuffers::ET_SEQUENCE, 0, 19 },
{ flatbuffers::ET_SEQUENCE, 0, 20 },
{ flatbuffers::ET_SEQUENCE, 0, 21 },
{ flatbuffers::ET_SEQUENCE, 0, 22 },
{ flatbuffers::ET_SEQUENCE, 0, 23 },
{ flatbuffers::ET_SEQUENCE, 0, 24 },
{ flatbuffers::ET_SEQUENCE, 0, 25 },
{ flatbuffers::ET_SEQUENCE, 0, 26 },
{ flatbuffers::ET_SEQUENCE, 0, 27 },
{ flatbuffers::ET_SEQUENCE, 0, 28 }
};
static const flatbuffers::TypeFunction type_refs[] = {
FBS::Worker::DumpResponseTypeTable,
FBS::Worker::ResourceUsageResponseTypeTable,
FBS::WebRtcServer::DumpResponseTypeTable,
FBS::Router::DumpResponseTypeTable,
FBS::Transport::ProduceResponseTypeTable,
FBS::Transport::ConsumeResponseTypeTable,
FBS::Transport::RestartIceResponseTypeTable,
FBS::PlainTransport::ConnectResponseTypeTable,
FBS::PlainTransport::DumpResponseTypeTable,
FBS::PlainTransport::GetStatsResponseTypeTable,
FBS::PipeTransport::ConnectResponseTypeTable,
FBS::PipeTransport::DumpResponseTypeTable,
FBS::PipeTransport::GetStatsResponseTypeTable,
FBS::DirectTransport::DumpResponseTypeTable,
FBS::DirectTransport::GetStatsResponseTypeTable,
FBS::WebRtcTransport::ConnectResponseTypeTable,
FBS::WebRtcTransport::DumpResponseTypeTable,
FBS::WebRtcTransport::GetStatsResponseTypeTable,
FBS::Producer::DumpResponseTypeTable,
FBS::Producer::GetStatsResponseTypeTable,
FBS::Consumer::DumpResponseTypeTable,
FBS::Consumer::GetStatsResponseTypeTable,
FBS::Consumer::SetPreferredLayersResponseTypeTable,
FBS::Consumer::SetPriorityResponseTypeTable,
FBS::DataProducer::DumpResponseTypeTable,
FBS::DataProducer::GetStatsResponseTypeTable,
FBS::DataConsumer::GetBufferedAmountResponseTypeTable,
FBS::DataConsumer::DumpResponseTypeTable,
FBS::DataConsumer::GetStatsResponseTypeTable
};
static const char * const names[] = {
"NONE",
"FBS_Worker_DumpResponse",
"FBS_Worker_ResourceUsageResponse",
"FBS_WebRtcServer_DumpResponse",
"FBS_Router_DumpResponse",
"FBS_Transport_ProduceResponse",
"FBS_Transport_ConsumeResponse",
"FBS_Transport_RestartIceResponse",
"FBS_PlainTransport_ConnectResponse",
"FBS_PlainTransport_DumpResponse",
"FBS_PlainTransport_GetStatsResponse",
"FBS_PipeTransport_ConnectResponse",
"FBS_PipeTransport_DumpResponse",
"FBS_PipeTransport_GetStatsResponse",
"FBS_DirectTransport_DumpResponse",
"FBS_DirectTransport_GetStatsResponse",
"FBS_WebRtcTransport_ConnectResponse",
"FBS_WebRtcTransport_DumpResponse",
"FBS_WebRtcTransport_GetStatsResponse",
"FBS_Producer_DumpResponse",
"FBS_Producer_GetStatsResponse",
"FBS_Consumer_DumpResponse",
"FBS_Consumer_GetStatsResponse",
"FBS_Consumer_SetPreferredLayersResponse",
"FBS_Consumer_SetPriorityResponse",
"FBS_DataProducer_DumpResponse",
"FBS_DataProducer_GetStatsResponse",
"FBS_DataConsumer_GetBufferedAmountResponse",
"FBS_DataConsumer_DumpResponse",
"FBS_DataConsumer_GetStatsResponse"
};
static const flatbuffers::TypeTable tt = {
flatbuffers::ST_UNION, 30, type_codes, type_refs, nullptr, nullptr, names
};
return &tt;
}
inline const flatbuffers::TypeTable *ResponseTypeTable() {
static const flatbuffers::TypeCode type_codes[] = {
{ flatbuffers::ET_UINT, 0, -1 },
{ flatbuffers::ET_BOOL, 0, -1 },
{ flatbuffers::ET_UTYPE, 0, 0 },
{ flatbuffers::ET_SEQUENCE, 0, 0 },
{ flatbuffers::ET_STRING, 0, -1 },
{ flatbuffers::ET_STRING, 0, -1 }
};
static const flatbuffers::TypeFunction type_refs[] = {
FBS::Response::BodyTypeTable
};
static const char * const names[] = {
"id",
"accepted",
"body_type",
"body",
"error",
"reason"
};
static const flatbuffers::TypeTable tt = {
flatbuffers::ST_TABLE, 6, type_codes, type_refs, nullptr, nullptr, names
};
return &tt;
}
} // namespace Response
} // namespace FBS
#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment