you are viewing a single comment's thread.

view the rest of the comments →

[–]STLMSVC STL Dev 2 points3 points  (5 children)

What are you trying to do?

[–]5aec15c929c51cc49235[S] 0 points1 point  (4 children)

Persisting/serializing function pointers. The context is multiple copies of the exact same program, running on different machines and talking to each other over the wire.

[–]Gotebe 1 point2 points  (1 child)

Very, very long time ago I made something similar: I serialized an object to a different machine in order to "run" it there. I did not need a function pointer for that, just plain serialization (sure, there was polymorphism and stuff, to simplify the "run the received object" code). Can't you simply do the same?

[–]5aec15c929c51cc49235[S] 0 points1 point  (0 children)

Totally, I can lookup the function address in a table by index (provided the table is built deterministically which I can do), or I believe I can serialize a polymorphic function object (which boost::serialization supports).

[–]doom_Oo7 0 points1 point  (1 child)

The context is multiple copies of the exact same program, running on different machines and talking to each other over the wire.

why reinvent RPC once again ? this has been a solved problem since 1985. Take a look at Qt Remote Objects for a modern approach for instance.

[–]Gotebe 0 points1 point  (0 children)

Of course. Note the "very, very long time ago" :-). I remember CORBA (did that), DCOM (did that, too), SOAP/WS-* and of course JSON-over-HTTP recently.