Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r50622 - trunk/libs/serialization/test
From: ramey_at_[hidden]
Date: 2009-01-16 01:41:54


Author: ramey
Date: 2009-01-16 01:41:52 EST (Fri, 16 Jan 2009)
New Revision: 50622
URL: http://svn.boost.org/trac/boost/changeset/50622

Log:
Divided test_no_rtti into separate compilation units
Added:
   trunk/libs/serialization/test/polymorphic_base.cpp (contents, props changed)
   trunk/libs/serialization/test/polymorphic_base.hpp (contents, props changed)
   trunk/libs/serialization/test/polymorphic_derived1.cpp (contents, props changed)
   trunk/libs/serialization/test/polymorphic_derived1.hpp (contents, props changed)
   trunk/libs/serialization/test/polymorphic_derived2.cpp (contents, props changed)
   trunk/libs/serialization/test/polymorphic_derived2.hpp (contents, props changed)
Text files modified:
   trunk/libs/serialization/test/Jamfile.v2 | 4 +
   trunk/libs/serialization/test/test_no_rtti.cpp | 76 +--------------------------------------
   2 files changed, 6 insertions(+), 74 deletions(-)

Modified: trunk/libs/serialization/test/Jamfile.v2
==============================================================================
--- trunk/libs/serialization/test/Jamfile.v2 (original)
+++ trunk/libs/serialization/test/Jamfile.v2 2009-01-16 01:41:52 EST (Fri, 16 Jan 2009)
@@ -47,7 +47,9 @@
      [ test-bsl-run_files test_map : A ]
      [ test-bsl-run_files test_mi ]
      [ test-bsl-run_files test_multiple_ptrs : A ]
- [ test-bsl-run_files test_no_rtti ]
+ [ test-bsl-run_files test_no_rtti
+ : polymorphic_base polymorphic_derived1 polymorphic_derived2
+ ]
      [ test-bsl-run_files test_non_intrusive ]
      [ test-bsl-run_files test_non_default_ctor ]
      [ test-bsl-run_files test_non_default_ctor2 ]

Added: trunk/libs/serialization/test/polymorphic_base.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/serialization/test/polymorphic_base.cpp 2009-01-16 01:41:52 EST (Fri, 16 Jan 2009)
@@ -0,0 +1,14 @@
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// polymorphic_base.cpp
+
+// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+#include <boost/serialization/export.hpp>
+#include "polymorphic_base.hpp"
+
+BOOST_CLASS_EXPORT(polymorphic_base)

Added: trunk/libs/serialization/test/polymorphic_base.hpp
==============================================================================
--- (empty file)
+++ trunk/libs/serialization/test/polymorphic_base.hpp 2009-01-16 01:41:52 EST (Fri, 16 Jan 2009)
@@ -0,0 +1,41 @@
+#ifndef POLYMORPHIC_BASE_HPP
+#define POLYMORPHIC_BASE_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// polymorphic_base.hpp simple class test
+
+// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+#include <boost/serialization/access.hpp>
+#include <boost/serialization/type_info_implementation.hpp>
+#include <boost/serialization/extended_type_info_no_rtti.hpp>
+
+class polymorphic_base
+{
+ friend class boost::serialization::access;
+ template<class Archive>
+ void serialize(Archive & /* ar */, const unsigned int /* file_version */){
+ }
+public:
+ virtual const char * get_key() const = 0;
+ virtual ~polymorphic_base(){};
+};
+
+BOOST_SERIALIZATION_ASSUME_ABSTRACT(polymorphic_base)
+
+BOOST_CLASS_TYPE_INFO(
+ polymorphic_base,
+ extended_type_info_no_rtti<polymorphic_base>
+)
+
+#endif // POLYMORPHIC_BASE_HPP

Added: trunk/libs/serialization/test/polymorphic_derived1.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/serialization/test/polymorphic_derived1.cpp 2009-01-16 01:41:52 EST (Fri, 16 Jan 2009)
@@ -0,0 +1,24 @@
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// polymorphic_derived1.cpp
+
+// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+#include <boost/serialization/type_info_implementation.hpp>
+#include <boost/serialization/extended_type_info_no_rtti.hpp>
+#include <boost/serialization/export.hpp>
+
+#include "polymorphic_derived1.hpp"
+
+BOOST_CLASS_EXPORT(polymorphic_derived1)
+
+const char * polymorphic_derived1::get_key() const {
+ return
+ boost::serialization::type_info_implementation<
+ polymorphic_derived1
+ >::type::get_const_instance().get_key();
+}

Added: trunk/libs/serialization/test/polymorphic_derived1.hpp
==============================================================================
--- (empty file)
+++ trunk/libs/serialization/test/polymorphic_derived1.hpp 2009-01-16 01:41:52 EST (Fri, 16 Jan 2009)
@@ -0,0 +1,42 @@
+#ifndef POLYMORPHIC_DERIVED1_HPP
+#define POLYMORPHIC_DERIVED1_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// polymorphic_derived1.hpp simple class test
+
+// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+#include <boost/serialization/access.hpp>
+#include <boost/serialization/nvp.hpp>
+#include <boost/serialization/base_object.hpp>
+#include <boost/serialization/type_info_implementation.hpp>
+#include <boost/serialization/extended_type_info_no_rtti.hpp>
+
+#include "polymorphic_base.hpp"
+class polymorphic_derived1 : public polymorphic_base
+{
+ friend class boost::serialization::access;
+ template<class Archive>
+ void serialize(Archive &ar, const unsigned int /* file_version */){
+ ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(polymorphic_base);
+ }
+public:
+ virtual const char * get_key() const ;
+};
+
+BOOST_CLASS_TYPE_INFO(
+ polymorphic_derived1,
+ extended_type_info_no_rtti<polymorphic_derived1>
+)
+
+#endif // POLYMORPHIC_DERIVED1_HPP

Added: trunk/libs/serialization/test/polymorphic_derived2.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/serialization/test/polymorphic_derived2.cpp 2009-01-16 01:41:52 EST (Fri, 16 Jan 2009)
@@ -0,0 +1,27 @@
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// polymorphic_derived2.cpp
+
+// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+#include <boost/serialization/type_info_implementation.hpp>
+#include <boost/serialization/extended_type_info_no_rtti.hpp>
+#include <boost/serialization/export.hpp>
+
+#include "polymorphic_derived2.hpp"
+
+// note: types which use ...no_rtti MUST be exported
+BOOST_CLASS_EXPORT(polymorphic_derived2)
+
+const char * polymorphic_derived2::get_key() const {
+ // use the exported key as the identifier
+ return
+ boost::serialization::type_info_implementation<
+ polymorphic_derived2
+ >::type::get_const_instance().get_key();
+}
+

Added: trunk/libs/serialization/test/polymorphic_derived2.hpp
==============================================================================
--- (empty file)
+++ trunk/libs/serialization/test/polymorphic_derived2.hpp 2009-01-16 01:41:52 EST (Fri, 16 Jan 2009)
@@ -0,0 +1,45 @@
+#ifndef POLYMORPHIC_DERIVED2_HPP
+#define POLYMORPHIC_DERIVED2_HPP
+
+// MS compatible compilers support #pragma once
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// polymorphic_derived1.hpp simple class test
+
+// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+#include <boost/serialization/access.hpp>
+#include <boost/serialization/nvp.hpp>
+#include <boost/serialization/base_object.hpp>
+#include <boost/serialization/type_info_implementation.hpp>
+#include <boost/serialization/extended_type_info_typeid.hpp>
+
+#include "polymorphic_base.hpp"
+
+class polymorphic_derived2 : public polymorphic_base
+{
+ friend class boost::serialization::access;
+ template<class Archive>
+ void serialize(Archive &ar, const unsigned int /* file_version */){
+ ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(polymorphic_base);
+ }
+public:
+ virtual const char * get_key() const ;
+};
+
+// note the mixing of type_info systems is supported.
+BOOST_CLASS_TYPE_INFO(
+ polymorphic_derived2,
+ boost::serialization::extended_type_info_typeid<polymorphic_derived2>
+)
+
+#endif // POLYMORPHIC_DERIVED2_HPP
+

Modified: trunk/libs/serialization/test/test_no_rtti.cpp
==============================================================================
--- trunk/libs/serialization/test/test_no_rtti.cpp (original)
+++ trunk/libs/serialization/test/test_no_rtti.cpp 2009-01-16 01:41:52 EST (Fri, 16 Jan 2009)
@@ -33,82 +33,12 @@
 #include <boost/preprocessor/stringize.hpp>
 #include BOOST_PP_STRINGIZE(BOOST_ARCHIVE_TEST)
 
-#include <boost/serialization/nvp.hpp>
-#include <boost/serialization/base_object.hpp>
-#include <boost/serialization/export.hpp>
 #include <boost/serialization/type_info_implementation.hpp>
 #include <boost/serialization/extended_type_info_no_rtti.hpp>
 
-class polymorphic_base
-{
- friend class boost::serialization::access;
- template<class Archive>
- void serialize(Archive & /* ar */, const unsigned int /* file_version */){
- }
-public:
- virtual const char * get_key() const = 0;
- virtual ~polymorphic_base(){};
-};
-
-BOOST_SERIALIZATION_ASSUME_ABSTRACT(polymorphic_base)
-
-BOOST_CLASS_TYPE_INFO(
- polymorphic_base,
- extended_type_info_no_rtti<polymorphic_base>
-)
-// note: types which use ...no_rtti MUST be exported
-BOOST_CLASS_EXPORT(polymorphic_base)
-
-class polymorphic_derived1 : public polymorphic_base
-{
- friend class boost::serialization::access;
- template<class Archive>
- void serialize(Archive &ar, const unsigned int /* file_version */){
- ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(polymorphic_base);
- }
-public:
- virtual const char * get_key() const ;
-};
-
-BOOST_CLASS_TYPE_INFO(
- polymorphic_derived1,
- extended_type_info_no_rtti<polymorphic_derived1>
-)
-BOOST_CLASS_EXPORT(polymorphic_derived1)
-
-const char * polymorphic_derived1::get_key() const {
- return
- boost::serialization::type_info_implementation<
- polymorphic_derived1
- >::type::get_const_instance().get_key();
-}
-
-class polymorphic_derived2 : public polymorphic_base
-{
- friend class boost::serialization::access;
- template<class Archive>
- void serialize(Archive &ar, const unsigned int /* file_version */){
- ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(polymorphic_base);
- }
-public:
- virtual const char * get_key() const ;
-};
-
-// note the mixing of type_info systems is supported.
-BOOST_CLASS_TYPE_INFO(
- polymorphic_derived2,
- boost::serialization::extended_type_info_typeid<polymorphic_derived2>
-)
-
-BOOST_CLASS_EXPORT(polymorphic_derived2)
-
-const char * polymorphic_derived2::get_key() const {
- // use the exported key as the identifier
- return
- boost::serialization::type_info_implementation<
- polymorphic_derived2
- >::type::get_const_instance().get_key();
-}
+#include "polymorphic_base.hpp"
+#include "polymorphic_derived1.hpp"
+#include "polymorphic_derived2.hpp"
 
 // save derived polymorphic class
 void save_derived(const char *testfile)


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk