VisitFace/RtspNativeCodec/app/libs/capnproto/include/benchmark/carsales.proto
New file @@ -0,0 +1,77 @@ // Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors // Licensed under the MIT License: // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. package capnp.benchmark.protobuf; message ParkingLot { repeated Car car = 1; } message TotalValue { required uint64 amount = 1; } message Car { optional string make = 1; optional string model = 2; optional Color color = 3; optional uint32 seats = 4; optional uint32 doors = 5; repeated Wheel wheel = 6; optional uint32 length = 7; optional uint32 width = 8; optional uint32 height = 9; optional uint32 weight = 10; optional Engine engine = 11; optional float fuel_capacity = 12; optional float fuel_level = 13; optional bool has_power_windows = 14; optional bool has_power_steering = 15; optional bool has_cruise_control = 16; optional uint32 cup_holders = 17; optional bool has_nav_system = 18; } enum Color { BLACK = 0; WHITE = 1; RED = 2; GREEN = 3; BLUE = 4; CYAN = 5; MAGENTA = 6; YELLOW = 7; SILVER = 8; } message Wheel { optional uint32 diameter = 1; optional float air_pressure = 2; optional bool snow_tires = 3; } message Engine { optional uint32 horsepower = 1; optional uint32 cylinders = 2; optional uint32 cc = 3; optional bool uses_gas = 4; optional bool uses_electric = 5; } VisitFace/RtspNativeCodec/app/libs/capnproto/include/benchmark/catrank.proto
New file @@ -0,0 +1,32 @@ // Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors // Licensed under the MIT License: // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. package capnp.benchmark.protobuf; message SearchResultList { repeated SearchResult result = 1; } message SearchResult { optional string url = 1; optional double score = 2; optional string snippet = 3; } VisitFace/RtspNativeCodec/app/libs/capnproto/include/benchmark/eval.proto
New file @@ -0,0 +1,44 @@ // Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors // Licensed under the MIT License: // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. package capnp.benchmark.protobuf; enum Operation { ADD = 0; SUBTRACT = 1; MULTIPLY = 2; DIVIDE = 3; MODULUS = 4; } message Expression { required Operation op = 1; optional int32 left_value = 2; optional Expression left_expression = 3; optional int32 right_value = 4; optional Expression right_expression = 5; } message EvaluationResult { required sint32 value = 1; } VisitFace/RtspNativeCodec/app/libs/capnproto/include/capnp/any.h
@@ -461,6 +461,8 @@ inline Reader(T&& value) : _reader(_::PointerHelpers<FromReader<T>>::getInternalReader(kj::fwd<T>(value))) {} inline MessageSize totalSize() const { return _reader.totalSize().asPublic(); } kj::ArrayPtr<const byte> getDataSection() { return _reader.getDataSectionAsBlob(); } @@ -483,6 +485,11 @@ // T must be a struct type. return typename T::Reader(_reader); } template <typename T> ReaderFor<T> as(StructSchema schema) const; // T must be DynamicStruct. Defined in dynamic.h. private: _::StructReader _reader; @@ -529,6 +536,11 @@ // T must be a struct type. return typename T::Builder(_builder); } template <typename T> BuilderFor<T> as(StructSchema schema); // T must be DynamicStruct. Defined in dynamic.h. private: _::StructBuilder _builder; friend class Orphanage; VisitFace/RtspNativeCodec/app/libs/capnproto/include/capnp/c++.capnp.h
@@ -6,7 +6,7 @@ #include <capnp/generated-header-support.h> #if CAPNP_VERSION != 6001 #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 VisitFace/RtspNativeCodec/app/libs/capnproto/include/capnp/common.h
@@ -41,8 +41,8 @@ namespace capnp { #define CAPNP_VERSION_MAJOR 0 #define CAPNP_VERSION_MINOR 6 #define CAPNP_VERSION_MICRO 1 #define CAPNP_VERSION_MINOR 7 #define CAPNP_VERSION_MICRO 0 #define CAPNP_VERSION \ (CAPNP_VERSION_MAJOR * 1000000 + CAPNP_VERSION_MINOR * 1000 + CAPNP_VERSION_MICRO) VisitFace/RtspNativeCodec/app/libs/capnproto/include/capnp/compat/json.capnp
New file @@ -0,0 +1,58 @@ # Copyright (c) 2015 Sandstorm Development Group, Inc. and contributors # Licensed under the MIT License: # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. @0x8ef99297a43a5e34; $import "/capnp/c++.capnp".namespace("capnp"); struct JsonValue { union { null @0 :Void; boolean @1 :Bool; number @2 :Float64; string @3 :Text; array @4 :List(JsonValue); object @5 :List(Field); # Standard JSON values. call @6 :Call; # Non-standard: A "function call", applying a named function (named by a single identifier) # to a parameter list. Examples: # # BinData(0, "Zm9vCg==") # ISODate("2015-04-15T08:44:50.218Z") # # Mongo DB users will recognize the above as exactly the syntax Mongo uses to represent BSON # "binary" and "date" types in text, since JSON has no analog of these. This is basically the # reason this extension exists. We do NOT recommend using `call` unless you specifically need # to be compatible with some silly format that uses this syntax. } struct Field { name @0 :Text; value @1 :JsonValue; } struct Call { function @0 :Text; params @1 :List(JsonValue); } } VisitFace/RtspNativeCodec/app/libs/capnproto/include/capnp/compat/json.capnp.h
@@ -9,7 +9,7 @@ #include <capnp/capability.h> #endif // !CAPNP_LITE #if CAPNP_VERSION != 6001 #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 VisitFace/RtspNativeCodec/app/libs/capnproto/include/capnp/compat/json.h
@@ -193,6 +193,20 @@ void addFieldHandler(StructSchema::Field field, Handler<T>& handler); // Matches only the specific field. T can be a dynamic type. T must match the field's type. // --------------------------------------------------------------------------- // Hack to support string literal parameters template <size_t size, typename... Params> auto decode(const char (&input)[size], Params&&... params) const -> decltype(decode(kj::arrayPtr(input, size), kj::fwd<Params>(params)...)) { return decode(kj::arrayPtr(input, size - 1), kj::fwd<Params>(params)...); } template <size_t size, typename... Params> auto decodeRaw(const char (&input)[size], Params&&... params) const -> decltype(decodeRaw(kj::arrayPtr(input, size), kj::fwd<Params>(params)...)) { return decodeRaw(kj::arrayPtr(input, size - 1), kj::fwd<Params>(params)...); } private: class HandlerBase; struct Impl; @@ -210,10 +224,14 @@ // ======================================================================================= // inline implementation details template <bool isDynamic> struct EncodeImpl; template <typename T> kj::String JsonCodec::encode(T&& value) { Type type = Type::from(value); typedef FromAny<kj::Decay<T>> Base; return encode(DynamicValue::Reader(ReaderFor<Base>(kj::fwd<T>(value))), Type::from<Base>()); return encode(DynamicValue::Reader(ReaderFor<Base>(kj::fwd<T>(value))), type); } template <typename T> VisitFace/RtspNativeCodec/app/libs/capnproto/include/capnp/compiler/grammar.capnp
New file @@ -0,0 +1,268 @@ # Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors # Licensed under the MIT License: # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. @0xc56be168dcbbc3c6; # The structures in this file correspond to the AST of the Cap'n Proto schema language. # # This file is intended to be used internally by capnpc. Mostly, it is useful because it is more # convenient than defining data classes in C++, particularly where variant types (unions) are # needed. Over time, this file may change in backwards-incompatible ways. using Cxx = import "/capnp/c++.capnp"; $Cxx.namespace("capnp::compiler"); # TODO(someday): Here's a case where parameterized types might be nice, but note that it would # need to support primitive parameters... struct LocatedText { value @0 :Text; startByte @1 :UInt32; endByte @2 :UInt32; } struct LocatedInteger { value @0 :UInt64; startByte @1 :UInt32; endByte @2 :UInt32; } struct LocatedFloat { value @0 :Float64; startByte @1 :UInt32; endByte @2 :UInt32; } struct Expression { # An expression. May evaluate to a type, a value, or a declaration (i.e. some named thing which # is neither a type nor a value, like an annotation declaration). union { unknown @0 :Void; # e.g. parse error; downstream should ignore positiveInt @1 :UInt64; negativeInt @2 :UInt64; float @3 :Float64; string @4 :Text; binary @10 :Data; relativeName @5 :LocatedText; # Just an identifier. absoluteName @15 :LocatedText; # An identifier with leading '.'. import @16 :LocatedText; # An import directive. embed @17 :LocatedText; # An embed directive. list @6 :List(Expression); # Bracketed list; members are never named. tuple @7 :List(Param); # Parenthesized list, possibly with named members. # # Note that a parenthesized list with one unnamed member is just a parenthesized expression, # not a tuple, and so will never be represented as a tuple. application :group { # Application of a function to some parameters, e.g. "foo(bar, baz)". function @11 :Expression; params @12 :List(Param); } member :group { # A named member of an aggregate, e.g. "foo.bar". parent @13 :Expression; name @14 :LocatedText; } # TODO(someday): Basic arithmetic? } struct Param { union { unnamed @0 :Void; # Just a value. named @1 :LocatedText; # "name = value" } value @2 :Expression; } startByte @8 :UInt32; endByte @9 :UInt32; } struct Declaration { # A declaration statement. name @0 :LocatedText; id :union { unspecified @1 :Void; uid @2 :LocatedInteger; ordinal @3 :LocatedInteger; # limited to 16 bits } parameters @57 :List(BrandParameter); # If this node is parameterized (generic), the list of parameters. Empty for non-generic types. struct BrandParameter { name @0 :Text; startByte @1 :UInt32; endByte @2 :UInt32; } nestedDecls @4 :List(Declaration); annotations @5 :List(AnnotationApplication); struct AnnotationApplication { name @0 :Expression; value :union { none @1 :Void; # None specified; implies void value. expression @2 :Expression; } } startByte @6 :UInt32; endByte @7 :UInt32; docComment @8 :Text; union { file @9 :Void; using :group { target @10 :Expression; } const :group { type @11 :Expression; value @12 :Expression; } enum @13 :Void; enumerant @14 :Void; struct @15 :Void; field :group { type @16 :Expression; defaultValue :union { none @17 :Void; value @18 :Expression; } } union @19 :Void; group @20 :Void; interface :group { superclasses @21 :List(Expression); } method :group { params @22 :ParamList; results :union { none @23 :Void; explicit @24 :ParamList; } } annotation :group { type @25 :Expression; targetsFile @26 :Bool; targetsConst @27 :Bool; targetsEnum @28 :Bool; targetsEnumerant @29 :Bool; targetsStruct @30 :Bool; targetsField @31 :Bool; targetsUnion @32 :Bool; targetsGroup @33 :Bool; targetsInterface @34 :Bool; targetsMethod @35 :Bool; targetsParam @36 :Bool; targetsAnnotation @37 :Bool; } nakedId @38 :LocatedInteger; nakedAnnotation @39 :AnnotationApplication; # A floating UID or annotation (allowed at the file top level). # The following declaration types are not produced by the parser, but are declared here # so that the compiler can handle symbol name lookups more uniformly. # # New union members added here will magically become visible in the global scope. # E.g. "builtinFoo" becomes visible as "Foo". builtinVoid @40 :Void; builtinBool @41 :Void; builtinInt8 @42 :Void; builtinInt16 @43 :Void; builtinInt32 @44 :Void; builtinInt64 @45 :Void; builtinUInt8 @46 :Void; builtinUInt16 @47 :Void; builtinUInt32 @48 :Void; builtinUInt64 @49 :Void; builtinFloat32 @50 :Void; builtinFloat64 @51 :Void; builtinText @52 :Void; builtinData @53 :Void; builtinList @54 :Void $builtinParams([(name = "Element")]); builtinObject @55 :Void; # only for "renamed to AnyPointer" error message builtinAnyPointer @56 :Void; builtinAnyStruct @58 :Void; builtinAnyList @59 :Void; builtinCapability @60 :Void; } annotation builtinParams @0x94099c3f9eb32d6b (field) :List(BrandParameter); struct ParamList { # A list of method parameters or method returns. union { namedList @0 :List(Param); type @1 :Expression; # Specified some other struct type instead of a named list. } startByte @2 :UInt32; endByte @3 :UInt32; } struct Param { name @0 :LocatedText; # If null, param failed to parse. type @1 :Expression; annotations @2 :List(AnnotationApplication); defaultValue :union { none @3 :Void; value @4 :Expression; } startByte @5 :UInt32; endByte @6 :UInt32; } } struct ParsedFile { root @0 :Declaration; } VisitFace/RtspNativeCodec/app/libs/capnproto/include/capnp/compiler/lexer.capnp
New file @@ -0,0 +1,67 @@ # Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors # Licensed under the MIT License: # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. @0xa73956d2621fc3ee; using Cxx = import "/capnp/c++.capnp"; $Cxx.namespace("capnp::compiler"); struct Token { union { identifier @0 :Text; stringLiteral @1 :Text; binaryLiteral @9 :Data; integerLiteral @2 :UInt64; floatLiteral @3 :Float64; operator @4 :Text; parenthesizedList @5 :List(List(Token)); bracketedList @6 :List(List(Token)); } startByte @7 :UInt32; endByte @8 :UInt32; } struct Statement { tokens @0 :List(Token); union { line @1 :Void; block @2 :List(Statement); } docComment @3 :Text; startByte @4 :UInt32; endByte @5 :UInt32; } struct LexedTokens { # Lexer output when asked to parse tokens that don't form statements. tokens @0 :List(Token); } struct LexedStatements { # Lexer output when asked to parse statements. statements @0 :List(Statement); } VisitFace/RtspNativeCodec/app/libs/capnproto/include/capnp/dynamic.h
@@ -179,6 +179,8 @@ template <typename T, typename = kj::EnableIf<kind<FromReader<T>>() == Kind::STRUCT>> inline Reader(T&& value): Reader(toDynamic(value)) {} inline operator AnyStruct::Reader() const { return AnyStruct::Reader(reader); } inline MessageSize totalSize() const { return reader.totalSize().asPublic(); } template <typename T> @@ -234,6 +236,7 @@ friend class Orphan<DynamicStruct>; friend class Orphan<DynamicValue>; friend class Orphan<AnyPointer>; friend class AnyStruct::Reader; }; class DynamicStruct::Builder { @@ -245,6 +248,8 @@ template <typename T, typename = kj::EnableIf<kind<FromBuilder<T>>() == Kind::STRUCT>> inline Builder(T&& value): Builder(toDynamic(value)) {} inline operator AnyStruct::Reader() { return AnyStruct::Builder(builder); } inline MessageSize totalSize() const { return asReader().totalSize(); } @@ -323,6 +328,7 @@ friend class Orphan<DynamicStruct>; friend class Orphan<DynamicValue>; friend class Orphan<AnyPointer>; friend class AnyStruct::Builder; }; class DynamicStruct::Pipeline { @@ -363,6 +369,8 @@ template <typename T, typename = kj::EnableIf<kind<FromReader<T>>() == Kind::LIST>> inline Reader(T&& value): Reader(toDynamic(value)) {} inline operator AnyList::Reader() const { return AnyList::Reader(reader); } template <typename T> typename T::Reader as() const; @@ -406,6 +414,8 @@ template <typename T, typename = kj::EnableIf<kind<FromBuilder<T>>() == Kind::LIST>> inline Builder(T&& value): Builder(toDynamic(value)) {} inline operator AnyList::Builder() { return AnyList::Builder(builder); } template <typename T> typename T::Builder as(); @@ -1516,6 +1526,16 @@ return AnyStruct::Builder(builder); } template <> inline DynamicStruct::Reader AnyStruct::Reader::as<DynamicStruct>(StructSchema schema) const { return DynamicStruct::Reader(schema, _reader); } template <> inline DynamicStruct::Builder AnyStruct::Builder::as<DynamicStruct>(StructSchema schema) { return DynamicStruct::Builder(schema, _builder); } template <typename T> typename T::Pipeline DynamicStruct::Pipeline::releaseAs() { static_assert(kind<T>() == Kind::STRUCT, VisitFace/RtspNativeCodec/app/libs/capnproto/include/capnp/persistent.capnp.h
@@ -9,7 +9,7 @@ #include <capnp/capability.h> #endif // !CAPNP_LITE #if CAPNP_VERSION != 6001 #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 VisitFace/RtspNativeCodec/app/libs/capnproto/include/capnp/rpc-twoparty.capnp.h
@@ -6,7 +6,7 @@ #include <capnp/generated-header-support.h> #if CAPNP_VERSION != 6001 #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 VisitFace/RtspNativeCodec/app/libs/capnproto/include/capnp/rpc.capnp
@@ -233,11 +233,11 @@ abort @1 :Exception; # Sent when a connection is being aborted due to an unrecoverable error. This could be e.g. # because the sender received an invalid or nonsensical message (`isCallersFault` is true) or # because the sender had an internal error (`isCallersFault` is false). The sender will shut # down the outgoing half of the connection after `abort` and will completely close the # connection shortly thereafter (it's up to the sender how much of a time buffer they want to # offer for the client to receive the `abort` before the connection is reset). # because the sender received an invalid or nonsensical message or because the sender had an # internal error. The sender will shut down the outgoing half of the connection after `abort` # and will completely close the connection shortly thereafter (it's up to the sender how much # of a time buffer they want to offer for the client to receive the `abort` before the # connection is reset). # Level 0 features ----------------------------------------------- @@ -446,23 +446,22 @@ # in the calls so that the results need not pass back through Vat B. # # For example: # - Alice, in Vat A, call foo() on Bob in Vat B. # - Alice, in Vat A, calls foo() on Bob in Vat B. # - Alice makes a pipelined call bar() on the promise returned by foo(). # - Later on, Bob resolves the promise from foo() to point at Carol, who lives in Vat A (next # to Alice). # - Vat B dutifully forwards the bar() call to Carol. Let us call this forwarded call bar'(). # Notice that bar() and bar'() are travelling in opposite directions on the same network # link. # - The `Call` for bar'() has `sendResultsTo` set to `yourself`, with the value being the # question ID originally assigned to the bar() call. # - The `Call` for bar'() has `sendResultsTo` set to `yourself`. # - Vat B sends a `Return` for bar() with `takeFromOtherQuestion` set in place of the results, # with the value set to the question ID of bar'(). Vat B does not wait for bar'() to return, # as doing so would introduce unnecessary round trip latency. # - Vat A receives bar'() and delivers it to Carol. # - When bar'() returns, Vat A immediately takes the results and returns them from bar(). # - Meanwhile, Vat A sends a `Return` for bar'() to Vat B, with `resultsSentElsewhere` set in # place of results. # - Vat A sends a `Finish` for that call to Vat B. # - Vat B receives the `Return` for bar'() and sends a `Return` for bar(), with # `receivedFromYourself` set in place of the results. # - Vat B receives the `Finish` for bar() and sends a `Finish` to bar'(). # - When bar'() returns, Vat A sends a `Return` for bar'() to Vat B, with `resultsSentElsewhere` # set in place of results. # - Vat A sends a `Finish` for the bar() call to Vat B. # - Vat B receives the `Finish` for bar() and sends a `Finish` for bar'(). thirdParty @7 :RecipientId; # **(level 3)** @@ -518,7 +517,7 @@ takeFromOtherQuestion @6 :QuestionId; # The sender has also sent (before this message) a `Call` with the given question ID and with # `sendResultsTo.yourself` set, and the results of that other call should be used as the # results here. # results here. `takeFromOtherQuestion` can only used once per question. acceptFromThirdParty @7 :ThirdPartyCapId; # **(level 3)** @@ -781,7 +780,7 @@ # Message type sent to pick up a capability hosted by the receiving vat and provided by a third # party. The third party previously designated the capability using `Provide`. # # This message is also used to pick up a redirected return -- see `Return.redirect`. # This message is also used to pick up a redirected return -- see `Return.acceptFromThirdParty`. questionId @0 :QuestionId; # A new question ID identifying this accept message, which will eventually receive a Return @@ -951,8 +950,8 @@ # Hopefully this is unusual. senderHosted @1 :ExportId; # A capability newly exported by the sender. This is the ID of the new capability in the # sender's export table (receiver's import table). # The ID of a capability in the sender's export table (receiver's import table). It may be a # newly allocated table entry, or an existing entry (increments the reference count). senderPromise @2 :ExportId; # A promise that the sender will resolve later. The sender will send exactly one Resolve @@ -1234,8 +1233,8 @@ # The information that must be sent in an `Accept` message to identify the object being accepted. # # In a network where each vat has a public/private key pair, this could simply be the public key # fingerprint of the provider vat along with the question ID used in the `Provide` message sent from # that provider. # fingerprint of the provider vat along with a nonce matching the one in the `RecipientId` used # in the `Provide` message sent from that provider. using RecipientId = AnyPointer; # **(level 3)** @@ -1244,8 +1243,7 @@ # capability. # # In a network where each vat has a public/private key pair, this could simply be the public key # fingerprint of the recipient. (CapTP also calls for a nonce to identify the object. In our # case, the `Provide` message's `questionId` can serve as the nonce.) # fingerprint of the recipient along with a nonce matching the one in the `ProvisionId`. using ThirdPartyCapId = AnyPointer; # **(level 3)** @@ -1254,8 +1252,8 @@ # # In a network where each vat has a public/private key pair, this could be a combination of the # third party's public key fingerprint, hints on how to connect to the third party (e.g. an IP # address), and the question ID used in the corresponding `Provide` message sent to that third party # (used to identify which capability to pick up). # address), and the nonce used in the corresponding `Provide` message's `RecipientId` as sent # to that third party (used to identify which capability to pick up). using JoinKeyPart = AnyPointer; # **(level 4)** VisitFace/RtspNativeCodec/app/libs/capnproto/include/capnp/rpc.capnp.h
@@ -6,7 +6,7 @@ #include <capnp/generated-header-support.h> #if CAPNP_VERSION != 6001 #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 VisitFace/RtspNativeCodec/app/libs/capnproto/include/capnp/schema-parser.h
@@ -77,6 +77,11 @@ // normally. In this case, the result is a best-effort attempt to compile the schema, but it // may be invalid or corrupt, and using it for anything may cause exceptions to be thrown. kj::Maybe<schema::Node::SourceInfo::Reader> getSourceInfo(Schema schema) const; // Look up source info (e.g. doc comments) for the given schema, which must have come from this // SchemaParser. Note that this will also work for implicit group and param types that don't have // a type name hence don't have a `ParsedSchema`. template <typename T> inline void loadCompiledTypeAndDependencies() { // See SchemaLoader::loadCompiledTypeAndDependencies(). @@ -110,6 +115,9 @@ // Gets the nested node with the given name, or throws an exception if there is no such nested // declaration. schema::Node::SourceInfo::Reader getSourceInfo() const; // Get the source info for this schema. private: inline ParsedSchema(Schema inner, const SchemaParser& parser): Schema(inner), parser(&parser) {} VisitFace/RtspNativeCodec/app/libs/capnproto/include/capnp/schema.capnp
@@ -169,6 +169,33 @@ targetsAnnotation @30 :Bool; } } struct SourceInfo { # Additional information about a node which is not needed at runtime, but may be useful for # documentation or debugging purposes. This is kept in a separate struct to make sure it # doesn't accidentally get included in contexts where it is not needed. The # `CodeGeneratorRequest` includes this information in a separate array. id @0 :Id; # ID of the Node which this info describes. docComment @1 :Text; # The top-level doc comment for the Node. members @2 :List(Member); # Information about each member -- i.e. fields (for structs), enumerants (for enums), or # methods (for interfaces). # # This list is the same length and order as the corresponding list in the Node, i.e. # Node.struct.fields, Node.enum.enumerants, or Node.interface.methods. struct Member { docComment @0 :Text; # Doc comment on the member. } # TODO(someday): Record location of the declaration in the original source code. } } struct Field { @@ -468,6 +495,10 @@ # All nodes parsed by the compiler, including for the files on the command line and their # imports. sourceInfo @3 :List(Node.SourceInfo); # Information about the original source code for each node, where available. This array may be # omitted or may be missing some nodes if no info is available for them. requestedFiles @1 :List(RequestedFile); # Files which were listed on the command line. VisitFace/RtspNativeCodec/app/libs/capnproto/include/capnp/schema.capnp.h
@@ -6,7 +6,7 @@ #include <capnp/generated-header-support.h> #if CAPNP_VERSION != 6001 #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 @@ -17,6 +17,8 @@ CAPNP_DECLARE_SCHEMA(e682ab4cf923a417); CAPNP_DECLARE_SCHEMA(b9521bccf10fa3b1); CAPNP_DECLARE_SCHEMA(debf55bbfa0fc242); CAPNP_DECLARE_SCHEMA(f38e1de3041357ae); CAPNP_DECLARE_SCHEMA(c2ba9038898e1fa2); CAPNP_DECLARE_SCHEMA(9ea0b19b37fb4435); CAPNP_DECLARE_SCHEMA(b54ab3364333f598); CAPNP_DECLARE_SCHEMA(e82753cff0c2218f); @@ -83,6 +85,7 @@ }; struct Parameter; struct NestedNode; struct SourceInfo; struct Struct; struct Enum; struct Interface; @@ -121,6 +124,37 @@ struct _capnpPrivate { CAPNP_DECLARE_STRUCT_HEADER(debf55bbfa0fc242, 1, 1) #if !CAPNP_LITE static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } #endif // !CAPNP_LITE }; }; struct Node::SourceInfo { SourceInfo() = delete; class Reader; class Builder; class Pipeline; struct Member; struct _capnpPrivate { CAPNP_DECLARE_STRUCT_HEADER(f38e1de3041357ae, 1, 2) #if !CAPNP_LITE static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } #endif // !CAPNP_LITE }; }; struct Node::SourceInfo::Member { Member() = delete; class Reader; class Builder; class Pipeline; struct _capnpPrivate { CAPNP_DECLARE_STRUCT_HEADER(c2ba9038898e1fa2, 0, 1) #if !CAPNP_LITE static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } #endif // !CAPNP_LITE @@ -626,7 +660,7 @@ struct RequestedFile; struct _capnpPrivate { CAPNP_DECLARE_STRUCT_HEADER(bfc546f6210ad7ce, 0, 3) CAPNP_DECLARE_STRUCT_HEADER(bfc546f6210ad7ce, 0, 4) #if !CAPNP_LITE static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } #endif // !CAPNP_LITE @@ -995,6 +1029,183 @@ class Node::NestedNode::Pipeline { public: typedef NestedNode 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 <typename, ::capnp::Kind> friend struct ::capnp::ToDynamic_; }; #endif // !CAPNP_LITE class Node::SourceInfo::Reader { public: typedef SourceInfo 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 ::uint64_t getId() const; inline bool hasDocComment() const; inline ::capnp::Text::Reader getDocComment() const; inline bool hasMembers() const; inline ::capnp::List< ::capnp::schema::Node::SourceInfo::Member>::Reader getMembers() const; private: ::capnp::_::StructReader _reader; template <typename, ::capnp::Kind> friend struct ::capnp::ToDynamic_; template <typename, ::capnp::Kind> friend struct ::capnp::_::PointerHelpers; template <typename, ::capnp::Kind> friend struct ::capnp::List; friend class ::capnp::MessageBuilder; friend class ::capnp::Orphanage; }; class Node::SourceInfo::Builder { public: typedef SourceInfo 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 ::uint64_t getId(); inline void setId( ::uint64_t value); inline bool hasDocComment(); inline ::capnp::Text::Builder getDocComment(); inline void setDocComment( ::capnp::Text::Reader value); inline ::capnp::Text::Builder initDocComment(unsigned int size); inline void adoptDocComment(::capnp::Orphan< ::capnp::Text>&& value); inline ::capnp::Orphan< ::capnp::Text> disownDocComment(); inline bool hasMembers(); inline ::capnp::List< ::capnp::schema::Node::SourceInfo::Member>::Builder getMembers(); inline void setMembers( ::capnp::List< ::capnp::schema::Node::SourceInfo::Member>::Reader value); inline ::capnp::List< ::capnp::schema::Node::SourceInfo::Member>::Builder initMembers(unsigned int size); inline void adoptMembers(::capnp::Orphan< ::capnp::List< ::capnp::schema::Node::SourceInfo::Member>>&& value); inline ::capnp::Orphan< ::capnp::List< ::capnp::schema::Node::SourceInfo::Member>> disownMembers(); private: ::capnp::_::StructBuilder _builder; template <typename, ::capnp::Kind> friend struct ::capnp::ToDynamic_; friend class ::capnp::Orphanage; template <typename, ::capnp::Kind> friend struct ::capnp::_::PointerHelpers; }; #if !CAPNP_LITE class Node::SourceInfo::Pipeline { public: typedef SourceInfo 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 <typename, ::capnp::Kind> friend struct ::capnp::ToDynamic_; }; #endif // !CAPNP_LITE class Node::SourceInfo::Member::Reader { public: typedef Member 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 hasDocComment() const; inline ::capnp::Text::Reader getDocComment() const; private: ::capnp::_::StructReader _reader; template <typename, ::capnp::Kind> friend struct ::capnp::ToDynamic_; template <typename, ::capnp::Kind> friend struct ::capnp::_::PointerHelpers; template <typename, ::capnp::Kind> friend struct ::capnp::List; friend class ::capnp::MessageBuilder; friend class ::capnp::Orphanage; }; class Node::SourceInfo::Member::Builder { public: typedef Member 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 hasDocComment(); inline ::capnp::Text::Builder getDocComment(); inline void setDocComment( ::capnp::Text::Reader value); inline ::capnp::Text::Builder initDocComment(unsigned int size); inline void adoptDocComment(::capnp::Orphan< ::capnp::Text>&& value); inline ::capnp::Orphan< ::capnp::Text> disownDocComment(); private: ::capnp::_::StructBuilder _builder; template <typename, ::capnp::Kind> friend struct ::capnp::ToDynamic_; friend class ::capnp::Orphanage; template <typename, ::capnp::Kind> friend struct ::capnp::_::PointerHelpers; }; #if !CAPNP_LITE class Node::SourceInfo::Member::Pipeline { public: typedef Member Pipelines; inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) @@ -3839,6 +4050,9 @@ inline bool hasCapnpVersion() const; inline ::capnp::schema::CapnpVersion::Reader getCapnpVersion() const; inline bool hasSourceInfo() const; inline ::capnp::List< ::capnp::schema::Node::SourceInfo>::Reader getSourceInfo() const; private: ::capnp::_::StructReader _reader; template <typename, ::capnp::Kind> @@ -3887,6 +4101,13 @@ inline ::capnp::schema::CapnpVersion::Builder initCapnpVersion(); inline void adoptCapnpVersion(::capnp::Orphan< ::capnp::schema::CapnpVersion>&& value); inline ::capnp::Orphan< ::capnp::schema::CapnpVersion> disownCapnpVersion(); inline bool hasSourceInfo(); inline ::capnp::List< ::capnp::schema::Node::SourceInfo>::Builder getSourceInfo(); inline void setSourceInfo( ::capnp::List< ::capnp::schema::Node::SourceInfo>::Reader value); inline ::capnp::List< ::capnp::schema::Node::SourceInfo>::Builder initSourceInfo(unsigned int size); inline void adoptSourceInfo(::capnp::Orphan< ::capnp::List< ::capnp::schema::Node::SourceInfo>>&& value); inline ::capnp::Orphan< ::capnp::List< ::capnp::schema::Node::SourceInfo>> disownSourceInfo(); private: ::capnp::_::StructBuilder _builder; @@ -4536,6 +4757,122 @@ inline void Node::NestedNode::Builder::setId( ::uint64_t value) { _builder.setDataField< ::uint64_t>( ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); } inline ::uint64_t Node::SourceInfo::Reader::getId() const { return _reader.getDataField< ::uint64_t>( ::capnp::bounded<0>() * ::capnp::ELEMENTS); } inline ::uint64_t Node::SourceInfo::Builder::getId() { return _builder.getDataField< ::uint64_t>( ::capnp::bounded<0>() * ::capnp::ELEMENTS); } inline void Node::SourceInfo::Builder::setId( ::uint64_t value) { _builder.setDataField< ::uint64_t>( ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); } inline bool Node::SourceInfo::Reader::hasDocComment() const { return !_reader.getPointerField( ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); } inline bool Node::SourceInfo::Builder::hasDocComment() { return !_builder.getPointerField( ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); } inline ::capnp::Text::Reader Node::SourceInfo::Reader::getDocComment() const { return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( ::capnp::bounded<0>() * ::capnp::POINTERS)); } inline ::capnp::Text::Builder Node::SourceInfo::Builder::getDocComment() { return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( ::capnp::bounded<0>() * ::capnp::POINTERS)); } inline void Node::SourceInfo::Builder::setDocComment( ::capnp::Text::Reader value) { ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( ::capnp::bounded<0>() * ::capnp::POINTERS), value); } inline ::capnp::Text::Builder Node::SourceInfo::Builder::initDocComment(unsigned int size) { return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( ::capnp::bounded<0>() * ::capnp::POINTERS), size); } inline void Node::SourceInfo::Builder::adoptDocComment( ::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> Node::SourceInfo::Builder::disownDocComment() { return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( ::capnp::bounded<0>() * ::capnp::POINTERS)); } inline bool Node::SourceInfo::Reader::hasMembers() const { return !_reader.getPointerField( ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); } inline bool Node::SourceInfo::Builder::hasMembers() { return !_builder.getPointerField( ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); } inline ::capnp::List< ::capnp::schema::Node::SourceInfo::Member>::Reader Node::SourceInfo::Reader::getMembers() const { return ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::schema::Node::SourceInfo::Member>>::get(_reader.getPointerField( ::capnp::bounded<1>() * ::capnp::POINTERS)); } inline ::capnp::List< ::capnp::schema::Node::SourceInfo::Member>::Builder Node::SourceInfo::Builder::getMembers() { return ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::schema::Node::SourceInfo::Member>>::get(_builder.getPointerField( ::capnp::bounded<1>() * ::capnp::POINTERS)); } inline void Node::SourceInfo::Builder::setMembers( ::capnp::List< ::capnp::schema::Node::SourceInfo::Member>::Reader value) { ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::schema::Node::SourceInfo::Member>>::set(_builder.getPointerField( ::capnp::bounded<1>() * ::capnp::POINTERS), value); } inline ::capnp::List< ::capnp::schema::Node::SourceInfo::Member>::Builder Node::SourceInfo::Builder::initMembers(unsigned int size) { return ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::schema::Node::SourceInfo::Member>>::init(_builder.getPointerField( ::capnp::bounded<1>() * ::capnp::POINTERS), size); } inline void Node::SourceInfo::Builder::adoptMembers( ::capnp::Orphan< ::capnp::List< ::capnp::schema::Node::SourceInfo::Member>>&& value) { ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::schema::Node::SourceInfo::Member>>::adopt(_builder.getPointerField( ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); } inline ::capnp::Orphan< ::capnp::List< ::capnp::schema::Node::SourceInfo::Member>> Node::SourceInfo::Builder::disownMembers() { return ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::schema::Node::SourceInfo::Member>>::disown(_builder.getPointerField( ::capnp::bounded<1>() * ::capnp::POINTERS)); } inline bool Node::SourceInfo::Member::Reader::hasDocComment() const { return !_reader.getPointerField( ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); } inline bool Node::SourceInfo::Member::Builder::hasDocComment() { return !_builder.getPointerField( ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); } inline ::capnp::Text::Reader Node::SourceInfo::Member::Reader::getDocComment() const { return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( ::capnp::bounded<0>() * ::capnp::POINTERS)); } inline ::capnp::Text::Builder Node::SourceInfo::Member::Builder::getDocComment() { return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( ::capnp::bounded<0>() * ::capnp::POINTERS)); } inline void Node::SourceInfo::Member::Builder::setDocComment( ::capnp::Text::Reader value) { ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( ::capnp::bounded<0>() * ::capnp::POINTERS), value); } inline ::capnp::Text::Builder Node::SourceInfo::Member::Builder::initDocComment(unsigned int size) { return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( ::capnp::bounded<0>() * ::capnp::POINTERS), size); } inline void Node::SourceInfo::Member::Builder::adoptDocComment( ::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> Node::SourceInfo::Member::Builder::disownDocComment() { return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( ::capnp::bounded<0>() * ::capnp::POINTERS)); } inline ::uint16_t Node::Struct::Reader::getDataWordCount() const { @@ -7725,6 +8062,40 @@ ::capnp::bounded<2>() * ::capnp::POINTERS)); } inline bool CodeGeneratorRequest::Reader::hasSourceInfo() const { return !_reader.getPointerField( ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); } inline bool CodeGeneratorRequest::Builder::hasSourceInfo() { return !_builder.getPointerField( ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); } inline ::capnp::List< ::capnp::schema::Node::SourceInfo>::Reader CodeGeneratorRequest::Reader::getSourceInfo() const { return ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::schema::Node::SourceInfo>>::get(_reader.getPointerField( ::capnp::bounded<3>() * ::capnp::POINTERS)); } inline ::capnp::List< ::capnp::schema::Node::SourceInfo>::Builder CodeGeneratorRequest::Builder::getSourceInfo() { return ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::schema::Node::SourceInfo>>::get(_builder.getPointerField( ::capnp::bounded<3>() * ::capnp::POINTERS)); } inline void CodeGeneratorRequest::Builder::setSourceInfo( ::capnp::List< ::capnp::schema::Node::SourceInfo>::Reader value) { ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::schema::Node::SourceInfo>>::set(_builder.getPointerField( ::capnp::bounded<3>() * ::capnp::POINTERS), value); } inline ::capnp::List< ::capnp::schema::Node::SourceInfo>::Builder CodeGeneratorRequest::Builder::initSourceInfo(unsigned int size) { return ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::schema::Node::SourceInfo>>::init(_builder.getPointerField( ::capnp::bounded<3>() * ::capnp::POINTERS), size); } inline void CodeGeneratorRequest::Builder::adoptSourceInfo( ::capnp::Orphan< ::capnp::List< ::capnp::schema::Node::SourceInfo>>&& value) { ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::schema::Node::SourceInfo>>::adopt(_builder.getPointerField( ::capnp::bounded<3>() * ::capnp::POINTERS), kj::mv(value)); } inline ::capnp::Orphan< ::capnp::List< ::capnp::schema::Node::SourceInfo>> CodeGeneratorRequest::Builder::disownSourceInfo() { return ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::schema::Node::SourceInfo>>::disown(_builder.getPointerField( ::capnp::bounded<3>() * ::capnp::POINTERS)); } inline ::uint64_t CodeGeneratorRequest::RequestedFile::Reader::getId() const { return _reader.getDataField< ::uint64_t>( ::capnp::bounded<0>() * ::capnp::ELEMENTS); VisitFace/RtspNativeCodec/app/libs/capnproto/include/capnp/schema.h
@@ -599,6 +599,8 @@ template <typename T> inline static Type from(); template <typename T> inline static Type from(T&& value); inline schema::Type::Which which() const; @@ -679,6 +681,9 @@ } void requireUsableAs(Type expected) const; template <typename T, Kind k> struct FromValueImpl; friend class ListSchema; // only for requireUsableAs() }; @@ -899,6 +904,29 @@ template <typename T> inline Type Type::from() { return Type(Schema::from<T>()); } template <typename T, Kind k> struct Type::FromValueImpl { template <typename U> static inline Type type(U&& value) { return Type::from<T>(); } }; template <typename T> struct Type::FromValueImpl<T, Kind::OTHER> { template <typename U> static inline Type type(U&& value) { // All dynamic types have getSchema(). return value.getSchema(); } }; template <typename T> inline Type Type::from(T&& value) { typedef FromAny<kj::Decay<T>> Base; return Type::FromValueImpl<Base, kind<Base>()>::type(kj::fwd<T>(value)); } inline bool Type::isVoid () const { return baseType == schema::Type::VOID && listDepth == 0; } inline bool Type::isBool () const { return baseType == schema::Type::BOOL && listDepth == 0; } inline bool Type::isInt8 () const { return baseType == schema::Type::INT8 && listDepth == 0; } VisitFace/RtspNativeCodec/app/libs/capnproto/include/capnp/test-import.capnp
New file @@ -0,0 +1,28 @@ # Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors # Licensed under the MIT License: # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. @0xf36d7b330303c66e; using Test = import "test.capnp"; struct TestImport { field @0 :Test.TestAllTypes; } VisitFace/RtspNativeCodec/app/libs/capnproto/include/capnp/test-import2.capnp
New file @@ -0,0 +1,32 @@ # Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors # Licensed under the MIT License: # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. @0xc64a3bf0338a124a; using Import1 = import "/capnp/schema.capnp"; using Import2 = import "test-import.capnp"; using Import3 = import "test.capnp"; struct TestImport2 { foo @0 :Import3.TestAllTypes; bar @1 :Import1.Node; baz @2 :Import2.TestImport; } VisitFace/RtspNativeCodec/app/libs/capnproto/include/capnp/test.capnp
New file @@ -0,0 +1,965 @@ # Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors # Licensed under the MIT License: # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. @0xd508eebdc2dc42b8; using Cxx = import "c++.capnp"; # Use a namespace likely to cause trouble if the generated code doesn't use fully-qualified # names for stuff in the capnproto namespace. $Cxx.namespace("capnproto_test::capnp::test"); enum TestEnum { foo @0; bar @1; baz @2; qux @3; quux @4; corge @5; grault @6; garply @7; } struct TestAllTypes { voidField @0 : Void; boolField @1 : Bool; int8Field @2 : Int8; int16Field @3 : Int16; int32Field @4 : Int32; int64Field @5 : Int64; uInt8Field @6 : UInt8; uInt16Field @7 : UInt16; uInt32Field @8 : UInt32; uInt64Field @9 : UInt64; float32Field @10 : Float32; float64Field @11 : Float64; textField @12 : Text; dataField @13 : Data; structField @14 : TestAllTypes; enumField @15 : TestEnum; interfaceField @16 : Void; # TODO voidList @17 : List(Void); boolList @18 : List(Bool); int8List @19 : List(Int8); int16List @20 : List(Int16); int32List @21 : List(Int32); int64List @22 : List(Int64); uInt8List @23 : List(UInt8); uInt16List @24 : List(UInt16); uInt32List @25 : List(UInt32); uInt64List @26 : List(UInt64); float32List @27 : List(Float32); float64List @28 : List(Float64); textList @29 : List(Text); dataList @30 : List(Data); structList @31 : List(TestAllTypes); enumList @32 : List(TestEnum); interfaceList @33 : List(Void); # TODO } struct TestDefaults { voidField @0 : Void = void; boolField @1 : Bool = true; int8Field @2 : Int8 = -123; int16Field @3 : Int16 = -12345; int32Field @4 : Int32 = -12345678; int64Field @5 : Int64 = -123456789012345; uInt8Field @6 : UInt8 = 234; uInt16Field @7 : UInt16 = 45678; uInt32Field @8 : UInt32 = 3456789012; uInt64Field @9 : UInt64 = 12345678901234567890; float32Field @10 : Float32 = 1234.5; float64Field @11 : Float64 = -123e45; textField @12 : Text = "foo"; dataField @13 : Data = 0x"62 61 72"; # "bar" structField @14 : TestAllTypes = ( voidField = void, boolField = true, int8Field = -12, int16Field = 3456, int32Field = -78901234, int64Field = 56789012345678, uInt8Field = 90, uInt16Field = 1234, uInt32Field = 56789012, uInt64Field = 345678901234567890, float32Field = -1.25e-10, float64Field = 345, textField = "baz", dataField = "qux", structField = ( textField = "nested", structField = (textField = "really nested")), enumField = baz, # interfaceField can't have a default voidList = [void, void, void], boolList = [false, true, false, true, true], int8List = [12, -34, -0x80, 0x7f], int16List = [1234, -5678, -0x8000, 0x7fff], int32List = [12345678, -90123456, -0x80000000, 0x7fffffff], int64List = [123456789012345, -678901234567890, -0x8000000000000000, 0x7fffffffffffffff], uInt8List = [12, 34, 0, 0xff], uInt16List = [1234, 5678, 0, 0xffff], uInt32List = [12345678, 90123456, 0, 0xffffffff], uInt64List = [123456789012345, 678901234567890, 0, 0xffffffffffffffff], float32List = [0, 1234567, 1e37, -1e37, 1e-37, -1e-37], float64List = [0, 123456789012345, 1e306, -1e306, 1e-306, -1e-306], textList = ["quux", "corge", "grault"], dataList = ["garply", "waldo", "fred"], structList = [ (textField = "x structlist 1"), (textField = "x structlist 2"), (textField = "x structlist 3")], enumList = [qux, bar, grault] # interfaceList can't have a default ); enumField @15 : TestEnum = corge; interfaceField @16 : Void; # TODO voidList @17 : List(Void) = [void, void, void, void, void, void]; boolList @18 : List(Bool) = [true, false, false, true]; int8List @19 : List(Int8) = [111, -111]; int16List @20 : List(Int16) = [11111, -11111]; int32List @21 : List(Int32) = [111111111, -111111111]; int64List @22 : List(Int64) = [1111111111111111111, -1111111111111111111]; uInt8List @23 : List(UInt8) = [111, 222] ; uInt16List @24 : List(UInt16) = [33333, 44444]; uInt32List @25 : List(UInt32) = [3333333333]; uInt64List @26 : List(UInt64) = [11111111111111111111]; float32List @27 : List(Float32) = [5555.5, inf, -inf, nan]; float64List @28 : List(Float64) = [7777.75, inf, -inf, nan]; textList @29 : List(Text) = ["plugh", "xyzzy", "thud"]; dataList @30 : List(Data) = ["oops", "exhausted", "rfc3092"]; structList @31 : List(TestAllTypes) = [ (textField = "structlist 1"), (textField = "structlist 2"), (textField = "structlist 3")]; enumList @32 : List(TestEnum) = [foo, garply]; interfaceList @33 : List(Void); # TODO } struct TestAnyPointer { anyPointerField @0 :AnyPointer; # Do not add any other fields here! Some tests rely on anyPointerField being the last pointer # in the struct. } struct TestAnyOthers { anyStructField @0 :AnyStruct; anyListField @1 :AnyList; capabilityField @2 :Capability; } struct TestOutOfOrder { foo @3 :Text; bar @2 :Text; baz @8 :Text; qux @0 :Text; quux @6 :Text; corge @4 :Text; grault @1 :Text; garply @7 :Text; waldo @5 :Text; } struct TestUnion { union0 @0! :union { # Pack union 0 under ideal conditions: there is no unused padding space prior to it. u0f0s0 @4: Void; u0f0s1 @5: Bool; u0f0s8 @6: Int8; u0f0s16 @7: Int16; u0f0s32 @8: Int32; u0f0s64 @9: Int64; u0f0sp @10: Text; # Pack more stuff into union0 -- should go in same space. u0f1s0 @11: Void; u0f1s1 @12: Bool; u0f1s8 @13: Int8; u0f1s16 @14: Int16; u0f1s32 @15: Int32; u0f1s64 @16: Int64; u0f1sp @17: Text; } # Pack one bit in order to make pathological situation for union1. bit0 @18: Bool; union1 @1! :union { # Pack pathologically bad case. Each field takes up new space. u1f0s0 @19: Void; u1f0s1 @20: Bool; u1f1s1 @21: Bool; u1f0s8 @22: Int8; u1f1s8 @23: Int8; u1f0s16 @24: Int16; u1f1s16 @25: Int16; u1f0s32 @26: Int32; u1f1s32 @27: Int32; u1f0s64 @28: Int64; u1f1s64 @29: Int64; u1f0sp @30: Text; u1f1sp @31: Text; # Pack more stuff into union1 -- each should go into the same space as corresponding u1f0s*. u1f2s0 @32: Void; u1f2s1 @33: Bool; u1f2s8 @34: Int8; u1f2s16 @35: Int16; u1f2s32 @36: Int32; u1f2s64 @37: Int64; u1f2sp @38: Text; } # Fill in the rest of that bitfield from earlier. bit2 @39: Bool; bit3 @40: Bool; bit4 @41: Bool; bit5 @42: Bool; bit6 @43: Bool; bit7 @44: Bool; # Interleave two unions to be really annoying. # Also declare in reverse order to make sure union discriminant values are sorted by field number # and not by declaration order. union2 @2! :union { u2f0s64 @54: Int64; u2f0s32 @52: Int32; u2f0s16 @50: Int16; u2f0s8 @47: Int8; u2f0s1 @45: Bool; } union3 @3! :union { u3f0s64 @55: Int64; u3f0s32 @53: Int32; u3f0s16 @51: Int16; u3f0s8 @48: Int8; u3f0s1 @46: Bool; } byte0 @49: UInt8; } struct TestUnnamedUnion { before @0 :Text; union { foo @1 :UInt16; bar @3 :UInt32; } middle @2 :UInt16; after @4 :Text; } struct TestUnionInUnion { # There is no reason to ever do this. outer :union { inner :union { foo @0 :Int32; bar @1 :Int32; } baz @2 :Int32; } } struct TestGroups { groups :union { foo :group { corge @0 :Int32; grault @2 :Int64; garply @8 :Text; } bar :group { corge @3 :Int32; grault @4 :Text; garply @5 :Int64; } baz :group { corge @1 :Int32; grault @6 :Text; garply @7 :Text; } } } struct TestInterleavedGroups { group1 :group { foo @0 :UInt32; bar @2 :UInt64; union { qux @4 :UInt16; corge :group { grault @6 :UInt64; garply @8 :UInt16; plugh @14 :Text; xyzzy @16 :Text; } fred @12 :Text; } waldo @10 :Text; } group2 :group { foo @1 :UInt32; bar @3 :UInt64; union { qux @5 :UInt16; corge :group { grault @7 :UInt64; garply @9 :UInt16; plugh @15 :Text; xyzzy @17 :Text; } fred @13 :Text; } waldo @11 :Text; } } struct TestUnionDefaults { s16s8s64s8Set @0 :TestUnion = (union0 = (u0f0s16 = 321), union1 = (u1f0s8 = 123), union2 = (u2f0s64 = 12345678901234567), union3 = (u3f0s8 = 55)); s0sps1s32Set @1 :TestUnion = (union0 = (u0f1s0 = void), union1 = (u1f0sp = "foo"), union2 = (u2f0s1 = true), union3 = (u3f0s32 = 12345678)); unnamed1 @2 :TestUnnamedUnion = (foo = 123); unnamed2 @3 :TestUnnamedUnion = (bar = 321, before = "foo", after = "bar"); } struct TestNestedTypes { enum NestedEnum { foo @0; bar @1; } struct NestedStruct { enum NestedEnum { baz @0; qux @1; quux @2; } outerNestedEnum @0 :TestNestedTypes.NestedEnum = bar; innerNestedEnum @1 :NestedEnum = quux; } nestedStruct @0 :NestedStruct; outerNestedEnum @1 :NestedEnum = bar; innerNestedEnum @2 :NestedStruct.NestedEnum = quux; } struct TestUsing { using OuterNestedEnum = TestNestedTypes.NestedEnum; using TestNestedTypes.NestedStruct.NestedEnum; outerNestedEnum @1 :OuterNestedEnum = bar; innerNestedEnum @0 :NestedEnum = quux; } struct TestLists { # Small structs, when encoded as list, will be encoded as primitive lists rather than struct # lists, to save space. struct Struct0 { f @0 :Void; } struct Struct1 { f @0 :Bool; } struct Struct8 { f @0 :UInt8; } struct Struct16 { f @0 :UInt16; } struct Struct32 { f @0 :UInt32; } struct Struct64 { f @0 :UInt64; } struct StructP { f @0 :Text; } # Versions of the above which cannot be encoded as primitive lists. struct Struct0c { f @0 :Void; pad @1 :Text; } struct Struct1c { f @0 :Bool; pad @1 :Text; } struct Struct8c { f @0 :UInt8; pad @1 :Text; } struct Struct16c { f @0 :UInt16; pad @1 :Text; } struct Struct32c { f @0 :UInt32; pad @1 :Text; } struct Struct64c { f @0 :UInt64; pad @1 :Text; } struct StructPc { f @0 :Text; pad @1 :UInt64; } list0 @0 :List(Struct0); list1 @1 :List(Struct1); list8 @2 :List(Struct8); list16 @3 :List(Struct16); list32 @4 :List(Struct32); list64 @5 :List(Struct64); listP @6 :List(StructP); int32ListList @7 :List(List(Int32)); textListList @8 :List(List(Text)); structListList @9 :List(List(TestAllTypes)); } struct TestFieldZeroIsBit { bit @0 :Bool; secondBit @1 :Bool = true; thirdField @2 :UInt8 = 123; } struct TestListDefaults { lists @0 :TestLists = ( list0 = [(f = void), (f = void)], list1 = [(f = true), (f = false), (f = true), (f = true)], list8 = [(f = 123), (f = 45)], list16 = [(f = 12345), (f = 6789)], list32 = [(f = 123456789), (f = 234567890)], list64 = [(f = 1234567890123456), (f = 2345678901234567)], listP = [(f = "foo"), (f = "bar")], int32ListList = [[1, 2, 3], [4, 5], [12341234]], textListList = [["foo", "bar"], ["baz"], ["qux", "corge"]], structListList = [[(int32Field = 123), (int32Field = 456)], [(int32Field = 789)]]); } struct TestLateUnion { # Test what happens if the unions are not the first ordinals in the struct. At one point this # was broken for the dynamic API. foo @0 :Int32; bar @1 :Text; baz @2 :Int16; theUnion @3! :union { qux @4 :Text; corge @5 :List(Int32); grault @6 :Float32; } anotherUnion @7! :union { qux @8 :Text; corge @9 :List(Int32); grault @10 :Float32; } } struct TestOldVersion { # A subset of TestNewVersion. old1 @0 :Int64; old2 @1 :Text; old3 @2 :TestOldVersion; } struct TestNewVersion { # A superset of TestOldVersion. old1 @0 :Int64; old2 @1 :Text; old3 @2 :TestNewVersion; new1 @3 :Int64 = 987; new2 @4 :Text = "baz"; } struct TestOldUnionVersion { union { a @0 :Void; b @1 :UInt64; } } struct TestNewUnionVersion { union { a :union { a0 @0 :Void; a1 @2 :UInt64; } b @1 :UInt64; } } struct TestStructUnion { un @0! :union { struct @1 :SomeStruct; object @2 :TestAnyPointer; } struct SomeStruct { someText @0 :Text; moreText @1 :Text; } } struct TestPrintInlineStructs { someText @0 :Text; structList @1 :List(InlineStruct); struct InlineStruct { int32Field @0 :Int32; textField @1 :Text; } } struct TestWholeFloatDefault { # At one point, these failed to compile in C++ because it would produce literals like "123f", # which is not valid; it needs to be "123.0f". field @0 :Float32 = 123; bigField @1 :Float32 = 2e30; const constant :Float32 = 456; const bigConstant :Float32 = 4e30; } struct TestGenerics(Foo, Bar) { foo @0 :Foo; rev @1 :TestGenerics(Bar, Foo); union { uv @2:Void; ug :group { ugfoo @3:Int32; } } list @4 :List(Inner); # At one time this failed to compile with MSVC due to poor expression SFINAE support. struct Inner { foo @0 :Foo; bar @1 :Bar; } struct Inner2(Baz) { bar @0 :Bar; baz @1 :Baz; innerBound @2 :Inner; innerUnbound @3 :TestGenerics.Inner; struct DeepNest(Qux) { foo @0 :Foo; bar @1 :Bar; baz @2 :Baz; qux @3 :Qux; interface DeepNestInterface(Quux) { # At one time this failed to compile. call @0 () -> (); } } } interface Interface(Qux) { call @0 Inner2(Text) -> (qux :Qux, gen :TestGenerics(TestAllTypes, TestAnyPointer)); } annotation ann(struct) :Foo; using AliasFoo = Foo; using AliasInner = Inner; using AliasInner2 = Inner2; using AliasInner2Text = Inner2(Text); using AliasRev = TestGenerics(Bar, Foo); struct UseAliases { foo @0 :AliasFoo; inner @1 :AliasInner; inner2 @2 :AliasInner2; inner2Bind @3 :AliasInner2(Text); inner2Text @4 :AliasInner2Text; revFoo @5 :AliasRev.AliasFoo; } } struct TestGenericsWrapper(Foo, Bar) { value @0 :TestGenerics(Foo, Bar); } struct TestGenericsWrapper2 { value @0 :TestGenericsWrapper(Text, TestAllTypes); } interface TestImplicitMethodParams { call @0 [T, U] (foo :T, bar :U) -> TestGenerics(T, U); } interface TestImplicitMethodParamsInGeneric(V) { call @0 [T, U] (foo :T, bar :U) -> TestGenerics(T, U); } struct TestGenericsUnion(Foo, Bar) { # At one point this failed to compile. union { foo @0 :Foo; bar @1 :Bar; } } struct TestUseGenerics $TestGenerics(Text, Data).ann("foo") { basic @0 :TestGenerics(TestAllTypes, TestAnyPointer); inner @1 :TestGenerics(TestAllTypes, TestAnyPointer).Inner; inner2 @2 :TestGenerics(TestAllTypes, TestAnyPointer).Inner2(Text); unspecified @3 :TestGenerics; unspecifiedInner @4 :TestGenerics.Inner2(Text); wrapper @8 :TestGenericsWrapper(TestAllTypes, TestAnyPointer); cap @18 :TestGenerics(TestInterface, Text); genericCap @19 :TestGenerics(TestAllTypes, List(UInt32)).Interface(Data); default @5 :TestGenerics(TestAllTypes, Text) = (foo = (int16Field = 123), rev = (foo = "text", rev = (foo = (int16Field = 321)))); defaultInner @6 :TestGenerics(TestAllTypes, Text).Inner = (foo = (int16Field = 123), bar = "text"); defaultUser @7 :TestUseGenerics = (basic = (foo = (int16Field = 123))); defaultWrapper @9 :TestGenericsWrapper(Text, TestAllTypes) = (value = (foo = "text", rev = (foo = (int16Field = 321)))); defaultWrapper2 @10 :TestGenericsWrapper2 = (value = (value = (foo = "text", rev = (foo = (int16Field = 321))))); aliasFoo @11 :TestGenerics(TestAllTypes, TestAnyPointer).AliasFoo = (int16Field = 123); aliasInner @12 :TestGenerics(TestAllTypes, TestAnyPointer).AliasInner = (foo = (int16Field = 123)); aliasInner2 @13 :TestGenerics(TestAllTypes, TestAnyPointer).AliasInner2 = (innerBound = (foo = (int16Field = 123))); aliasInner2Bind @14 :TestGenerics(TestAllTypes, TestAnyPointer).AliasInner2(List(UInt32)) = (baz = [12, 34], innerBound = (foo = (int16Field = 123))); aliasInner2Text @15 :TestGenerics(TestAllTypes, TestAnyPointer).AliasInner2Text = (baz = "text", innerBound = (foo = (int16Field = 123))); aliasRev @16 :TestGenerics(TestAnyPointer, Text).AliasRev.AliasFoo = "text"; useAliases @17 :TestGenerics(TestAllTypes, List(UInt32)).UseAliases = ( foo = (int16Field = 123), inner = (foo = (int16Field = 123)), inner2 = (innerBound = (foo = (int16Field = 123))), inner2Bind = (baz = "text", innerBound = (foo = (int16Field = 123))), inner2Text = (baz = "text", innerBound = (foo = (int16Field = 123))), revFoo = [12, 34, 56]); } struct TestEmptyStruct {} struct TestConstants { const voidConst :Void = void; const boolConst :Bool = true; const int8Const :Int8 = -123; const int16Const :Int16 = -12345; const int32Const :Int32 = -12345678; const int64Const :Int64 = -123456789012345; const uint8Const :UInt8 = 234; const uint16Const :UInt16 = 45678; const uint32Const :UInt32 = 3456789012; const uint64Const :UInt64 = 12345678901234567890; const float32Const :Float32 = 1234.5; const float64Const :Float64 = -123e45; const textConst :Text = "foo"; const dataConst :Data = "bar"; const structConst :TestAllTypes = ( voidField = void, boolField = true, int8Field = -12, int16Field = 3456, int32Field = -78901234, int64Field = 56789012345678, uInt8Field = 90, uInt16Field = 1234, uInt32Field = 56789012, uInt64Field = 345678901234567890, float32Field = -1.25e-10, float64Field = 345, textField = "baz", dataField = "qux", structField = ( textField = "nested", structField = (textField = "really nested")), enumField = baz, # interfaceField can't have a default voidList = [void, void, void], boolList = [false, true, false, true, true], int8List = [12, -34, -0x80, 0x7f], int16List = [1234, -5678, -0x8000, 0x7fff], int32List = [12345678, -90123456, -0x80000000, 0x7fffffff], int64List = [123456789012345, -678901234567890, -0x8000000000000000, 0x7fffffffffffffff], uInt8List = [12, 34, 0, 0xff], uInt16List = [1234, 5678, 0, 0xffff], uInt32List = [12345678, 90123456, 0, 0xffffffff], uInt64List = [123456789012345, 678901234567890, 0, 0xffffffffffffffff], float32List = [0, 1234567, 1e37, -1e37, 1e-37, -1e-37], float64List = [0, 123456789012345, 1e306, -1e306, 1e-306, -1e-306], textList = ["quux", "corge", "grault"], dataList = ["garply", "waldo", "fred"], structList = [ (textField = "x structlist 1"), (textField = "x structlist 2"), (textField = "x structlist 3")], enumList = [qux, bar, grault] # interfaceList can't have a default ); const enumConst :TestEnum = corge; const voidListConst :List(Void) = [void, void, void, void, void, void]; const boolListConst :List(Bool) = [true, false, false, true]; const int8ListConst :List(Int8) = [111, -111]; const int16ListConst :List(Int16) = [11111, -11111]; const int32ListConst :List(Int32) = [111111111, -111111111]; const int64ListConst :List(Int64) = [1111111111111111111, -1111111111111111111]; const uint8ListConst :List(UInt8) = [111, 222] ; const uint16ListConst :List(UInt16) = [33333, 44444]; const uint32ListConst :List(UInt32) = [3333333333]; const uint64ListConst :List(UInt64) = [11111111111111111111]; const float32ListConst :List(Float32) = [5555.5, inf, -inf, nan]; const float64ListConst :List(Float64) = [7777.75, inf, -inf, nan]; const textListConst :List(Text) = ["plugh", "xyzzy", "thud"]; const dataListConst :List(Data) = ["oops", "exhausted", "rfc3092"]; const structListConst :List(TestAllTypes) = [ (textField = "structlist 1"), (textField = "structlist 2"), (textField = "structlist 3")]; const enumListConst :List(TestEnum) = [foo, garply]; } const globalInt :UInt32 = 12345; const globalText :Text = "foobar"; const globalStruct :TestAllTypes = (int32Field = 54321); const globalPrintableStruct :TestPrintInlineStructs = (someText = "foo"); const derivedConstant :TestAllTypes = ( uInt32Field = .globalInt, textField = TestConstants.textConst, structField = TestConstants.structConst, int16List = TestConstants.int16ListConst, structList = TestConstants.structListConst); const genericConstant :TestGenerics(TestAllTypes, Text) = (foo = (int16Field = 123), rev = (foo = "text", rev = (foo = (int16Field = 321)))); const embeddedData :Data = embed "testdata/packed"; const embeddedText :Text = embed "testdata/short.txt"; const embeddedStruct :TestAllTypes = embed "testdata/binary"; const nonAsciiText :Text = "♫ é ✓"; struct TestAnyPointerConstants { anyKindAsStruct @0 :AnyPointer; anyStructAsStruct @1 :AnyStruct; anyKindAsList @2 :AnyPointer; anyListAsList @3 :AnyList; } const anyPointerConstants :TestAnyPointerConstants = ( anyKindAsStruct = TestConstants.structConst, anyStructAsStruct = TestConstants.structConst, anyKindAsList = TestConstants.int32ListConst, anyListAsList = TestConstants.int32ListConst, ); interface TestInterface { foo @0 (i :UInt32, j :Bool) -> (x :Text); bar @1 () -> (); baz @2 (s: TestAllTypes); } interface TestExtends extends(TestInterface) { qux @0 (); corge @1 TestAllTypes -> (); grault @2 () -> TestAllTypes; } interface TestExtends2 extends(TestExtends) {} interface TestPipeline { getCap @0 (n: UInt32, inCap :TestInterface) -> (s: Text, outBox :Box); testPointers @1 (cap :TestInterface, obj :AnyPointer, list :List(TestInterface)) -> (); getAnyCap @2 (n: UInt32, inCap :Capability) -> (s: Text, outBox :AnyBox); struct Box { cap @0 :TestInterface; } struct AnyBox { cap @0 :Capability; } } interface TestCallOrder { getCallSequence @0 (expected: UInt32) -> (n: UInt32); # First call returns 0, next returns 1, ... # # The input `expected` is ignored but useful for disambiguating debug logs. } interface TestTailCallee { struct TailResult { i @0 :UInt32; t @1 :Text; c @2 :TestCallOrder; } foo @0 (i :Int32, t :Text) -> TailResult; } interface TestTailCaller { foo @0 (i :Int32, callee :TestTailCallee) -> TestTailCallee.TailResult; } interface TestHandle {} interface TestMoreStuff extends(TestCallOrder) { # Catch-all type that contains lots of testing methods. callFoo @0 (cap :TestInterface) -> (s: Text); # Call `cap.foo()`, check the result, and return "bar". callFooWhenResolved @1 (cap :TestInterface) -> (s: Text); # Like callFoo but waits for `cap` to resolve first. neverReturn @2 (cap :TestInterface) -> (capCopy :TestInterface); # Doesn't return. You should cancel it. hold @3 (cap :TestInterface) -> (); # Returns immediately but holds on to the capability. callHeld @4 () -> (s: Text); # Calls the capability previously held using `hold` (and keeps holding it). getHeld @5 () -> (cap :TestInterface); # Returns the capability previously held using `hold` (and keeps holding it). echo @6 (cap :TestCallOrder) -> (cap :TestCallOrder); # Just returns the input cap. expectCancel @7 (cap :TestInterface) -> (); # evalLater()-loops forever, holding `cap`. Must be canceled. methodWithDefaults @8 (a :Text, b :UInt32 = 123, c :Text = "foo") -> (d :Text, e :Text = "bar"); methodWithNullDefault @12 (a :Text, b :TestInterface = null); getHandle @9 () -> (handle :TestHandle); # Get a new handle. Tests have an out-of-band way to check the current number of live handles, so # this can be used to test garbage collection. getNull @10 () -> (nullCap :TestMoreStuff); # Always returns a null capability. getEnormousString @11 () -> (str :Text); # Attempts to return an 100MB string. Should always fail. } interface TestMembrane { makeThing @0 () -> (thing :Thing); callPassThrough @1 (thing :Thing, tailCall :Bool) -> Result; callIntercept @2 (thing :Thing, tailCall :Bool) -> Result; loopback @3 (thing :Thing) -> (thing :Thing); interface Thing { passThrough @0 () -> Result; intercept @1 () -> Result; } struct Result { text @0 :Text; } } struct TestContainMembrane { cap @0 :TestMembrane.Thing; list @1 :List(TestMembrane.Thing); } struct TestTransferCap { list @0 :List(Element); struct Element { text @0 :Text; cap @1 :TestInterface; } } interface TestKeywordMethods { delete @0 (); class @1 (); void @2 (); return @3 (); } interface TestAuthenticatedBootstrap(VatId) { getCallerId @0 () -> (caller :VatId); } struct TestSturdyRef { hostId @0 :TestSturdyRefHostId; objectId @1 :AnyPointer; } struct TestSturdyRefHostId { host @0 :Text; } struct TestSturdyRefObjectId { tag @0 :Tag; enum Tag { testInterface @0; testExtends @1; testPipeline @2; testTailCallee @3; testTailCaller @4; testMoreStuff @5; } } struct TestProvisionId {} struct TestRecipientId {} struct TestThirdPartyCapId {} struct TestJoinResult {} struct TestNameAnnotation $Cxx.name("RenamedStruct") { union { badFieldName @0 :Bool $Cxx.name("goodFieldName"); bar @1 :Int8; } enum BadlyNamedEnum $Cxx.name("RenamedEnum") { foo @0; bar @1; baz @2 $Cxx.name("qux"); } anotherBadFieldName @2 :BadlyNamedEnum $Cxx.name("anotherGoodFieldName"); struct NestedStruct $Cxx.name("RenamedNestedStruct") { badNestedFieldName @0 :Bool $Cxx.name("goodNestedFieldName"); anotherBadNestedFieldName @1 :NestedStruct $Cxx.name("anotherGoodNestedFieldName"); enum DeeplyNestedEnum $Cxx.name("RenamedDeeplyNestedEnum") { quux @0; corge @1; grault @2 $Cxx.name("garply"); } } badlyNamedUnion :union $Cxx.name("renamedUnion") { badlyNamedGroup :group $Cxx.name("renamedGroup") { foo @3 :Void; bar @4 :Void; } baz @5 :NestedStruct $Cxx.name("qux"); } } interface TestNameAnnotationInterface $Cxx.name("RenamedInterface") { badlyNamedMethod @0 (badlyNamedParam :UInt8 $Cxx.name("renamedParam")) $Cxx.name("renamedMethod"); }