Boost serialization and Irrlicht

Post your questions, suggestions and experiences regarding game design, integration of external libraries here. For irrEdit, irrXML and irrKlang, see the
ambiera forums
Post Reply
Tatyana L
Posts: 1
Joined: Wed Sep 12, 2012 2:04 pm

Boost serialization and Irrlicht

Post by Tatyana L »

We're making a 3D game in C++ with Irrlicht and trying to save the world. Boost serialization seemed to be a good way, by there's a problem with external libraries like Irrlicht.

Code: Select all

 
namespace game
{
    class IrrNode : public game::Node<irr::scene::ISceneNode>
    {
        public:
            explicit IrrNode(const double &pos);
            virtual ~IrrNode();
 
        public:
            template<typename AR>
            void serialize( AR & ar, const unsigned int version )
            {
                ar & boost::serialization::base_object<Node<ISceneNode> >(*this);
            }
 
    };
}
 
namespace boost
{
    namespace serialization
    {
        using ::game::IrrNode;
 
        template<class AR>
        void load_construct_data(AR &, IrrNode* t, const unsigned int)
        {
            ::new(t) IrrNode(0.0);
        }
    }
}
BOOST_CLASS_EXPORT(game::IrrNode)
 
Node is a simple template class where irr::scene::ISceneNode is T.


This code gives the following error:
Error 42 error C2039: 'serialize' : is not a member of 'irr::scene::ISceneNode' C:\...\boost_1_48_0\boost\serialization\access.hpp 118
Help?!
chronologicaldot
Competition winner
Posts: 685
Joined: Mon Sep 10, 2012 8:51 am

Re: Boost serialization and Irrlicht

Post by chronologicaldot »

I don't know if you got an answer elsewhere (such as Advanced Q&A) but serialize is not a member of ISceneNode. However, serializeAttributes() is, but it requires parameters of the following types (in order):
irr::io::IAttributes*
irr::io::SAttributeReadWriteOptions* (you don't need to provide this)

I don't know how boost works, but I imagine it's trying to call the function "serialize()", which doesn't exist for anything that inherits ISceneNode (or anything else in the irrlicht engine).
Post Reply