Questions tagged [capnproto]

Cap'n Proto is a zero-copy data interchange format described by a schema language not unlike Protobuf, and an associated capability-based RPC system.

Cap'n Proto is a zero-copy serialization format described by a schema language not unlike Protobuf and an associated capability-based RPC system.

99 questions
0
votes
1 answer

How does one properly close a captain proto struct to avoid memory leaks?

I think I have memory issues and I want to close the file I've read using pycapnp. How is the best way to do this? Is doing: def __getitem__(self, idx: int) -> DagNode: # gets the file idx for the value we want file_idx =…
Charlie Parker
  • 5,884
  • 57
  • 198
  • 323
0
votes
1 answer

Call to `thisCap()` segfaults

I am playing with the calculator-server.c++ sample, where I try to extract thisCap() to have a capability to the server from outside. Because thisCap() is protected, I wrote my own public getCapability(): class CalculatorImpl final: public…
JonasVautherin
  • 7,297
  • 6
  • 49
  • 95
0
votes
1 answer

VS2019: Compiling Cap'nProto Crashes C++ Compiler

So, the situation is that due to some unforeseen consequences I need to build Cap'nProto (https://capnproto.org/) for windows using Visual Studio 2019 (latest release as far as I know, 16.7.3). As you can see from the screenshot below, the compiler…
Ferenc Deak
  • 34,348
  • 17
  • 99
  • 167
0
votes
1 answer

Python how to convert capnproto to json?

I have some legacy with capnp binary data in Postgress database, i want to convert it to jsonb Are there any ready solutions in python to convert data from capnp to json ?
Ryabchenko Alexander
  • 10,057
  • 7
  • 56
  • 88
0
votes
1 answer

Python Capn Proto: Restorers?

Reading through the Cap'n Proto RPC docs, if you need object references to persist across multiple connections, you need to write restorers. On the client side, it's pretty clear how to get the write object out of it (although the lack of type info…
AstraLuma
  • 609
  • 5
  • 16
0
votes
1 answer

Capnp: Move to previous position in BufferedInputStreamWrapper

I have a binary file with multiple Capnp messages which I want to read. Reading sequentially works well, but I have the use-case, that I want to jump to a previously known position. The data sequential images with metadata including there timestamp.…
Jodo
  • 4,515
  • 6
  • 38
  • 50
0
votes
1 answer

Is it possible to extend a tagged union with more variants in Cap'n proto while being binary-compatible with any old data?

I'm looking into protocol schema languages, and it seems like Cap'n'proto will suit my needs, but there's one critical feature I need which I cannot find in the docs: Let's say I have this tagged union with two struct members in C-like…
Filip Haglund
  • 13,919
  • 13
  • 64
  • 113
0
votes
2 answers

Cap’n Proto C++ serialize to char array (or any byte array)

My goal is to send serialized data through MPI. I have done this with ProtoBuf but I would like to try to use a faster serialize method such as Cap’n Proto (I will try others as well but here I am stuck). With ProtoBuf I use the function…
Rickard Johansson
  • 363
  • 1
  • 2
  • 7
0
votes
1 answer

Cap'n Proto Generics How To?

For the life of my I can't figure out how to get this to work. This is the structure //transaction.capnp using V = import "values.capnp"; struct TransactionPayload { kwargs @6 :V.Map(Text, V.Value); } //values.capnp struct Map(Key, Value) { …
0
votes
2 answers

how can I get a MessageReader from protobuf.ByteString in java

In Java Client I get a com.google.protobuf.ByteString capn_object_bytes = response.getCapnObject(); from C++ Server, and I want read the Capn Object from protobuf.ByteString @Kenton Varda
whutbd
  • 3
  • 1
0
votes
1 answer

Add content of a vector into a Capnproto map object

As answered in this question: Note that an individual List value in a Cap'n Proto structure has a limit of 2^29-1 elements Due to this limitation for a single list, I'm trying to split one list that contains more than this amount of items into a…
woz
  • 544
  • 6
  • 22
0
votes
1 answer

Cap'n Proto - How to compile the generated C++ file

I am new to Cap'n Proto and I was trying to compile the calculator example found here: https://github.com/capnproto/capnproto/blob/master/c%2B%2B/samples/calculator.capnp I used this command capnp compile -oc++ calculator.capnp to generate the…
LeenA
  • 39
  • 5
0
votes
1 answer

Reading/writing config struct in Cap'nProto

I have a C++ embedded app and I would like to create a web interface to configure it. My plan is to describe the configuration structs in Cap'nProto then use the generated code on C++ and Javascript side. A config scenario would be the following:…
Broothy
  • 659
  • 5
  • 20
0
votes
1 answer

CapnProto encodes string twice

I have a simple struct containing some stuff, and also a Text field. I was looking at the result of encoding this data using Capnp, and for some reason the value of the text field appears in the encoded output twice! That doesn't seem very efficient…
Timmmm
  • 88,195
  • 71
  • 364
  • 509
0
votes
1 answer

How to write a builder object to an output stream object in Cap'n Proto in C++ instead of a file?

I am creating a CAP'N PROTO builder object like this: ::capnp::MallocMessageBuilder message; InjectorRequestMsg::Builder injectorRequestMsg = message.initRoot(); /Then setting all data members of injectorRequestMsg/ After…
Biswojit
  • 1
  • 3