requirement 6: "Serialization of STL containers and other commonly used templates."
Because I was curious I looked in the source for you, it seems to basically resolve into a foreach item in container: archive << item. Its a nonintrustive serializing function which means its using the public (well-defined) interface to serialize a collection's items. I think you're fine serializing to and from different STL implementations using their default support.
If doesn't work for some reason you can just define your own non-intrusive serializer, something like
template<class Archive>void serialize(Archive & ar, std::list<int> & list, const unsigned int version){BOOST_FOREACH(int item, list){ar & item;}}
Quote:I'm also not sure which object should be serialized (some objects are easy to convert to pure C)
If its easy to convert the object to pure C and reconstruct, it will be trivial to write a serialize() method which does it transparently.
Quote:or if there's an elegant way to provide some sort of parameter framework (so that all of my parameters don't just end up being void pointers).
As much as I hate param structs in lieu of function binders I don't see a way around them here. If you are worried about the structs being laid out identically from different compilers, serialize those too.
void dll_fn(void* serialized_params, long size){ ParamStruct params = UnpackParams(serialized_params, size); std::cout << params.arg1 << params.arg2;}ParamStruct UnpackParams(void* serialized_params, long size){ std::string serialized_params_str(serialized_params, serialized_params+size); std::stringstream inbuffer(std::stringstream::in); inbuffer.str(serialized_params_str); boost::archive::text_iarchive inarchive(inbuffer); ParamStruct params; inarchive >> params; return params;}struct UnpackParams{ int arg1; std::string arg2; friend class boost::serialization::access;private: template<class Archive> void serialize(Archive& ar, const unsigned int version) { ar & arg1; ar & arg2; }};
I'm sure a better programmer than me can make that code not suck. As you can see I just did some stuff with b::s so its still fresh :)