ignite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Branko ─îibej <br...@apache.org>
Subject Re: C++ marshalling.
Date Tue, 26 May 2015 21:14:34 GMT
On 26.05.2015 23:04, Vladimir Ozerov wrote:
> Brane,
> There are two key features we are planning to address with platforms
> integration efforts apart of trivial cache/compue APIs;
> 1) Portability, so that objects can freely travel between Java, C++, etc..
> Also portability is mandatory to support queries because our query engine
> is tightly coupled to Java.
> 2) Zero changes to existing models in user apps, so that Ignite could be
> integrated into legacy apps with minimal efforts. On Java side our
> OptimizedMarshaller is already in a very good shape to handle this. This is
> why I would prefer to develop marshaller from scratch instead of using
> existing solutions.

Hmmm ... so, in this case I really see only two possible approaches:

 1. Use an IDL-like approach, where users would describe their C++
    types, e.g., in Java, and you could use the existing introspection
    code to generate a specialized C++ marshaller.
 2. Use a C++ parser (e.g., from LLVM) to generate a machine-readable
    structure description, and generate the marshalling code from that.

Option 2 is by far the most user-friendly, because users could just
point the generator to their existing class definitions. But it's
probably a huge amount of work.

Both approaches have one nasty problem: In C++, unlike in Java with
reflection, there's no universal way to construct an object without
using the available constructors, nor is there a universal way to set
values to class attributes. It's likely that users would have to modify
their existing classes by adding marshaller-friendly constructors or
factory methods (where such don't yet exist).

-- Brane

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message