Boost C++ Libraries: Ticket #1941: polymorphic archive interface doesn't match other archive interfaces https://svn.boost.org/trac10/ticket/1941 <p> I can't invoke get_library_version() on a polymorphic_binary_iarchive because it's private, whereas it's public in a binary_archive. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/1941 Trac 1.4.3 Robert Ramey Sun, 08 Jun 2008 04:37:51 GMT status changed https://svn.boost.org/trac10/ticket/1941#comment:1 https://svn.boost.org/trac10/ticket/1941#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> <p> I'm looking at this and I don't see anything obvious. Send me a small example. </p> <p> RObert Ramey </p> Ticket anonymous Sun, 08 Jun 2008 05:08:16 GMT <link>https://svn.boost.org/trac10/ticket/1941#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1941#comment:2</guid> <description> <p> Try calling get_library_version() on a polymorphic_xml_iarchive instance. </p> <p> The problem is that polymorphic_iarchive_dispatch has the get_library_version() method declared as private. But the same method is public on other archives, like a binary_iarchive. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Robert Ramey</dc:creator> <pubDate>Tue, 10 Jun 2008 05:33:58 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/1941#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1941#comment:3</guid> <description> <p> get_library_version() is public in the base class. Since its virtual function it dispatches through the vtable to the derived class function with the same name. The one in the derived class may be - and if fact should be - private. This prevents users from calling intothe dispatch directly and there by breaking the polymorphic design. </p> <p> You shouldn't even be including polymorphic_iarchive_dispatch.hpp in your code - either directly or indirectly. Check out the manual and examples. </p> <p> you can send me a small example which illustrates the problem and I'll look at it. </p> <p> RObert Ramey </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Robert Ramey</dc:creator> <pubDate>Tue, 10 Jun 2008 20:43:39 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/1941#comment:4 https://svn.boost.org/trac10/ticket/1941#comment:4 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">invalid</span> </li> </ul> Ticket anonymous Wed, 18 Jun 2008 03:16:51 GMT <link>https://svn.boost.org/trac10/ticket/1941#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1941#comment:5</guid> <description> <p> Here's the code that was causing me the grief: </p> <blockquote> <p> <em> Create the target archive object, as input boost::archive::polymorphic_binary_iarchive targetData(std::ifstream(sourcePath.external_directory_string().c_str())); </em></p> </blockquote> <blockquote> <p> <em> If the versioning implies that an update is not required if(targetData.get_library_version() == mTypeVersions[<a class="missing wiki">GetType</a>(asset)]) { </em></p> <blockquote> <p> <em> Load from the target </em> ... </p> </blockquote> <p> } </p> </blockquote> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Wed, 25 Jun 2008 02:35:51 GMT</pubDate> <title>status changed; resolution deleted https://svn.boost.org/trac10/ticket/1941#comment:6 https://svn.boost.org/trac10/ticket/1941#comment:6 <ul> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">invalid</span> </li> </ul> <p> Re-opening the comment so that the sample problem code provided can be looked at </p> Ticket Robert Ramey Sun, 29 Jun 2008 15:23:36 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/1941#comment:7 https://svn.boost.org/trac10/ticket/1941#comment:7 <ul> <li><strong>status</strong> <span class="trac-field-old">reopened</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> The whole point of the polymorphic archive is to permit usage of a common interface without depending on the specific one. So really one is expected to use the base class "accessors" </p> <p> try the following: </p> <pre class="wiki"> // Create the target archive object, as input boost::archive::polymorphic_iarchive &amp;targetData = boost::archive::polymorphic_binary_iarchive targetData( std::ifstream(sourcePath.external_directory_string().c_str()) ); // If the versioning implies that an update is not required if(targetData.get_library_version() == mTypeVersions[GetType?(asset)]) { // Load from the target // ... } </pre><p> If that fails let me know. </p> <p> Robert Ramey </p> Ticket Mon, 03 Nov 2008 14:20:34 GMT milestone deleted https://svn.boost.org/trac10/ticket/1941#comment:8 https://svn.boost.org/trac10/ticket/1941#comment:8 <ul> <li><strong>milestone</strong> <span class="trac-field-deleted">Boost 1.35.1</span> </li> </ul> <p> Milestone Boost 1.35.1 deleted </p> Ticket