The tables are used to support the "schema" and "dynamic" APIs (aka
"reflection"). These APIs are useful for a bunch of things, and in
particular they are used to implement text stringification of messages
(e.g. for debugging) and JSON conversion.

I think some code is also generated in the .c++ file for RPC interfaces.

If you don't get a linker error when you omit the .c++ file, then you must
not be using these features. It's fine to omit the file if you don't see
any errors from doing so. Note, though, that you might find you suddenly
need the .c++ file in the future after some code change, or a future
version of Cap'n Proto might start to require it. I'd generally recommend
making it part of your build, but configuring your linker to drop unused
objects, rather than intentionally omit it.

-Kenton

On Tue, May 4, 2021 at 12:28 PM Nogueira <tulioclnogue...@gmail.com> wrote:

> Hi,
>
> I have been using capnproto to perform serialization and de-serialization
> using mmap. Works pretty well and it's fast!
> I noticed I'm able to compile and use code without the generated .c++
> file, which seems to have some hardcoded tables in it.
> What exactly is the c++ file used for? Am I encountering any problem if I
> use the header but not the c++ file?
>
> Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Cap'n Proto" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to capnproto+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/capnproto/d522df33-da2e-4372-bcb6-a3e760b6871fn%40googlegroups.com
> <https://groups.google.com/d/msgid/capnproto/d522df33-da2e-4372-bcb6-a3e760b6871fn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Cap'n Proto" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to capnproto+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/capnproto/CAJouXQ%3D7i_3cnQKTHM8S%3Dk_c_pFg7S_sUh7ZBGVQ07CP2QnaHg%40mail.gmail.com.

Reply via email to