15 Sep
2009
15 Sep
'09
9:03 p.m.
"Robert Ramey"
Why don't you just derived all the functors from a common base and serialize a base class pointer? You wouldn't have to do anything special since polymorphic pointers are already addressed.
This was just a constraint of design; a hierarchy could not be imposed on the function objects. Further, they could not be serialized themselves because their construction relied on data only available at the other socket side, hence the factory approach. Yes there are other approaches, but it panned out the boost::function way and has been quite flexible.