stream.capnp.h (3179B)
1 // Generated by Cap'n Proto compiler, DO NOT EDIT 2 // source: stream.capnp 3 4 #pragma once 5 6 #include <capnp/generated-header-support.h> 7 #include <kj/windows-sanity.h> 8 9 #if CAPNP_VERSION != 10000 10 #error "Version mismatch between generated code and library headers. You must use the same version of the Cap'n Proto compiler and library." 11 #endif 12 13 14 CAPNP_BEGIN_HEADER 15 16 namespace capnp { 17 namespace schemas { 18 19 CAPNP_DECLARE_SCHEMA(995f9a3377c0b16e); 20 21 } // namespace schemas 22 } // namespace capnp 23 24 namespace capnp { 25 26 struct StreamResult { 27 StreamResult() = delete; 28 29 class Reader; 30 class Builder; 31 class Pipeline; 32 33 struct _capnpPrivate { 34 CAPNP_DECLARE_STRUCT_HEADER(995f9a3377c0b16e, 0, 0) 35 #if !CAPNP_LITE 36 static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } 37 #endif // !CAPNP_LITE 38 }; 39 }; 40 41 // ======================================================================================= 42 43 class StreamResult::Reader { 44 public: 45 typedef StreamResult Reads; 46 47 Reader() = default; 48 inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} 49 50 inline ::capnp::MessageSize totalSize() const { 51 return _reader.totalSize().asPublic(); 52 } 53 54 #if !CAPNP_LITE 55 inline ::kj::StringTree toString() const { 56 return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); 57 } 58 #endif // !CAPNP_LITE 59 60 private: 61 ::capnp::_::StructReader _reader; 62 template <typename, ::capnp::Kind> 63 friend struct ::capnp::ToDynamic_; 64 template <typename, ::capnp::Kind> 65 friend struct ::capnp::_::PointerHelpers; 66 template <typename, ::capnp::Kind> 67 friend struct ::capnp::List; 68 friend class ::capnp::MessageBuilder; 69 friend class ::capnp::Orphanage; 70 }; 71 72 class StreamResult::Builder { 73 public: 74 typedef StreamResult Builds; 75 76 Builder() = delete; // Deleted to discourage incorrect usage. 77 // You can explicitly initialize to nullptr instead. 78 inline Builder(decltype(nullptr)) {} 79 inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} 80 inline operator Reader() const { return Reader(_builder.asReader()); } 81 inline Reader asReader() const { return *this; } 82 83 inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } 84 #if !CAPNP_LITE 85 inline ::kj::StringTree toString() const { return asReader().toString(); } 86 #endif // !CAPNP_LITE 87 88 private: 89 ::capnp::_::StructBuilder _builder; 90 template <typename, ::capnp::Kind> 91 friend struct ::capnp::ToDynamic_; 92 friend class ::capnp::Orphanage; 93 template <typename, ::capnp::Kind> 94 friend struct ::capnp::_::PointerHelpers; 95 }; 96 97 #if !CAPNP_LITE 98 class StreamResult::Pipeline { 99 public: 100 typedef StreamResult Pipelines; 101 102 inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} 103 inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) 104 : _typeless(kj::mv(typeless)) {} 105 106 private: 107 ::capnp::AnyPointer::Pipeline _typeless; 108 friend class ::capnp::PipelineHook; 109 template <typename, ::capnp::Kind> 110 friend struct ::capnp::ToDynamic_; 111 }; 112 #endif // !CAPNP_LITE 113 114 // ======================================================================================= 115 116 } // namespace 117 118 CAPNP_END_HEADER 119