// Generated by Cap'n Proto compiler, DO NOT EDIT // source: message.capnp #pragma once #include #include #if CAPNP_VERSION != 7000 #error "Version mismatch between generated code and library headers. You must use the same version of the Cap'n Proto compiler and library." #endif namespace capnp { namespace schemas { CAPNP_DECLARE_SCHEMA(93c2012830d68d3c); } // namespace schemas } // namespace capnp struct Message { Message() = delete; class Reader; class Builder; class Pipeline; struct _capnpPrivate { CAPNP_DECLARE_STRUCT_HEADER(93c2012830d68d3c, 0, 1) #if !CAPNP_LITE static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } #endif // !CAPNP_LITE }; }; // ======================================================================================= class Message::Reader { public: typedef Message Reads; Reader() = default; inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} inline ::capnp::MessageSize totalSize() const { return _reader.totalSize().asPublic(); } #if !CAPNP_LITE inline ::kj::StringTree toString() const { return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); } #endif // !CAPNP_LITE inline bool hasMsg() const; inline ::capnp::Text::Reader getMsg() const; private: ::capnp::_::StructReader _reader; template friend struct ::capnp::ToDynamic_; template friend struct ::capnp::_::PointerHelpers; template friend struct ::capnp::List; friend class ::capnp::MessageBuilder; friend class ::capnp::Orphanage; }; class Message::Builder { public: typedef Message Builds; Builder() = delete; // Deleted to discourage incorrect usage. // You can explicitly initialize to nullptr instead. inline Builder(decltype(nullptr)) {} inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} inline operator Reader() const { return Reader(_builder.asReader()); } inline Reader asReader() const { return *this; } inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } #if !CAPNP_LITE inline ::kj::StringTree toString() const { return asReader().toString(); } #endif // !CAPNP_LITE inline bool hasMsg(); inline ::capnp::Text::Builder getMsg(); inline void setMsg( ::capnp::Text::Reader value); inline ::capnp::Text::Builder initMsg(unsigned int size); inline void adoptMsg(::capnp::Orphan< ::capnp::Text>&& value); inline ::capnp::Orphan< ::capnp::Text> disownMsg(); private: ::capnp::_::StructBuilder _builder; template friend struct ::capnp::ToDynamic_; friend class ::capnp::Orphanage; template friend struct ::capnp::_::PointerHelpers; }; #if !CAPNP_LITE class Message::Pipeline { public: typedef Message Pipelines; inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) : _typeless(kj::mv(typeless)) {} private: ::capnp::AnyPointer::Pipeline _typeless; friend class ::capnp::PipelineHook; template friend struct ::capnp::ToDynamic_; }; #endif // !CAPNP_LITE // ======================================================================================= inline bool Message::Reader::hasMsg() const { return !_reader.getPointerField( ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); } inline bool Message::Builder::hasMsg() { return !_builder.getPointerField( ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); } inline ::capnp::Text::Reader Message::Reader::getMsg() const { return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( ::capnp::bounded<0>() * ::capnp::POINTERS)); } inline ::capnp::Text::Builder Message::Builder::getMsg() { return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( ::capnp::bounded<0>() * ::capnp::POINTERS)); } inline void Message::Builder::setMsg( ::capnp::Text::Reader value) { ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( ::capnp::bounded<0>() * ::capnp::POINTERS), value); } inline ::capnp::Text::Builder Message::Builder::initMsg(unsigned int size) { return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( ::capnp::bounded<0>() * ::capnp::POINTERS), size); } inline void Message::Builder::adoptMsg( ::capnp::Orphan< ::capnp::Text>&& value) { ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); } inline ::capnp::Orphan< ::capnp::Text> Message::Builder::disownMsg() { return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( ::capnp::bounded<0>() * ::capnp::POINTERS)); }