Files
d/source/zap/tests/test-import.zap.h
zeekay fe49a3b74f rebrand Cap'n Proto D port to ZAP
Rename the capnproto-dlang fork to zap-dlang: source/capnproto/ -> source/zap/
(module/import paths capnproto.* -> zap.*), compiler plugin capnpc-dlang ->
zapc-dlang, schemas .capnp -> .zap, Makefile pkg-config/-lcapnp -> zap/-lzap,
README/CONTRIBUTORS rebranded with canonical zap-proto.io/zap-proto.dev/
github.com/zap-proto/d links. Pure mechanical rename: no logic changes.
Upstream Sandstorm MIT headers preserved.
2026-06-19 23:47:11 -07:00

164 lines
5.0 KiB
C++

// Generated by Zap compiler, DO NOT EDIT
// source: test-import.zap
#ifndef ZAP_INCLUDED_d693321951fee8f3_
#define ZAP_INCLUDED_d693321951fee8f3_
#include <zap/generated-header-support.h>
#if ZAP_VERSION != 6000
#error "Version mismatch between generated code and library headers. You must use the same version of the Zap compiler and library."
#endif
#include "test.zap.h"
namespace zap {
namespace schemas {
ZAP_DECLARE_SCHEMA(ce44e75b93239b3c);
} // namespace schemas
} // namespace zap
struct Foo {
Foo() = delete;
class Reader;
class Builder;
class Pipeline;
struct _zapPrivate {
ZAP_DECLARE_STRUCT_HEADER(ce44e75b93239b3c, 0, 1)
#if !ZAP_LITE
static constexpr ::zap::_::RawBrandedSchema const* brand = &schema->defaultBrand;
#endif // !ZAP_LITE
};
};
// =======================================================================================
class Foo::Reader {
public:
typedef Foo Reads;
Reader() = default;
inline explicit Reader(::zap::_::StructReader base): _reader(base) {}
inline ::zap::MessageSize totalSize() const {
return _reader.totalSize().asPublic();
}
#if !ZAP_LITE
inline ::kj::StringTree toString() const {
return ::zap::_::structString(_reader, *_zapPrivate::brand);
}
#endif // !ZAP_LITE
inline bool hasImportedStruct() const;
inline ::TestAllTypes::Reader getImportedStruct() const;
private:
::zap::_::StructReader _reader;
template <typename, ::zap::Kind>
friend struct ::zap::ToDynamic_;
template <typename, ::zap::Kind>
friend struct ::zap::_::PointerHelpers;
template <typename, ::zap::Kind>
friend struct ::zap::List;
friend class ::zap::MessageBuilder;
friend class ::zap::Orphanage;
};
class Foo::Builder {
public:
typedef Foo Builds;
Builder() = delete; // Deleted to discourage incorrect usage.
// You can explicitly initialize to nullptr instead.
inline Builder(decltype(nullptr)) {}
inline explicit Builder(::zap::_::StructBuilder base): _builder(base) {}
inline operator Reader() const { return Reader(_builder.asReader()); }
inline Reader asReader() const { return *this; }
inline ::zap::MessageSize totalSize() const { return asReader().totalSize(); }
#if !ZAP_LITE
inline ::kj::StringTree toString() const { return asReader().toString(); }
#endif // !ZAP_LITE
inline bool hasImportedStruct();
inline ::TestAllTypes::Builder getImportedStruct();
inline void setImportedStruct( ::TestAllTypes::Reader value);
inline ::TestAllTypes::Builder initImportedStruct();
inline void adoptImportedStruct(::zap::Orphan< ::TestAllTypes>&& value);
inline ::zap::Orphan< ::TestAllTypes> disownImportedStruct();
private:
::zap::_::StructBuilder _builder;
template <typename, ::zap::Kind>
friend struct ::zap::ToDynamic_;
friend class ::zap::Orphanage;
template <typename, ::zap::Kind>
friend struct ::zap::_::PointerHelpers;
};
#if !ZAP_LITE
class Foo::Pipeline {
public:
typedef Foo Pipelines;
inline Pipeline(decltype(nullptr)): _typeless(nullptr) {}
inline explicit Pipeline(::zap::AnyPointer::Pipeline&& typeless)
: _typeless(kj::mv(typeless)) {}
inline ::TestAllTypes::Pipeline getImportedStruct();
private:
::zap::AnyPointer::Pipeline _typeless;
friend class ::zap::PipelineHook;
template <typename, ::zap::Kind>
friend struct ::zap::ToDynamic_;
};
#endif // !ZAP_LITE
// =======================================================================================
inline bool Foo::Reader::hasImportedStruct() const {
return !_reader.getPointerField(0 * ::zap::POINTERS).isNull();
}
inline bool Foo::Builder::hasImportedStruct() {
return !_builder.getPointerField(0 * ::zap::POINTERS).isNull();
}
inline ::TestAllTypes::Reader Foo::Reader::getImportedStruct() const {
return ::zap::_::PointerHelpers< ::TestAllTypes>::get(
_reader.getPointerField(0 * ::zap::POINTERS));
}
inline ::TestAllTypes::Builder Foo::Builder::getImportedStruct() {
return ::zap::_::PointerHelpers< ::TestAllTypes>::get(
_builder.getPointerField(0 * ::zap::POINTERS));
}
#if !ZAP_LITE
inline ::TestAllTypes::Pipeline Foo::Pipeline::getImportedStruct() {
return ::TestAllTypes::Pipeline(_typeless.getPointerField(0));
}
#endif // !ZAP_LITE
inline void Foo::Builder::setImportedStruct( ::TestAllTypes::Reader value) {
::zap::_::PointerHelpers< ::TestAllTypes>::set(
_builder.getPointerField(0 * ::zap::POINTERS), value);
}
inline ::TestAllTypes::Builder Foo::Builder::initImportedStruct() {
return ::zap::_::PointerHelpers< ::TestAllTypes>::init(
_builder.getPointerField(0 * ::zap::POINTERS));
}
inline void Foo::Builder::adoptImportedStruct(
::zap::Orphan< ::TestAllTypes>&& value) {
::zap::_::PointerHelpers< ::TestAllTypes>::adopt(
_builder.getPointerField(0 * ::zap::POINTERS), kj::mv(value));
}
inline ::zap::Orphan< ::TestAllTypes> Foo::Builder::disownImportedStruct() {
return ::zap::_::PointerHelpers< ::TestAllTypes>::disown(
_builder.getPointerField(0 * ::zap::POINTERS));
}
#endif // ZAP_INCLUDED_d693321951fee8f3_