views:

293

answers:

1

Hi everyone, i have situation like this:

class IData 
{
  virtual void get() = 0;
  virtual void set() = 0;
}
BOOST_ASSUME_IS_ABSTRACT(IData)
BOOST_EXPORT_CLASS(IData)

template<typename T>
class ConcreteData : public IData
{
public:

protected:
 template<typename Archive>
 void serialize(Archive& ar, const unsigned version)
 {
   ar & data;
 }
private:
 std::vector<T> mData;
}
BOOST_EXPORT_CLASS(ConcreteData<float>)
BOOST_EXPORT_CLASS(ConcreteData<int>)
BOOST_EXPORT_CLASS(ConcreteData<double>)

i want to serialize and deserialize "IData" instances via boost serialization but it seems not working. Has anyone done this before or do you have any suggestions.by the way i am usin VS 2005.

+2  A: 

Try using BOOST_CLASS_EXPORT_GUID instead:

BOOST_CLASS_EXPORT_GUID(ConcreteData<float>, "ConcreteData<float>")
BOOST_CLASS_EXPORT_GUID(ConcreteData<int>, "ConcreteData<int>")
Mike
thanks that worked.
Qubeuc