views:

89

answers:

2

I am looking for an IDL-like (or whatever) translator which turns a DOM- or JSON-like document definition into classes which

  • are accessible from both C++ and Python, within the same application
  • expose document properties as ints, floats, strings, binary blobs and compounds: array, string dict (both nestable) (basically the JSON type feature set)
  • allow changes to be tracked to refresh views of an editing UI
  • provide a change history to enable undo/redo operations
  • can be serialized to and from JSON (can also be some kind of binary format)
  • allow to keep large data chunks on disk, with parts only loaded on demand
  • provide non-blocking thread-safe read/write access to exchange data with realtime threads
  • allow multiple editors in different processes (or even on different machines) to view and modify the document

The thing that comes closest so far is the Blender 2.5 DNA/RNA system, but it's not available as a separate library, and badly documented.

I'm most of all trying to make sure that such a lib does not exist yet, so I know my time is not wasted when I start to design and write such a thing. It's supposed to provide a great foundation to write editing UI components.

A: 

SWIG doesn't meet all your requirements, but does make interfacing c++ <-> python a lot easier.

neoneye
I'm using boost.python to interface, mostly because it's the only wrapper that successfully wraps almost all C++ code. SWIG needs way too much tweaking to be comfortable.
paniq
It's been ages last time I used SWIG and that was with ruby. I wasn't aware of boost.python. Neat
neoneye
+1  A: 

ICE is the closest product I could think of. I don't know if you can do serialization to disk with ICE, but I can't think of a reason why it wouldn't. Problem is it costs $$$. I haven't personally negotiated a license with them, but ICE is the biggest player I know of in this domain.

Then you have Pyro for python which is Distributed Objects only.

Distributed Objects in Objective-C (N/A for iPhone/iPad Dev, which sucks IMHO)

There are some C++ distributed objects libraries but they're mostly dead and unusable (CORBA comes to mind).

I can tell you that there would be a lot of demand for this type of technology. I've been delving into some serialization and remote object stuff since off-the-shelf solutions can be very expensive.

As for open-source frameworks to help you develop in-house, I recommend boost::asio's strands for async thread-safe read/write and boost::serialization for serialization. I'm not terribly well-read in JSON tech but this looks like an interesting read.

I wish something freely available already existed for this networking/serialization glue that so many projects could benefit from.

manifest
Haven't had a close look at ICE yet but it seems to be GPL, which is just fine for me. Pyro is a nice idea, but solves only one problem. Thanks for the other suggestions. I'm using jsoncpp already, will have a look at boost.asio.
paniq
I looked at ICE, and it seems it's also merely solving the networking issue, which has the lowest priority on my list.
paniq
A slight dig reveals ICE can "Freeze" objects to a database using Evictors:http://www.zeroc.com/doc/Ice-3.4.1/manual/Freeze.40.3.html#142337
manifest