capnproto

How to set a string item of a list in capnproto C++ generated code?

雨燕双飞 提交于 2020-01-24 21:39:05
问题 I have capnproto definition like this: struct School { name @0 :Text; address @1 :Address; foundation @2 :Date; emailAddresses @3 :List(Text); } I would like to set the emailAddresses field in a builder with code similar to this (but this won't compile): static School::Builder random_School() { capnp::MallocMessageBuilder msg; School::Builder result = msg.initRoot<School>(); result.setName(rand_str(36)); result.setAddress(random_Address()); result.setFoundation(random_Date()); result

Stream while serializing with Cap'n'Proto

孤街浪徒 提交于 2019-12-23 08:51:03
问题 Consider a Cap'n'Proto schema like this: struct Document { header @0 : Header; records @1 :List(Record); // usually large number of records. footer @2 :Footer; } struct Header { numberOfRecords : UInt32; /* some fields */ }; struct Footer { /* some fields */ }; struct Record { type : UInt32; desc : Text; /* some more fields, relatively large in total */ } Now I want to serialize (i.e. build) a document instance and stream it to a remote destination. Since the document is usually very large I

error while loading shared libraries: libcapnp-0.5.3.so

淺唱寂寞╮ 提交于 2019-12-13 07:52:51
问题 I think this is a generic problem not specifically related to Cap'n Proto. My project's build succeeds but on run I get: error while loading shared libraries: libcapnp-0.5.3.so: cannot open shared object file: No such file or directory Maybe I am missing something in CMake? set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -lcapnp -lkj") I verified libcapnp-0.5.3.so exists in /usr/local/lib I also tried adding: set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -L/usr/local/lib/libcapnp-0.5.3.so") 回答1: /usr/local