|
Boost : |
From: Hans Larsen (hans_at_[hidden])
Date: 2007-04-13 14:36:00
Is there a marshaling library in boost and is there an interest in
such a functionality? Is the serializing library any use to marshall
calls?
I've not seen any mails concerning marshaling recently, though I
might have missed one.
Thanks,
Hans
I'm thinking something along the lines of the following. Although it
may not be possible, I think it is (maybe the function registry is
not necessary).
int func( int i, int j )
{
using namespace std;
cout << "i: " << i << " j:" << k << endl;
return i + j;
}
int main()
{
using m = boost::marshall;
using std;
int funcid = 1;
m::register_function( funcid, func ); // Using same principles as in
boost::function for type safety.
m::call x(funcid, 1, 2);
string str = x.serialize();
m::call y( str );
try {
cout << y() << endl;
} catch( m::invalid_function x ) {
cout << x.what() << endl;
}
return 0;
}
// ------
// Should output:
// i: 1 j: 2
// 3
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk