Hi Farshid,

Unfortunately the InputStream doesn't have a good mechanism to handle
unsupported class in binary files without the version control macro
UPDATE_TO_VERSION (for IVE files, version control is supported
internally in the plugin source code). Text files can ignore unknown
class blocks because the advanceToCurrentEndBracket() method makes it
possible to jump to next block. But for binary files, there are no
straightforward flags to mark the beginning or end of a wrapper class'
data. So I think adding UPDATE_TO_VERSION macro in your serializers
would be the only way to keep compatibility at present.

Wang Rui


2012/10/4 Farshid Lashkari <fla...@gmail.com>:
> Hi,
>
> I recently added serialization support for a custom osg::Object derived
> class in my application. I saved the object to a osgt and osgb file and
> attempted to load it into an older version of my application, which didn't
> have serialization support for my custom object yet.
>
> Loading the osgt file gives me the following warning message:
>
> InputStream::readObject(): Unsupported wrapper class MyLibrary::MyObject
>
> This is expected. However, when I attempt to load the osgb file I get the
> following output then my application crashes:
>
> InputStream::readObject(): Unsupported wrapper class MyLibrary::MyObject
> InputStream::readObject(): Unsupported wrapper class
>
> Before I spend time looking into this, I was wondering if it is expected for
> the binary loader to crash on unsupported objects? I'm working with osg
> 2.9.12, if that makes a difference.
>
> Cheers,
> Farshid
>
>
> _______________________________________________
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to