From: bangerth Date: Mon, 27 Sep 2010 20:54:16 +0000 (+0000) Subject: Add. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1664fc65d990e1ce1c148f09c86cf18cc0dc9073;p=dealii-svn.git Add. git-svn-id: https://svn.dealii.org/trunk@22179 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/contrib/boost/libs/serialization/build/Jamfile.v2 b/deal.II/contrib/boost/libs/serialization/build/Jamfile.v2 new file mode 100644 index 0000000000..1630713f92 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/build/Jamfile.v2 @@ -0,0 +1,113 @@ +# Boost serialization Library Build Jamfile +# (C) Copyright Robert Ramey 2002-2004. +# Use, modification, and distribution are 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/libs/serialization for the library home page. + +project boost/serialization + : source-location ../src + : requirements + @include-spirit +; + +SPIRIT_ROOT = [ modules.peek : SPIRIT_ROOT ] ; +rule include-spirit ( properties * ) +{ + local old-compiler ; + if borland in $(properties) + { + if ! 6.1.0 in $(properties) + { + old-compiler = true ; + } + + } + else if msvc in $(properties) + { + if 6.5 in $(properties) + || 7.0 in $(properties) + { + old-compiler = true ; + } + } + + local result ; + if $(old-compiler) + { + if $(SPIRIT_ROOT) + { + # note - we can't use $(SPIRIT_ROOT) because + # it puts -I$(SPIRIT_ROOT) AFTER the "../../.." in the command line. + # so use these instead + result = -I$(SPIRIT_ROOT) ; + } + else + { + echo **** spirit 1.6x required to build library with this compiler **** ; + result = no ; + } + } + return $(result) ; +} + +SOURCES = + basic_archive + basic_iarchive + basic_iserializer + basic_oarchive + basic_oserializer + basic_pointer_iserializer + basic_pointer_oserializer + basic_serializer_map + basic_text_iprimitive + basic_text_oprimitive + basic_xml_archive + binary_iarchive + binary_oarchive + extended_type_info + extended_type_info_typeid + extended_type_info_no_rtti + polymorphic_iarchive + polymorphic_oarchive + stl_port + text_iarchive + text_oarchive + void_cast + archive_exception + xml_grammar + xml_iarchive + xml_oarchive + xml_archive_exception + shared_ptr_helper +; + +WSOURCES = + basic_text_wiprimitive + basic_text_woprimitive + text_wiarchive + text_woarchive + utf8_codecvt_facet + xml_wgrammar + xml_wiarchive + xml_woarchive + codecvt_null +; + + +lib boost_serialization + : $(SOURCES).cpp + : + msvc:/Gy + shared:BOOST_SERIALIZATION_DYN_LINK=1 + ; + +lib boost_wserialization + : $(WSOURCES).cpp boost_serialization + : + msvc:/Gy + shared:BOOST_SERIALIZATION_DYN_LINK=1 + ; + +boost-install boost_serialization boost_wserialization ; diff --git a/deal.II/contrib/boost/libs/serialization/doc/acknowledgments.html b/deal.II/contrib/boost/libs/serialization/doc/acknowledgments.html new file mode 100644 index 0000000000..e0484881d5 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/doc/acknowledgments.html @@ -0,0 +1,89 @@ + + + + + + + +Serialization - Acknowledgments + + + + + + + +
+

C++ Boost

+
+

Serialization

+

Acknowledgments

+
+
+
    +
  • AutoForm Engineering GmbH supported + development efforts to extend correct serialization to objects stored in DLLS. +
  • Cadence Israel supported enhancement + and testing of the portable binary archive. +
  • David Abrahams improved implementation of "export" functionality. This not + only eliminated an annoying header sequencing requirement, but also the need to maintain + a list of "known archives". +
  • Mattias Troyer enhanced the implementation of native binary archives. This includes + enhancement and generalization of the library itself including generalization of + the wrapper concept. +
  • Markus Schöpflin tracked down issues with TRU64 compiler resulting in 100% passing. +
  • Troy D. Straszheim made the initial version of variant serialization. +
  • Tonko Juricic helped refine and complete project files for VC 7.1 ide +
  • Rene Rivera tracked down several issues related to + Code Warrior, toolset configuration and bjam and much else. +
  • Martin Ecker detected (and fixed!) a number of sublte errors regarding cyclic + pointers, shared pointers. He also built the library as a DLL and raised some issues +
  • Pavel Vozenilek invested much effort in review of code and documentation + resulting in many improvements. In addition he help a lot with porting to other + platforms including VC 6.0, Intel, and especially Borland. +
  • Jens Maurer and + Beman Dawes who got the boost + serialization ball rolling. It was one or both of these two that invented + the much beloved & syntax used to implement both save and + load in one fuction specification. +
  • Vladimir Prus for evaluating an + early draft and contributing the diamond inheritance example. +
  • William E. Kempf + who made the templates for this and other boost manuals. This relieved + me of much aggravation. +
  • Vahan Margaryan and + Fredrik Blomqvist for their contributions + to my understanding of the subtle issues of exception safety in this context. +
  • all other boost members who responded with feedback during the + development of this library. Almost all comments resulted in + tangible changes in the library which made it much better. +
  • boosters who helped out in porting to other platforms:, Fernando Cacciola (Borland), + Jeff Flinn (VC 7.1), Vladimir Prus (gcc 3.3), Christoph Ludwig(gcc 3.4), + Rob Lievaart(mingw), Marshal Clow(gcc-darwin) among others. +
  • all boost members who participated in the first formal review + in November 2002. Many of these members invested quite an effort + to evaluate the library and suggest changes. They are + Matthias Troyer, Pavel Vozenilek, Vladimir Prus, Fredrik Blomqvist, + Jeff Garland, Gennadiy Rozental, Alberto Barbati, Dave Harris. + Mr. Rozenthal in particular wrote an incredibly insightful analysis + that has driven all subsequent development that has resulted in the + current package. +
  • Dave Harris proposal and spirited defense of it lead to a re-thinking + of the overrides for serialization of pointers. This resulted in a simpler + and more effective method of accounting for non-default constructors + required by serialization of pointers and STL collections. +
+
+

© Copyright Robert Ramey 2002-2004. +Distributed under 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) +

+ + + diff --git a/deal.II/contrib/boost/libs/serialization/doc/archive_reference.html b/deal.II/contrib/boost/libs/serialization/doc/archive_reference.html new file mode 100644 index 0000000000..b8314dddf8 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/doc/archive_reference.html @@ -0,0 +1,419 @@ + + + + + + + +Serialization - More on Archives + + + + + + + +
+

C++ Boost

+
+

Serialization

+

Archive Class Reference

+
+
+
+
Trivial Archive +
More Useful Archive Classes +
Usage +
Testing +
Polymorphic Archives +
+ +

Trivial Archive

+The Archive concept specifies the functions that a +class must implement to in order to be used to serialize +Serializable types. + +Our discussion will focus on archives used for saving as the hierarchy is exactly analogous +for archives used for loading data. + +

Minimum Requirments

+ +The simplest class which will model the Archive concept specifies the functions that a +class will look like: + +

+#include <cstddef> // std::size_t
+//////////////////////////////////////////////////////////////
+// class trivial_oarchive
+class trivial_oarchive {
+public:
+    //////////////////////////////////////////////////////////
+    // public interface used by programs that use the
+    // serialization library
+    typedef boost::mpl::bool_<true> is_saving; 
+    typedef boost::mpl::bool_<false> is_loading;
+    template<class T> register_type(){}
+    template<class T> trivial_oarchive & operator<<(const T & t){
+        return *this;
+    }
+    template<class T> trivial_oarchive & operator&(const T & t){
+        return *this << t;
+    }
+    void save_binary(void *address, std::size_t count){};
+};
+
+The simplest possible input archive class is analogous to the above. +In the following discussion, only output archives will be addressed. +Input archives are exactly symmetrical to output archives. +

+This archive will compile and execute with any types which implement the +Serializable concept. +For an example see + +demo_trivial_archive.cpp. +Of course this program won't produce any output as it is. But it provides +the starting point for a simple class which can be used to log formated +output. See the implementation of a simple +log archive to how this has been done. + +

More Useful Archive Classes

+The above example is fine as far as it goes. But it doesn't implement +useful features such as serialization of pointers, class versioning +and others. This library implements a family of full featuared archive +classes appropriate for a variety of purposes. + +

+Our archives have been factored in to a tree of classes in order to minimize +repetition of code. This is shown in the accompanying +class diagram. + +Any class which fullfills the following requirements will fit into +this hierarchy and implement all the features we require. Deriving from +the base class +common_oarchive.hpp provides all features we desire which +are missing from trivial_oarchive above. + +


+
+#include <cstddef> // std::size_t
+#include <boost/archive/detail/common_oarchive.hpp>
+
+/////////////////////////////////////////////////////////////////////////
+// class complete_oarchive
+class complete_oarchive : 
+    public boost::archive::detail::common_oarchive<complete_oarchive>
+{
+    // permit serialization system privileged access to permit
+    // implementation of inline templates for maximum speed.
+    friend class boost::archive::save_access;
+
+    // member template for saving primitive types.
+    // Specialize for any types/templates that special treatment
+    template<class T>
+    void save(T & t);
+
+public:
+    //////////////////////////////////////////////////////////
+    // public interface used by programs that use the
+    // serialization library
+
+    // archives are expected to support this function
+    void save_binary(void *address, std::size_t count);
+};
+
+ +Given a suitable definitions of save +and save_binary, +any program using serialization with a conforming C++ compiler should compile +and run with this archive class. + +

Optional Overrides

+ +The detail::common_oarchive class contains +a number of functions that are used by various parts of the serialization library +to help render the archive in a particular form. + +
+ +

void save_start()

+
+Default:Does nothing.
+Purpose:To inject/retrieve an object name into the archive. Used +by XML archive to inject "<name " before data. +
+

+ +

void save_end()

+
+Default:Does nothing.
+Purpose:To inject/retrieve an object name into the archive. Used +by XML archive to inject "</name>" after data. +
+
+

+

void end_preamble()

+
+Default:Does nothing.
+Purpose:Called each time user data is saved. +It's not called when archive bookkeeping data is saved. This is used by XML archives +to determine when to inject a ">" character at end of XML header. XML output archives +keep their own internal flag indicating that data being written is header data. This +internal flag is reset when an object start tag is written. When +void end_preamble() is invoked and this internal flag is set +a ">" character is appended to the output and the internal flag is reset. The default +implementation for void end_preamble() is a no-op there by permitting it +to be optimised away for archive classes that don't use it. +
+

+

+template<class T> +void save_override(T & t, int); +

+
+Default:Invokes archive::save(Archive & ar, t)
+This is the main entry into the serialization library.
+Purpose:This can be specialized in cases where the data is to be written +to the archive in some special way. For example, XML archives implement special handling for +name-value pairs by overriding this function template for name-value pairs. +This replaces the default name-value pair handling, which is just to throw away the name, +with one appropriate for XML which writes out the start of an XML tag with the correct object name. +

+The second argument must be part of the function signature even this it is not used. +Its purpose is to be sure that code is portable to compilers which fail to correctly +implement partial function template ordering. For more information see +this. +

+ +
+ +

Types used by the serialization library

+The serialization library injects bookkeeping data into the serialization archive. +This data includes things like object ids, version numbers, class names etc. Each +of these objects is included in a wrapper so that the archive class can override the +implementation of void save_override(T & t, int);. +For example, in the XML archive, the override for this type renders an object_id equal to 23 as +"object_id=_23". The following table lists the types defined in the +boost::archive namespace +used internally by the serialization library: +

+ + + + + + + + + + +
typedefault
serialized as
version_typeunsigned int
object_id_typeunsigned int
object_id_reference_typeunsigned int
class_id_typeint
class_id_optional_typenothing
class_id_reference_typeint
tracking_typebool
classname_typestring
+

+All of these are associated with a default serialization defined in terms of primitive types +so it isn't a requirement to define save_override +for these types. +

+These are defined in +basic_archive.hpp. +All of these types have been assigned an +implementation level of +primitive and are convertible to types such as int, unsigned int, etc. +so that they have default implementations. This is illustrated by +basic_text_iarchive.hpp. +which relies upon the default. However, in some cases, overrides will have to be +explicitly provided for these types. For an example see +basic_xml_iarchive.hpp. +

+In real practice, we probably won't be quite done. +One or more of the following issues may need to be addressed: +

    +
  • Many compilers fail to implement correct partial ordering of + function templates. The archives included with this library work around + this using argument overloading. This technique is described in + + another section of this manual +
  • Even if we are using a conforming compiler, we might want our new archive class + to be portable to non-conforming compilers. +
  • Our archive format might require extra information inserted into it. For + example, XML archives need <name ... >...</name> surrounding + all data objects. +
  • Addressing any of the above may generate more issues to be addressed. +
  • The archives included with library are all templates which use a + stream or + streambuf + as a template parameter rather than simple classes. + Combined with the above, even more issues arise with non-conforming compilers. +
+The attached class diagram +shows the relationships between classes used to implement the serialization library. +

+A close examination of the archives included with the library illustrate +what it takes to make a portable archive that covers all data types. +

Usage

+The newly created archive will usually be stored in its own header module. All +that is necessary is to include the header and construct an instance of the new archive. +EXCEPT for one special case. +
    +
  • Instances of a derived class are serialized through a base class pointer. +
  • Such instances are not "registered" neither implicitly nor explicitly. That + is, the macro BOOT_CLASS_EXPORT is used + to instantiate the serialization code for the included archives. +
+ +To make this work, the following should be included after the archive +class definition. +

+#define BOOST_SERIALIZATION_REGISTER_ARCHIVE(Archive)
+
+Failure to do this will not inhibit the program from compiling, linking +and executing properly - except in one case. If an instance of a derived +class is serialized through a pointer to its base class, the program +will throw an +unregistered_class +exception. +

+ +

Testing

+Exhaustive testing of the library requires testing the different aspects of object +serialization with each archive. There are 46 different tests that can run with any archive. +There are 5 "standard archives" included with the system. +(3 in systems don't support wide charactor i/o). +

+In addition, there are 28 other tests which aren't related to any particular archive class. +

+The default bjam testing setup will run all +the above described tests. This will result in as many as 46 archive tests * 5 +standard archives + 28 general tests = 258 tests. Note that a complete test of the +library would include DLL vs static library, release vs debug so the actual total +would be closer to 1032 tests. +

+For each archive there is a header file in the test directory similar to the one below. +The name of this archive is passed to the test program by setting the +environmental variable BOOST_ARCHIVE_TEST +to the name of the header. Here is the header file +test_archive.hpp . Test header files for +other archives are similar. +


+// text_archive test header
+// include output archive header
+#include <boost/archive/text_oarchive.hpp>
+// set name of test output archive
+typedef boost::archive::text_oarchive test_oarchive;
+// set name of test output stream
+typedef std::ofstream test_ostream;
+
+// repeat the above for input archive
+#include <boost/archive/text_iarchive.hpp>
+typedef boost::archive::text_iarchive test_iarchive;
+typedef std::ifstream test_istream;
+
+// define open mode for streams
+//   binary archives should use std::ios_base::binary
+#define TEST_STREAM_FLAGS (std::ios_base::openmode)0
+
+ +To test a new archive, for example, portable binary archives, with the gcc compiler, +make a header file portable_binary_archive.hpp +and invoke bjam with +
 
+-sBOOST_ARCHIVE_LIST=portable_binary_archive.hpp
+
+This process in encapsulated in the shell or cmd script +library_test whose command line is +

+library_test --toolset=gcc -sBOOST_ARCHIVE_LIST=portable_binary_archive.hpp
+
+

Polymorphic Archives

+ +

Motivation

+ +All archives described so far are implemented as templates. Code to save and load +data to archives is regenerated for each combination of archive class and data type. +Under these cirumstances, a good optimizing compiler that can expand +inline functions to enough depth will generate fast code. +However: +
    +
  • Much inline code may be replicated. +
  • If there are several archive classes, code will be regenerated for each archive class. +
  • If serialization code is placed in a library, that library must be rebuilt +each time a new archive class is created. +
  • If serialization code is placed in a DLL, +
      +
    • The DLL will contain versions of code for each known archive type. + This would result in loading of DLLs which contain + much code that is not used - basically defeating one of the main motivations + for choosing to use a DLL in the first place. +
    • If a new archive is created and an application shipped, all DLLs have to be + rebuilt, and reshipped along with the application which uses the new archive. Thus + the other main motivation for using a DLL is defeated. +
    +
+ +

Implementation

+The solution is the the pair polymorphic_oarchive +and polymorphic_iarchive. They present a common interface of virtual +functions - no templates - that is equivalent to the standard templated one. + +This is shown in the accompanying +class diagram +

+The accompanying demo program in files + +demo_polymorphic.cpp, +demo_polymorphic_A.hpp, and +demo_polymorphic_A +show how polymorphic archives are to be used. Note the following: +

    +
  • demo_polymorphic_A.hpp and +demo_polymorphic_A.cpp +contain no templates and no reference to any specific archive implementation. That is, they will +only have to be compiled once for all archive implementations. The even applies to archives classes +created in the future. +
  • The main program demo_polymorphic.cpp +specifies a specific archive implementation. +
+As can be seen in the +class diagram +and the header files, this implementation is just a composition of the polymorphic +interface and the standard template driven implementation. This composition is +accomplished by the templates +polymorphic_iarchive_route.hpp +and +polymorphic_oarchive_route.hpp. +As these contain no code specific to the particular implementation archive, they can be used to create +a polymorphic archive implementation from any functioning templated archive implementation. +

+As a convenience, small header files have been included which contain +typedef for polymorphic implementation for each corresponding +templated one. For example, the headers +polymorphic_text_iarchive.hpp +and +polymorphic_text_oarchive.hpp. +contain the typedef for the polymorphic implementation +of the standard text archive classes +text_iarchive.hpp +and +text_oarchive.hpp +respectively. All included polymorphic archives use the same naming scheme. +

Usage

+Polymorphic archives address the issues raised above regarding templated implementation. +That is, there is no replicated code, and no recompilation for new archives. This will +result in smaller executables for program which use more than one type of archive, and +smaller DLLS. There is a +penalty for calling archive functions through a virtual function dispatch table and there +is no possibility for a compiler to inline archive functions. This will result +in a detectable degradation in performance for saving and loading archives. +

+The main utility of polymorphic archives will be to permit the buiding of class DLLs that will +include serialization code for all present and future archives with no redundant code. +


+

© Copyright Robert Ramey 2002-2004. +Distributed under 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) +

+ + diff --git a/deal.II/contrib/boost/libs/serialization/doc/archives.html b/deal.II/contrib/boost/libs/serialization/doc/archives.html new file mode 100644 index 0000000000..cb5a545733 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/doc/archives.html @@ -0,0 +1,432 @@ + + + + + + +Serialization - Archives + + + + + + + +
+

C++ Boost

+
+

Serialization

+

Archive Concepts

+
+
+
+
Saving Archive Concept +
Loading Archive Concept +
Models +
Exceptions +
Character Sets +
+

Notation

+In the following descriptions +
    +
  • SA is an type modeling the Saving Archive Concept +
  • sa is an instance of type SA. +
  • LA is an type modeling the Loading Archive Concept +
  • la is an instance of type LA. +
  • T is an Serializable Type +
  • x is an instance of type T Type
  • . +
  • u,v is a pointer to a an instance of type T +
  • count is an instance of a type that can be converted to std::size_t. +
+

Saving Archive Concept

+

Associated Types

+Intuitively, a type modeling this concept will generate a sequence of bytes +corresponding to an arbitrary set of C++ data structures. Each type modeling the +Saving Archive concept (SA) may be associated with another type modeling the +Loading Archive Concept(LA). +This associated type will perform the inverse operation. +That is, given a sequence of bytes generated by SA, it will generate a set of +C++ data structures that is equivalent to the original. +The notion of equivalence is defined by the implementations of the pair of archives and the +way the data are rendered serializable. +

+

Valid Expressions

+
+

+ SA::is_saving +

+
+ Returns the Boost MPL Integral Constant type boost::mpl::bool_<true> +
+

+ SA::is_loading +

+
+ Returns the Boost MPL Integral Constant type boost::mpl::bool_<false> +
+

+ sa << x +
+ sa & x +

+
+ These expressions must perform exactly the same function. They append the + value of x along with other information to sa. + This other information is defined by the implementation of the archive. + Typically this information is that which is required by a corresponding + Loading Archive type to properly restore the value of x. +

+ Returns a reference to sa. +

+

+ sa.save_binary(u, count) +

+
+ Appends to the archive size_t(count) bytes found at + u. +
+

+ sa.register_type<T>() +
+ sa.register_type(u) +

+
+ Appends information about class T to the archive. This information is used to + construct the correct class when a derived pointer is loaded by a corresponding + Loading Archive type. + Invocation of this member function is referred to as "class registration". + This is explained in detail in + Special Considerations - Derived Pointers. + The second syntax is included to permit this function to be called on non-conforming + compilers when sa is a template argument. + For more information, see Template Invocation syntax +
+

+ sa.get_library_version() +

+
+ Returns an unsigned integer containing the current version number of the serialization + library. This number will be incremented each time the library is altered in such a + way that serialization could be altered for some type. For example, suppose the type + used for a count of collection members is changed. The code that loads collections + might be conditioned on the library version to make sure that libraries created by + previous versions of the library can still be read. +
+
+ +

Loading Archive Concept

+

Associated Types

+Each model of this concept presumes the +existence of a corresponding type modeling the +Saving Archive Concept. +The purpose of an instance of this concept is to convert a sequence of bytes +generated by this corresponding type to a set of C++ data structures +equivalent to the original. +

Valid Expressions

+
+

+ LA::is_saving +

+
+ Returns the Boost MPL Integral Constant type boost::mpl::bool_<false> +
+

+ LA::is_loading +

+
+ Returns the Boost MPL Integral Constant type boost::mpl::bool_<true> +
+

+ la >> x +
+ la & x +

+
+ These expressions must perform exactly the same function. + Sets x to a value retrieved from la. +

+ Returns a reference to la. +

+

+ la.load_binary(u, count) +

+
+ Retrieves from la size_t(count) bytes and stores + them in memory starting at u. +
+
+

+ la.register_type<T>() +
+ la.register_type(u) +

+
+ Retrieves information about class T from the archive. This information is used to + construct the correct class when loading a pointer to a derived class not + otherwise referred to in the program by name. + Invocation of this member function is referred to as "class registration". + This is explained in detail in + Special Considerations - Derived Pointers. + The second syntax is included to permit this function to be called on non-conforming + compilers when la is a template argument. + For more information, see Template Invocation syntax +
+

+ la.get_library_version() +

+
+ Returns an unsigned integer containing the version number of the serialization + library that created the archive. This number will be incremented each time the + library is altered in such a way that serialization could be altered for some type. + For example, suppose the type used for a count of collection members is changed. + The code that loads collections might be conditioned on the library version to make + sure that libraries created by previous versions of the library can still be read. +
+

+ la.reset_object_address(v, u) +

+
+ Communicates to the archive that the object originally at address u has been + moved to address v. +

+ When an object is loaded to a temporary variable and later moved to another location, + this function must be called in order communicate this fact. This permits the + archive to properly implement object tracking. Object tracking is required in order + to correctly implement serialization of pointers to instances of derived classes. +

+

+ la.delete_created_pointers() +

+
+ Deletes all objects created by the loading of pointers. This can be used to + avoid memory leaks that might otherwise occur if pointers are being loaded + and the archive load encounters an exception. +
+
+ +There are archives based on text, binary and XML file +formats but all have the above interface. Given that all archives present +the same public interface, specifcation of serialization is exactly the same +for all archives. Archive classes have other members not mentioned here. +However they are related to the internal functioning of the library and +are not meant to be called by users of an archive. Implementation of new +archives is discussed in +New Archives - Implementation. + +

+The existence of the << +and >> suggests +a relationship between archives and C++ i/o streams. Archives are not +C++ i/o streams. All the archives included with this system take a stream +as an argument in the constructor and that stream is used for output or input. +However, this is not a requirement of the serialization functions or the +archive interface. It just turns out that the archives written so far have +found it useful to base their implementation on streams. + +

Archive Models

+This library includes various implementations of the Archive concept. + +An archive is defined by two complementary classes. One is for saving data while +the other is for loading it. + +This library includes a number of archive implementations that are "ready to go" for the +most common requirements. These classes implement the archive concept for differing data formats. +They can be used "as is" or as a basis for developing one's own particular type of archive. +An archive is defined by two complementary classes. One is for saving data while the other is for loading it. + +To invoke serialization using one of +these archives, one or more of the following header files must be +included in the code module containing the serialization code. +

+// a portable text archive
+boost::archive::text_oarchive // saving
+boost::archive::text_iarchive // loading
+
+// a portable text archive using a wide character stream
+boost::archive::text_woarchive // saving
+boost::archive::text_wiarchive // loading
+
+// a portable XML archive
+boost::archive::xml_oarchive // saving
+boost::archive::xml_iarchive // loading
+
+// a portable XML archive which uses wide characters - use for utf-8 output
+boost::archive::xml_woarchive // saving
+boost::archive::xml_wiarchive // loading
+
+// a non-portable native binary archive
+boost::archive::binary_oarchive // saving
+boost::archive::binary_iarchive // loading
+
+
+
+
+ +All of these archives implement the same inteface. Hence, it should suffice to describe only one +of them in detail. For this purpose we will use the text archive. + + +

+namespace boost {
+namespace archive {
+
+enum archive_flags {
+    no_header = 1,          // suppress archive header info
+    no_codecvt = 2,         // suppress alteration of codecvt facet
+    no_xml_tag_checking = 4 // suppress checking of xml tags - igored on saving
+};
+
+} // archive
+} // boost
+
+ +

+namespace boost {
+namespace archive {
+
+class text_oarchive : ...
+{
+    ...
+public:
+    ... // implementation of the Saving Archive concept
+    text_oarchive(std::ostream & os, unsigned int flags = 0);
+    ~text_oarchive();
+};
+
+} // archive
+} // boost
+
+ +
+ +

+text_oarchive(std::ostream & os, unsigned int flags = 0); +

+
+Constructs an archive given an open stream as +an argument and optional flags. For most applications there will be no need to use flags. +Flags are defined by enum archive_flags enumerator. +Multiple flags can be combined with the | operator. + +By default, archives prepend +output with initial data which helps identify them as archives produced by this system. +This permits a more graceful handling of the case where an attempt is made to load an archive +from an invalid file format. In addition to this, each type of archive might have +its own information. For example, native binary archives include information about +sizes of native types and endianess to gracefully handle the case where it has been +erroneously assumed that such an archive is portable across platforms. In some cases, +where this extra overhead might be considered objectionable, it can be suppressed with the +no_header flag. +

+In some cases, an archive may alter (and later restore) +the codecvt facet of the stream locale. To suppress this action, +include the no_codecvt flag. +

+XML archives contain nested tags signifying the start and end of data fields. +These tags are normally checked for agreement with the object name when +data is loaded. If a mismatch occurs an exception is thrown. It's possible +that this may not be desired behavior. To suppress this checking of XML +tags, use no_xml_tag_checking flag. +

+ +

+~text_oarchive(); +

+
+Destructor for an archive. This should be called before the stream is +closed. It restores any altered stream facets to their state before the +archive was opened. +
+ +
+ +

+namespace boost {
+namespace archive {
+
+class text_iarchive : ...
+{
+    ...
+public:
+    ... // implementation of the Loading Archive concept
+    text_iarchive(std::istream & is, unsigned int flags = 0);
+    ~text_iarchive();
+};
+
+} //namespace archive
+) //namespace boost
+
+
+ +
+ +

+text_iarchive(std::istream & is, unsigned int flags = 0); +

+
+Contructs an archive given an open stream as +an argument and optional flags. If flags are used, they should be the same +as those used when the archive was created. Function and usage of flags is described +above. +
+ +

+~text_iarchive(); +

+
+Destructor for an archive. This should be called before the stream is +closed. It restores any altered stream facets to thier state before the +the archive was opened. +
+
+

+The binary_oarchive and +binary_iarchive classes are +implemented in terms of the more basic +std::streambuf. So, in addition +to the common class interface described above, they include the following +constructors: +

+

+binary_oarchive(std::streambuf & bsb, unsigned int flags = 0); +

+and +

+binary_iarchive(std::streambuf & bsb, unsigned int flags = 0); +

+
+ +

Exceptions

+All of the archive classes included may throw exceptions. The list of exceptions that might +be thrown can be found in section Archive Exceptions +of this documentation. + +

Character Sets

+This library includes two archive classes for XML. The wide character +version (xml_w?archive) renders its output as UTF-8 which can +handle any wide character without loss of information. +std::string data is converted from multi-byte format to wide +character format using the current +locale. Hence this version should give a fair rendering of all +C++ data for all cases. This could result in some unexpected behavior. +Suppose an std::string +is created with the locale character +set to hebrew characters. On output this is converted to wide characters. +On input however, there could be a problem if the locale is +not set the same as when the archive is created. +

+The normal character version (xml_?archive) renders +std::string output without any conversion. Though this may work +fine for serialization, it may create difficulties if the XML archive is used +for some other purpose. +


+

© Copyright Robert Ramey 2002-2004. +Distributed under 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) +

+ + diff --git a/deal.II/contrib/boost/libs/serialization/doc/bibliography.html b/deal.II/contrib/boost/libs/serialization/doc/bibliography.html new file mode 100644 index 0000000000..0c8d0e2a14 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/doc/bibliography.html @@ -0,0 +1,74 @@ + + + + + + + +Serialization - Bibliography + + + + + + + +
+

C++ Boost

+
+

Serialization

+

Bibliography

+
+
+
    +
  1. David Sugar and Daniel Silverstone, "CommonC++ Libraries", http://www.gnu.org/software/commoncpp/ + +
  2. Nicola Santi, "Eternity", www.sourceforge.net/projects/eternity-it/ + +
  3. Allen Holub, "Roll Your Own Persistence", Microsoft + Systems Journal vol 11, no 6 Jun 1996 + +
  4. Tasos Kontogiorgos & Michael Kim, "A C++ + Template-Based Application Architecture", C++ Report + +
  5. Scott Meyers, Effective C++, Addison-Wesley, 1992 + +
  6. Bjarne Stroustrup, The C++ Programming Langage, Addison-Wesley, 1997 + +
  7. Alexandrescu, Andrei, Modern C++ Design, Addison-Wesley, 2001 + +
  8. Jm Hyslop, and Herb Sutter, "Factory Redux, Part2", + C/C++ User's Journal, vol 21, No. 8, August 2003 + +
  9. David Vandevoorde and Nicolai M. Josuttis, + C++ Templates - The Complete Guide, Addison-Wesley, 2003 + +
  10. Herb Sutter, "Pimples--Beauty Marks You Can Depend On", + C++ Report, from More C++ Gems, Cambridge University Press, 2000 + +
  11. James Coplien, "Curiously Recurring Template Patterns", + C++ Report, from C++ Gems, Cambridge University Press, 1998 + +
  12. Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides, + Design Patterns, Addison-Wesley Publishing Company, 1995 + +
  13. Stephan Beal, "s11n serialization library", www.s11n.net + +
  14. Vandervoorde and Josuttis, C++ Templates - A Complete Guide, Addison-Wesley, 2003 +
+
+

© Copyright Robert Ramey 2002-2004. +Distributed under 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) +

+ + + diff --git a/deal.II/contrib/boost/libs/serialization/doc/class_diagram.html b/deal.II/contrib/boost/libs/serialization/doc/class_diagram.html new file mode 100644 index 0000000000..9cdc9d698b --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/doc/class_diagram.html @@ -0,0 +1,170 @@ + + + + + + + +Serialization - Archive Class Diagram + + + + + + + +
+

C++ Boost

+
+

Serialization

+

Text Archive Class Diagram

+
+
+ +

+
+
+basic_oarchive ->
+      |
+      |
+      |      interface_oarchive<text_oarchive> ->
+      |                     /
+      |                   /
+      |        _________/
+      |      /
+      |    /
+      |  /
+common_oarchive<text_oarchive> ->
+      |
+      |
+basic_text_oarchive<text_oarchive> ->
+      |
+      |
+      |     basic_text_oprimitive<basic_ostream> ->
+      |                    /
+      |                  /
+      |       _________/                  interface_oarchive<polymorphic_oarchive> ->
+      |     /                                                |
+      |   /                                                  |
+      | /                                                    |
+text_oarchive_impl<text_oarchive> ->              polymorphic_oarchive_impl ->
+      | \                                                    |
+      |   \                                                  |
+      |     \_____________________________________    polymorphic_oarchive ->
+      |                                           \         /
+      |                                             \     /
+      |                                               \ /  
+text_oarchive ->                 polymorphic_oarchive_route<text_oarchive_impl<text_oarchive> > ->
+                                                       |
+                                                       |
+                                                       |
+                                             polymorphic_text_oarchive ->
+
+
+
+This diagram shows the relationship between the various classes that implement saving (output +serialization) for text archives. The hierachy and organization is similar for loading and for +other types of archives as well. In the diagram, classes written in blue +implement saving for a given archive type. (in this case its text archives). +Users include classes in red to save their data from a partcular +type of archive. Other classes whose names are in black implement the library and should +never change. They are in namespace boost::archive::detail +
+
+ basic_oarchive +
+
+ Implements the core library functions for class export, versioning, and object tracking. It is compiled + into the library as it has no template parameters. +
+

+ interface_oarchive<text_oarchive> +
+
+ A class that declares the standard archive interface. This has been factored out so that it + can be used as a base class for polymorphic_oarchive + as well as for archive implementations. + +

+ common_oarchive<text_oarchive> +
+
+ The function of this class is to make the connection between the virtual function + interface used by basic_oarchive and the template interface used by archive + class implementations. + +

+ basic_text_oarchive<text_oarchive> +
+
+ Implements the basic functionality for simple text archives. The primitive save functions have been + factored out so it can be used in other text based archives like XML archives. + +

+ basic_text_oprimitive<basic_ostream> +
+
+ Implements the save oversaves for all primitive types. This is a template with a parameter + which describes the stream. + +

+ text_oarchive_impl<text_oarchive> +
+
+ Inherits from the above two classes to implement text archives. +
+ +

+ text_oarchive +
+
+ This is just a short hand for text_oarchive_impl<text_oarchive> . + We can't use typedef because a + typedef can't refer to it self in its definition. + This is the class name that is used to serialize to a text archive. +
+ +

+ interface_oarchive<polymorphic_oarchive> +
+
+ Same template as above. However, this time the Archive parameter refers to the polymorphic archive + with a virtual function interface rather than that the template interface that + common_oarchive uses. + +

+ polymorphic_oarchive +
+
+ A class with a list of virtual save(T &t) + for all primitive types T. This is the class that is used to do pre-compile serialization of classes + for all archives present and future. + +

+ polymorphic_oarchive_route<text_oarchive_impl<text_oarchive> > +
+

+ This class implements the polymorphic_oarchive in terms of a specific + concrete class. Virtual function calls are routed to the implementing class. In this example, + that implementing class would be text_oarchive_impl. + +

+ polymorphic_text_oarchive +
+
+ this is just a typedef so we can write polymorphic_text_archive rather than + polymorphic_oarchive_route<text_oarchive_impl&'t;text_oarchive> > + +
+
+

© Copyright Robert Ramey 2002-2004. +Distributed under 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) +

+ + \ No newline at end of file diff --git a/deal.II/contrib/boost/libs/serialization/doc/codecvt.html b/deal.II/contrib/boost/libs/serialization/doc/codecvt.html new file mode 100644 index 0000000000..85e9e797ba --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/doc/codecvt.html @@ -0,0 +1,171 @@ + + + + + + + +UTF-8 Codecvt Facet + + + + +C++ Boost
+ + + + + +

utf8_codecvt_facet

+ + +
+template<
+    typename InternType = wchar_t, 
+    typename ExternType = char
+> utf8_codecvt_facet
+
+ + +

Rationale

+ + + UTF-8 is a method of encoding Unicode text in environments where + where data is stored as 8-bit characters and some ascii characters + are considered special (i.e. Unix filesystem filenames) and tend + to appear more commonly than other characters. While + UTF-8 is convenient and efficient for storing data on filesystems, + it was not meant to be manipulated in memory by + applications. While some applications (such as Unix's 'cat') can + simply ignore the encoding of data, others should convert + from UTF-8 to UCS-4 (the more canonical representation of Unicode) + on reading from file, and reversing the process on writing out to + file. + +

The C++ Standard IOStreams provides the std::codecvt + facet to handle specifically these cases. On reading from or + writing to a file, the std::basic_filebuf can call out to + the codecvt facet to convert data representations from external + format (ie. UTF-8) to internal format (ie. UCS-4) and + vice-versa. utf8_codecvt_facet is a specialization of + std::codecvt specifically designed to handle the case + of translating between UTF-8 and UCS-4. + + +

Template Parameters

+ + + + + + + + + + + + + + + + + +
ParameterDescriptionDefault
InternTypeThe internal type used to represent UCS-4 characters.wchar_t
ExternTypeThe external type used to represent UTF-8 octets.char_t
+ + +

Requirements

+ + utf8_codecvt_facet defaults to using char as + it's external data type and wchar_t as it's internal + datatype, but on some architectures wchar_t is + not large enough to hold UCS-4 characters. In order to use + another internal type.You must also specialize std::codecvt + to handle your internal and external types. + (std::codecvt<char,wchar_t,std::mbstate_t> is required to be + supplied by any standard-conforming compiler). + + +

Example Use

+ The following is a simple example of using this facet: + +
+  //...
+  // My encoding type
+  typedef wchar_t ucs4_t;
+
+  std::locale old_locale;
+  std::locale utf8_locale(old_locale,new utf8_codecvt_facet<ucs4_t>);
+
+  // Set a New global locale
+  std::locale::global(utf8_locale);
+
+  // Send the UCS-4 data out, converting to UTF-8
+  {
+    std::wofstream ofs("data.ucd");
+    ofs.imbue(utf8_locale);
+    std::copy(ucs4_data.begin(),ucs4_data.end(),
+          std::ostream_iterator<ucs4_t,ucs4_t>(ofs));
+  }
+
+  // Read the UTF-8 data back in, converting to UCS-4 on the way in
+  std::vector<ucs4_t> from_file;
+  {
+    std::wifstream ifs("data.ucd");
+    ifs.imbue(utf8_locale);
+    ucs4_t item = 0;
+    while (ifs >> item) from_file.push_back(item);
+  }
+  //...
+
+ + +

History

+ + This code was originally written as an iterator adaptor over + containers for use with UTF-8 encoded strings in memory. + Dietmar Kuehl suggested that it would be better provided as a + codecvt facet. + +

Resources

+ + + +
+
+ + + + + +
Copyright © 2001Ronald Garcia, +Indiana University +(garcia@osl.iu.edu)
+Andrew Lumsdaine, +Indiana University +(lums@osl.iu.edu)
+

© Copyright Robert Ramey 2002-2004. +Distributed under 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) +

+ + + + diff --git a/deal.II/contrib/boost/libs/serialization/doc/configuration.html b/deal.II/contrib/boost/libs/serialization/doc/configuration.html new file mode 100644 index 0000000000..0997298170 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/doc/configuration.html @@ -0,0 +1,17 @@ + + + + + + + +Serialization - Configuration + + + + diff --git a/deal.II/contrib/boost/libs/serialization/doc/contents.html b/deal.II/contrib/boost/libs/serialization/doc/contents.html new file mode 100644 index 0000000000..8b9e37aae1 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/doc/contents.html @@ -0,0 +1,352 @@ + + + + + + +Serialization + + + + + + +

Contents

+ + +

+

+
Release Notes
+
+
Overview
+
+
Tutorial
+
+ +
Reference
+
+
Archive Concepts +
+
Serializable Concept +
+
Special Considerations +
+
Archive Class Reference +
+
+
Implementation Notes +
+
Case Studies +
+
Other Classes +
+ +
Tips and Tricks +
Rationale
+
+ +
To Do
+
+ +
History + +
Bibliography
+
Acknowledgments
+
+
+ + diff --git a/deal.II/contrib/boost/libs/serialization/doc/dataflow.html b/deal.II/contrib/boost/libs/serialization/doc/dataflow.html new file mode 100644 index 0000000000..3bc14454c4 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/doc/dataflow.html @@ -0,0 +1,212 @@ + + + + + + + +Serialization - Dataflow Iterators + + + + + + + +
+

C++ Boost

+
+

Serialization

+

Dataflow Iterators

+
+
+

Motivation

+Consider the problem of translating an arbitrary length sequence of 8 bit bytes +to base64 text. Such a process can be summarized as: +

+source => 8 bit bytes => 6 bit integers => encode to base64 characters => insert line breaks => destination +

+We would prefer the solution that is: +

    +
  • Decomposable. so we can code, test, verify and use each (simple) stage of the conversion + independently. +
  • Composable. so we can used this composite as a new component somewhere else. +
  • Efficient, so we're not required to re-implement it again. +
  • Scalable, so that it works well for short and arbitrarily long sequences. +
+The approach that comes closest to meeting these requirements is that described +and implemented with Iterator Adaptors. +The fundamental feature of an Iterator Adaptor template that makes in interesting to +us is that it takes as a parameter a base iterator from which it derives its +input. This suggests that something like the following might be possible. +

+typedef 
+    insert_linebreaks<         // insert line breaks every 72 characters
+        base64_from_binary<    // convert binary values ot base64 characters
+            transform_width<   // retrieve 6 bit integers from a sequence of 8 bit bytes
+                const char *,
+                6,
+                8
+            >
+        > 
+        ,72
+    > 
+    base64_text; // compose all the above operations in to a new iterator
+
+std::copy(
+    base64_text(address),
+    base64_text(address + count),
+    ostream_iterator<CharType>(os)
+);
+
+Indeed, this seems to be exactly the kind of problem that iterator adaptors are +intended to address. The Iterator Adaptor library already includes +modules which can be configured to implement some of the operations above. For example, +included is +transform_iterator, which can be used to implement 6 bit integer => base64 code. + +

Dataflow Iterators

+Unfortunately, not all iterators which inherit from Iterator Adaptors are guarenteed +to meet the composability goals stated above. To accomplish this purpose, they have +to be written with some additional considerations in mind. + +We define a Dataflow Iterator as an class inherited from iterator_adaptor which +fulfills as a small set of additional requirements. + +

Templated Constructors

+

+Templated constructor have the form: +


+template<class T>
+dataflow_iterator(T start) :
+    iterator_adaptor(Base(start))
+{}
+
+When these constructors are applied to our example of above, the following code is generated: +

+std::copy(
+    insert_linebreaks(
+        base64_from_binary(
+            transform_width(
+                address
+            ),
+        )
+    ),
+    insert_linebreaks(
+        base64_from_binary(
+            transform_width(
+                address + count
+            )
+        )
+    )
+    ostream_iterator<char>(os)
+);
+
+The recursive application of this template is what automatically generates the +constructor base64_text(const char *) in our example above. The original +Iterator Adaptors include a make_xxx_iterator to fulfill this function. +However, I believe these are unwieldy to use compared to the above solution usiing +Templated constructors. +

+Unfortunately, some systems which fail to properly support partial function template +ordering cannot support the concept of a templated constructor as implemented above. +A special"wrapper" macro has been created to work around this problem. With this "wrapper" +the above example is modified to: +


+std::copy(
+    base64_text(BOOST_MAKE_PFTO_WRAPPER(address)),
+    base64_text(BOOST_MAKE_PFTO_WRAPPER(address + count)),
+    ostream_iterator<char>(os)
+);
+
+This macro is defined in <boost/serialization/pfto.hpp>. +For more information about this topic, check the source. + +

Dereferencing

+Dereferencing some iterators can cause problems. For example, a natural +way to write a remove_whitespace iterator is to increment past the initial +whitespaces when the iterator is constructed. This will fail if the iterator passed to the +constructor "points" to the end of a string. The + +filter_iterator is implemented +in this way so it can't be used in our context. So, for implementation of this iterator, +space removal is deferred until the iterator actually is dereferenced. + +

Comparison

+The default implementation of iterator equality of iterator_adaptor just +invokes the equality operator on the base iterators. Generally this is satisfactory. +However, this implies that other operations (E. G. dereference) do not prematurely +increment the base iterator. Avoiding this can be surprisingly tricky in some cases. +(E.G. transform_width) + +

+Iterators which fulfill the above requirements should be composable and the above sample +code should implement our binary to base64 conversion. + +

Iterators Included in the Library

+Dataflow iterators for the serialization library are all defined in the hamespace +boost::archive::iterators included here are: +
+
+ base64_from_binary
+
transforms a sequence of integers to base64 text
+ +
+ binary_from_base64
+
transforms a sequence of base64 characters to a sequence of integers
+ +
+ insert_linebreaks
+
given a sequence, creates a sequence with newline characters inserted
+ +
+ mb_from_wchar
+
transforms a sequence of wide characters to a sequence of multi-byte characters
+ +
+ remove_whitespace
+
given a sequence of characters, returns a sequence with the white characters + removed. This is a derivation from the boost::filter_iterator
+ +
+ transform_width
+
transforms a sequence of x bit elements into a sequence of y bit elements. This + is a key component in iterators which translate to and from base64 text.
+ +
+ wchar_from_mb
+
transform a sequence of multi-byte characters in the current locale to wide characters.
+ +
+ xml_escape
+
escapes xml meta-characters from xml text
+ +
+ xml_unescape
+
unescapes xml escape sequences to create a sequence of normal text
+
+

+The standard stream iterators don't quite work for us. On systems which implement wchar_t +as unsigned short integers (E.G. VC 6) they didn't function as I expected. I also made some +adjustments to be consistent with our concept of Dataflow Iterators. Like the rest of our +iterators, they are found in the namespace boost::archive::interators to avoid +conflict the standard library version. +

+
+ istream_iterator
+
+ ostream_iterator
+
+ +
+

© Copyright Robert Ramey 2002-2004. +Distributed under 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) +

+ + diff --git a/deal.II/contrib/boost/libs/serialization/doc/definitions.html b/deal.II/contrib/boost/libs/serialization/doc/definitions.html new file mode 100644 index 0000000000..ecfb61d9ba --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/doc/definitions.html @@ -0,0 +1,17 @@ + + + + + + + +Serialization - Definitions + + + + diff --git a/deal.II/contrib/boost/libs/serialization/doc/derivation.html b/deal.II/contrib/boost/libs/serialization/doc/derivation.html new file mode 100644 index 0000000000..ccdd92e1a3 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/doc/derivation.html @@ -0,0 +1,158 @@ + + + + + + + +Serialization - Derivation from an Existing Archive + + + + + + + +
+

C++ Boost

+
+

Serialization

+

Derivation from an Existing Archive

+
+
+
+
+ +

Log Archive

+It may happen that one wants to create a new archive class by derivation from one +of the included ones. Included is a sample program that shows how to derive a +new archive from one of the ones included with the library. The first example is + +demo_log.cpp. +

+This derivation from the xml archive writes output in xml without the extra +information required to read the data back into the application. It might be +used to export one's data as simple xml for other applications or for logging +data while debugging. +

+To this end it is derived from the included xml archive and the save functions for +some types are specialized for this application. +

+The serialization library is +implemented using the Curiously Recurring Template +Pattern (CRTP). Also, all common code is factored out into +separate modules to minimize code repetition. This makes derivation from +an existing archive less straight forward than it would otherwise be. +

+This example illustrates several issues that have to be addressed when doing +something like this +

    +
  1. It is derived from xml_oarchive_impl + NOT xml_oarchive
    +As described in the comments in +xml_oarchive.hpp. +xml_oarchive really a shorthand name for +xml_oarchive_impl<xml_oarchive>. So we should derive +from xml_oarchive_impl<log_archive> rather +than xml_oarchive. +
    
    +class log_archive :
    +    // don't derive from xml_oarchive !!!
    +    public xml_oarchive_impl<log_archive>
    +{
    +...
    +
    +
  2. Note the log_archive between the <> +This is required so that base classes can downcast their this pointer +to the most derived class. This is referred to as Curiously Recurring +Template Pattern (CRTP) [11]. +It is used to implement static polymorphism. +
  3. Base classes need to be explicitly given access to the derived class. +This can be done by making members public or by including friend declarations for +the base classes. +
    
    +    friend class detail::common_oarchive<log_archive>;
    +    friend class basic_xml_oarchive<log_archive>;
    +    friend class boost::serialization::save_access;
    +
    + +
  4. Reread Archive Internals. +This describes the class hierarchy so that you know what to override. +
  5. Note the usage of PFTO. Some compilers fail to provide support for +partial function template ordering. The serialization library works around by +using +Partial Function Template Ordering in several places. +In archive classes, this takes +. This is done +in several places, including the archive classes themselves. +
  6. Base class functions will usually need to be explicitly invoked +We commonly specialize the function name save_override +for saving primitives. Usage of a function name in a derived class +"hides" similarly named functions of the base class. That is, +function name overloading doesn't automatically +include base classes. To address this, we can use: +
    
    +    using xml_oarchive_impl<derived_t>::save;
    +    void save(const unsigned int t);
    +    ...
    +
    +which should work on conforming compilers. However, I have found +that the following equivalent works on more compilers. +
    
    +    // default fall through for any types not specified here
    +    template<class T>
    +    void save(const T & t){
    +        xml_oarchive_impl<derived_t>::save(t);
    +    }
    +    void save(const unsigned int t);
    +    ...
    +
    +so it's what I use. +
  7. Template definitions of base classes may have to be explicitly instantiated. + The demo includes +
    
    +// explicitly instantiate for this type of binary stream
    +#include <boost/archive/basic_binary_oprimitive.ipp>
    +
    +for just this purpose. Failure to include required template definitions +will result in undefined symbol errors when the program is linked. +
  8. Without alteration, this class cannot be further derived from
    +Base classes using CRTP must be templates with a parameter corresponding to +the most derived class. As presented here, this class doesn't qualify, so +it cannot be used as a base class. In order to derive further from this class, +it would have to be reorganized along the lines of the original xml_oarchive. +Specifically, it would look something like: +
    
    +template<class Archive>
    +class log_archive_impl :
    +    // don't derive from xml_oarchive !!!
    +    public xml_oarchive_impl<Archive>
    +{
    +    ...
    +);
    +
    +// do not derived from this class !!!
    +class log_archive : 
    +    public log_archive_impl<log_archive>
    +{
    +public:
    +    log_archive(std::ostream & os, unsigned int flags = 0) :
    +        log_archive_impl<xml_oarchive>(os, flags)
    +    {}
    +};
    +
    + +
+ +
+

© Copyright Robert Ramey 2002-2004. +Distributed under 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) +

+ + diff --git a/deal.II/contrib/boost/libs/serialization/doc/dot.gif b/deal.II/contrib/boost/libs/serialization/doc/dot.gif new file mode 100644 index 0000000000..c9c1156c72 Binary files /dev/null and b/deal.II/contrib/boost/libs/serialization/doc/dot.gif differ diff --git a/deal.II/contrib/boost/libs/serialization/doc/exception_safety.html b/deal.II/contrib/boost/libs/serialization/doc/exception_safety.html new file mode 100644 index 0000000000..fcee95f1c2 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/doc/exception_safety.html @@ -0,0 +1,115 @@ + + + + + + + +Serialization - Reference + + + + + + + +
+

C++ Boost

+
+

Serialization

+

Exception Safety

+
+
+The process of loading an archive may result in the creation of new objects. That +same process may throw an exception at some point. In order to prevent memory leaks +and invalid pointers, these situations must be considered. Unfortunately, there is +no simple universal solution to this problem. The manner of addressing this must +depend on the design of the data structures to be serialized. Below, we discuss +varying scenarios in increasing order of difficulty. This discussion presumes that +the class member functions are exception safe before considering serialization. +That is, the destructor could be called at anytime without referencing +an invalid pointer, or creating a memory leak. +
    +
  1. class contains no pointers

    + No problem here. +

    +

  2. class contains only owned pointers

    + From here on, we have to make a distinction between pointers used + to manage heap storage (owned pointers) and pointers used to refer + to related objects (referenced pointers). Programs containing owned + pointers must contain code for deleting these objects and returning the + deallocated storage to the heap. Programs containing referenced pointers + must be designed to ensure that no such referenced pointers are de-referenced + after the object pointed to has been destroyed and its storage returned + to the heap. If a pointer is stored in only one place, it must be an owned + pointer. +

    + The load function traps any exceptions that occur between the time an object + is created and its pointer is stored. Should an exception occur while + reading an archive, the created object is deleted and the de-serialized + pointer is set to NULL. This ensures that there are no memory leaks. + The fact that there are no other copies of this pointer ensures that + no pointers are left invalid. The object's destructor should + be able to delete any other existing objects in the normal manner + without problem. + test_delete_pointer.cpp + illustrates this case. +

    +

  3. class contains one or more referenced pointers

    + This situation can be further subdivided into two cases +

    +

      +
    1. owned pointers are always serialized before referenced pointers

      + Object tracking will ensure that no new objects will be created + by the loading of a referenced pointer. + If an exception occurs, referenced pointers will not need to be deleted + so there will be no memory leaks. The destructor of this class won't attempt to + delete these pointers so there will be no problem with dangling references. + owned pointers are handled exactly as described above. +

      +

    2. class contains referenced pointers which might be created by load

      + If a referenced pointer is loaded before its corresponding owned + pointer, the object will be allocated on the heap. In certain cases + it cannot be known which pointers were created by their owners and which + were created by the load function. To address this: +
        +
      • Trap exceptions with a try/catch block. +
      • Within the catch part, invoke the archive function + delete_created_pointers() to delete any pointers + created by the class load. Without out other action, objects created in + this way would end up as memory leaks as they are not considered owned + pointers and hence aren't destroyed. +
      • The object's destructor won't try + to delete referenced pointers so any dangling references will + cause no harm. +
      + demo_exception.cpp + is a program that illustrates this case. +

      +

    +

    +

  4. Other cases

    + Situations not covered above are pointers for which the classifications of + referenced and owned are not applicable. This might occur where + pointers are created by one class but consumed and deleted by another. These + may be addressed with an ad hoc analysis similar to the above. As the + situation becomes more complex this becomes more difficult and error prone. + Eventually, it will be have to addressed by building heap management into the + pointer itself - that is into boost::shared_ptr. + The library includes serialization of boost::shared_ptr. As + previously mentioned, this required a tiny alteration in one of the + boost::shared_ptr implementation files in order to permit + access by the serialization system. +
+
+

© Copyright Robert Ramey 2002-2004. +Distributed under 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) +

+ + diff --git a/deal.II/contrib/boost/libs/serialization/doc/exceptions.html b/deal.II/contrib/boost/libs/serialization/doc/exceptions.html new file mode 100644 index 0000000000..2987b4ae48 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/doc/exceptions.html @@ -0,0 +1,270 @@ + + + + + + + +Serialization - Archive Exceptions + + + + + + + +
+

C++ Boost

+
+

Serialization

+

Archive Exceptions

+
+
+
+
unregistered_class +
invalid_signature +
unsupported_version +
unsupported_class_version +
pointer_conflict +
incompatible_native_format +
array_size_too_short +
stream_error +
invalid_class_name +
unregistered_class +
multiple_code_instantiation +
xml_archive_parsing_error +
xml_archive_tag_mismatch +
xml_archive_tag_name_error +
+ +Archive operators can throw a boost::archive_exception +object which can be caught by an application program. These exceptions are defined +in the files +archive_exception.hpp +and +basic_xml_archive.hpp. +

+namespace boost {
+namespace archive {
+
+class archive_exception  : public std::exception
+{
+public:
+    typedef enum {
+        unregistered_class,     // attempt to serialize a pointer of an
+                                // an unregistered class
+        invalid_signature,      // first line of archive does not contain
+                                // expected string
+        unsupported_version,    // archive created with library version subsequent
+                                // to this one
+        pointer_conflict        // an attempt has been made to directly serialize
+                                // an object after having already serialized the same
+                                // object through a pointer.  Were this permitted, 
+                                // it the archive load would result in the creation
+                                // of extraneous object.
+        incompatible_native_format, // attempt to read native binary format
+                                // on incompatible platform
+        array_size_too_short,   // array being loaded doesn't fit in array allocated
+        stream_error            // i/o error on stream
+        invalid_class_name,     // class name greater than the maximum permitted.
+                                // most likely a corrupted archive or an attempt
+                                // to insert virus via buffer overrun method.
+        unregistered_cast,      // base - derived relationship not registered with 
+                                // void_cast_register
+        unsupported_class_version, // type saved with a version # greater than the 
+                            // one used by the program.  This indicates that the proggram
+                            // needs to be rebuilt.
+        multiple_code_instantiation // code for implementing serialization for some
+                            // type has been instantiated in more than one module.
+    } exception_code;
+    exception_code code;
+    archive_exception(exception_code c) : code(c) {}
+    virtual const char *what( ) const throw();
+};
+
+class xml_archive_exception : public virtual archive_exception
+{
+public:
+    typedef enum {
+        xml_archive_parsing_error,  // archive doesn't contain expected data 
+	xml_archive_tag_mismatch,   // start/end tag in archive doesn't match program
+        xml_archive_tag_name_error  // tag name contains invalid characters
+
+    } exception_code;
+    xml_archive_exception(exception_code c){}
+    virtual const char *what( ) const throw();
+};
+
+} // archive
+} // boost
+
+

+

unregistered_class

+An attempt has been made to serialize a polymorphic class through a pointer +without either registering it or associating it with an export key. This can also occur +when using a new archive how class name has not been added to the system with the +BOOST_ARCHIVE_CUSTOM_ARCHIVE_TYPES macro. + +

invalid_signature

+Archives are initiated with a known string. If this string is not found when +the archive is opened, It is presumed that this file is not a valid archive and this +exception is thrown. + +

unsupported_version

+This system assigns a version number of 3 to all archives created. Note that this is in +no way related to version number of classes used by application programs. This refers +to the version of the serialization system used to create the archive. Future versions +of this serialization system will be able to identify archives created under previous +(i.e. this) system and alter the loading procedure accordingly. Hence, future enhancements +to this serialization system should not obsolete any existing archive files. It is only +necessary to increment this version number when the newer system creates archives +incompatible in format with the current one. +

Should it ever occur that an older program attempts to read newer archives whose +format has changed, this exception is thrown. + +

unsupported_class_version

+An attempt has been made to load a class whose version has been incremented since the +program was written. Suppose that a class has been assigned version number 3 and the program +has been built and sent to third parties. Now suppose that the definition of that class +has been altered, the version number has been incremented to 4 and new archives have been +built. If one attempts to load these new archives with the original program, this +exception will be thrown. + +

pointer_conflict

+To understand what this exception means consider the following scenario +

+template<class Archive>
+void T::save(Archive &ar) const
+{
+    const A * aptr = &a;
+    ar << aptr;          // save an instance of object of class A through a pointer
+    ...
+    ar << a;             // save an instance of an object of class A
+    assert(aptr == &a);  // this must be true
+}
+
+template<class Archive>
+void T::load(Archive &ar)
+{
+    A * aptr;
+    ar >> aptr;          // create and initialize a new instance of class A
+    ...
+    ar >> a;             // restore state of on object of class A
+    assert(aptr == &a);  // this won't be true
+}
+
+An object is saved first through a pointer then directly. Upon loading back +in the same sequence, we first create an new object and load in its data. Then +we load the data into another existing object. Where we started with one +object during save, we have two objects after restore. In a more realistic +situation, it could be very difficult to find this error. Fortunately, +these situations can be detected when the archive is created. When +this occurs, this exception is thrown. + +

incompatible_native_format

+The library currently supports char text, wide char text and native binary +archive files. At the beginning of every archive, a signature is written indicating +the type of archive. This exception is thrown when an attempt is made to read +an archive written in a different format. + +

array_size_too_short

+An attempt has been made to read an array that is larger than the array size. +This should only occur when the size of an array in code is reduced after an +archive has already been created. + +

stream_error

+An error has occured during stream input or ouput. Aside from the common +situations such as a corrupted or truncated input file, there are +several less obvious ones that sometimes occur. +

+This includes +an attempt to read past the end of the file. Text files need a terminating +new line character at the end of the file which is appended when the +archive destructor is invoked. Be sure that an output archive on a stream +is destroyed before opening an input archive on that same stream. That is, +rather than using something like: +


+std::stringstream ss;
+std::vector<V> v;
+boost::archive::text_oarchive oa(ss);
+oa << v;
+boost::archive::text_iarchive ia(ss);
+ia >> v;
+
+use +

+std::stringstream ss;
+std::vector<V> v;
+{
+    boost::archive::text_oarchive oa(ss);
+    oa << v;
+}
+{
+    boost::archive::text_iarchive ia(ss);
+    ia >> v;
+}
+
+

+Another one is the passing of uninitialized data. In general, the behavior +of the serialization library when passed uninitialized data is undefined. +If it can be detected, it will invoke an assertion in debug builds. +Otherwise, depending on the type of archive, it may pass through without +incident or it may result in an archive with unexpected data in it. +This, in turn, can result in the throwing of this exception. + +

invalid_class_name

+Class name length greater than the maximum permitted. Most likely cause is a corrupted +archive or an attempt to insert virus via buffer overrun method. + +

unregistered_cast

+In order to support casting between pointers of base and derived classes +at runtime, a collection of legitimate conversions is maintained by the system. +Normally this collection is maintained without any explicit action +on the part of the user of the library. However, there are special cases +where this might have to be done explicitly and could be overlooked. This +is described in Runtime Casting. +This exception is thrown if an attempt is made to convert between two pointers +whose relationship has not been registered, + +

multiple_code_instantiation

+This exception is thrown when it is detected that the serialization of the same type +has been instantiated more that once. This might occur when +serialization code is instantiated in both the mainline and one or more DLLS. + +

xml_archive_parsing_error

+The XML generated by the serialization process is intimately coupled to the +C++ class structure, relationships between objects and the serialization +specifications. If these become out of sync in any way, the XML may not map +to the loading serialization and this exception might be thrown. This might +occur for one of the following reasons: +
    +
  • The archive has been edited outside the serialization system. This might +be possible if only the data is changed and not the XML attributes and nesting +structure is left unaltered. But any other editing is likely to render the +archive unreadable by the serialization library. +
  • The serialization has been altered and an archive generated by the old +code is being read. That is, versioning has not been properly employed to +properly deserialize previously created archives. +
+ +

xml_archive_tag_mismatch

+This exception will be thrown if the start or end tag of and XML element doesn't match +the name specified for the object in the program. + +

xml_archive_tag_name_error

+This exception will be thrown if the tag name contains invalid characters. Valid characters +for an XML tag are: upper and lower case letters, digits, and the following punctuation: .(period), +_(underscore), :(colon), and -(hyphen). + +
+

© Copyright Robert Ramey 2002-2004. +Distributed under 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) +

+ + diff --git a/deal.II/contrib/boost/libs/serialization/doc/extended_type_info.html b/deal.II/contrib/boost/libs/serialization/doc/extended_type_info.html new file mode 100644 index 0000000000..8f75cc13a1 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/doc/extended_type_info.html @@ -0,0 +1,418 @@ + + + + + + + +Serialization - extended_type_info + + + + + + + +
+

C++ Boost

+
+

Serialization

+

extended_type_info

+
+
+
+
Motivation +
Runtime Interface +
Requirements +
Models +
Example +
+ +

Motivation

+The serialization library needs a system like +type_info/typeid() to perform +the following functions +
    +
  1. + given a pointer to a type T discover the true type pointed to. +
  2. + given an "external" key - determine what type of object to create. +
+

The problem with std::type_info

+
    +
  • + The main function we require - std::typeid() + is not available in all environments. Support for this function depends upon + runtime typing(RTTI) support from the compiler. This may be non-existent + or not enabled for reasons such as a percieved inefficiency. +
  • + std::type_info includes a string + containing type name. This would seem to satisfy 2) above. + But the format of this string is not consistent accross compilers, libraries, + and operating systems. This makes it unusable for support of portable archives. +
  • + Even if the type name string could somehow be made portable, there is no + guarentee that class headers would be included in the same name space accross + different applications. In fact, including different headers in different + name spaces is an accepted method used to avoid name space conflicts. + Thus the namespace::class_name can't be used as a key. +
  • + There exists the possibility that different classes use different type id + mechanism. The class header might include this information. If we want to + import class headers accross applications, its convenient that the type id + mechanism support inter-operability accross different type id systems. +
+

Features

+ +extended_type_info is an implementation +of std::type_info functionality with the +following features: +
    +
  • + Builds a set of + extended_type_info records - one for each type + serialized. +
  • + permits association of an arbitrary string key with a type. Often this key would + be the class name - but it doesn't have to be. This key is referred to as + a GUID - Globally Unique IDentifier. Presumably it should be unique in the universe. + Typically this GUID would be in header files and be used to match type accross + applications. The macro BOOST_CLASS_EXPORT can be invoked to associate a string + key with any known type. We'll refer to these types as "exported types" +
  • + permits the "mixing" of type info systems. For example, one class might use + typeid() to find the external identifier + of a class while another might not. +
+ +Exported types are maintained in a global table so that given a string key, the +corresponding type can be found. This facility is used by the serialization library +in order to construct types serialized through a base class pointer. + +

Runtime Interface

+

+namespace boost { 
+namespace serialization {
+
+class extended_type_info
+{
+protected:
+    // this class can't be used as is. It's just the 
+    // common functionality for all type_info replacement
+    // systems.  Hence, make these protected
+    extended_type_info(
+        const unsigned int type_info_key,
+        const char * key
+    );
+    ~extended_type_info();
+    void key_register();
+    void key_unregister();
+public:
+    const char * get_key() const;
+    bool operator<(const extended_type_info &rhs) const;
+    bool operator==(const extended_type_info &rhs) const;
+    bool operator!=(const extended_type_info &rhs) const {
+        return !(operator==(rhs));
+    }
+    // for plugins
+    virtual void * construct(unsigned int count = 0, ...) const;
+    virtual void destroy(void const * const p) const;
+    static const extended_type_info * find(const char *key);
+};
+
+} // namespace serialization 
+} // namespace boost
+
+

+Generally, there will be one and only one +extended_type_info +instance created for each type. However, this is enforced only at the executable +module level. That is, if a program includes some shared libraries or DLLS, +there may be more than one instance of this class correponding to a particular type. +For this reason the comparison functions below can't just compare the addresses of +this instance but rather must be programmed to compare the the actual information +the instances contain. +

+ +


+extended_type_info(unsigned int type_info_key, const char *key);
+

+
+This constructor should be called by all derived classes. +The first argument should be the particular implementation. +For this default implementation base on typeid(), this is the +value 1. Each system must have its own integer. This value +is used to permit the inter-operability of different typeinfo +systems. +

+The second argument is a const string which is the external +name of the type to which this record corresponds. +It may sometimes be referred to as a GUID - a Global Unique IDentifier. +It is passed through archives from one program invocation to +another to uniquely identify the types that the archive contains. +If the "export" facility is not going to be used, +this value may be NULL. +

+ +


+void key_register();
+void key_unregister();
+

+
+This system maintains a global table which relates +external strings to +extended_type_info records. +This table is used when loading pointers to objects serialized +through a base class pointer. In this case, the archive +contains a string which is looked up in this table to +determine which extended_type_info +to use for creating a new object. +

+These functions are called by constructors and +destructors of classes which implement +extended_type_info +to add and remove entries from this table. +

+ +


+const char *get_key() const;
+

+
+Retrieves the key for extended_type_info +instance. If no key has been associated with the instance, then a NULL is returned. +
+ +


+bool operator<(const extended_type_info & rhs) const;
+bool operator==(const extended_type_info & rhs) const;
+bool operator!=(const extended_type_info & rhs) const;
+

+
+These functions are used to compare 'wo + + +extended_type_info + + +objects. They impose a strict total ordering on all +extended_type_info records. +
+ +


+virtual void * construct(unsigned int count = 0, ...) const;
+

+
+Construct a new instance of the type to which this + + +extended_type_info + + +record corresponds. This function takes variable list of up to 4 arguments +of any type. These arguments are passed to the type's constructor +at runtime. In order to use the facility, +one must declare a type sequence for the constructor arguments. +Arguments for this function must match in number and type +with those specified when the type was exported. +This function permits one to create instances of +any exported type given only the exported GUID assigned +with BOOST_CLASS_EXPORT. +If these types are defined in DLLS or shared libraries. When these modules +are loaded at runtime, these constructor can be called until the module +is unloaded. These modules are referred to as plugin. + +
+ +


+virtual void destroy(void const * const p) const;
+

+
+Destroy an instance created by the above constructor. +
+ +


+static const extended_type_info * find(const char *key);
+

+
+Given a character string key or GUID, return the address of a +corresponding extended_type_info +object. + +
+ +

Requirements for and Implementation

+In order to be used by the serialization library, an implementation of +extended_type_info, +(referred to as ETI here), must be derived from + + +extended_type_info + + +and also implement the following: + +
+ +

+template<class ETI>
+const extended_type_info *
+ETI::get_derived_extended_type_info(const T & t) const;
+

+
+Return a pointer to the +extended_type_info +instance that corresponds to +the "true type" of the type T. The "true type" is the lowest type in the +hierarchy of classes. The type T can always be cast to the "true type" with +a static cast. Implemention of this function will vary among type id systems +and sometimes will make presumptions about the type T than can be identified +with a particular extended_type_info implementation. +
+ +

+virtual bool ETI::is_less_than(const extended_type_info &rhs) const;
+

+
+Compare this instance to another one using the same +extended_type_info implementation. +
+ +

+virtual bool ETI::is_equal(const extended_type_info &rhs) const;
+

+
+Compare this instance to another one using the same +extended_type_info implementation. +Return true if the types referred +to are the same. Otherwise return +false +
+ +

+const char ETI::get_key() const;
+

+
+Retrieve the external key (aka GUID) for this class. +
+ +

+virtual void * construct(unsigned int count, ...) const;
+

+
+Construct an instance of the corresponding type +with the include argument list. +
+ +

+virtual void * destroy(void const * const ptr ) ) const;
+

+
+Destroy an instance of this type. This calls the +proper destructor and recovers allocated memory. +
+ +
+ +

Models

+The serialization library includes two distinct +extended_type_info +implementatio's. +

+

+extended_type_info_typeid

is implemented in terms of the standard typeid(). It presumes that RTTI support is enabled +by the compiler. +

+

+extended_type_info_no_rtti

+is implemented in a way that doesn't rely on the existence RTTI. +Instead, it requires that all polymorphic types be explictly exported. +In addition, if the export facility is to be used to serialize types +through base class pointers, those types are required to implement +a virtual function with the signature: + +
+virtual const char * get_key();
+
+which returns a unique string the most derived object this class. +This function must be virtual in order to implement the functionality required by +ETI::get_derived_extended_type_info +as described above. + +

Example

+The test program test_no_rtti +implements this function in terms of the +extended_type_info API above to return the export key associated with the class. +This requires that non-abstract types be exported. It also demonstrates the +inter-operability with between two different implementations of +extended_type_info. + +

Requirements for Each Type

+Each type to be managed by the system must be +"registered" individually. This is accomplished by instantiating +templates. For example, if the type T is to use the type_info system +one would include the following code: + +
+namespace boost {
+namespace serialization {
+template
+struct extended_type_info_typeid>T>;
+template
+struct extended_type_info_typeid>const T>;
+} // serialization
+} // boost
+
+ +For those using the serialization library, this step can be skipped +as it is done automatically. The serialization library includes +the macro: + +
+BOOST_CLASS_TYPE_INFO(
+    my_type, 
+    extended_type_info_typeid>my_class>
+)
+
+ +which is used to specify which extended_type_info system is to +be used for a given type. +

+extended_type_info includes a facility for constructing +instances of types without knowing what the exact types are. This is done +with the function + +virtual void * extended_type_info::construct(unsigned int count = 0, ...) const; + +. For example: +
+

+struct base {
+...
+};
+struct derived : public base {
+...
+};
+...
+extended_type_info *eti = extended_type_info::find("my_class")
+base * b = eti->construct(...);
+
+
+The construct takes an argument count and up to +four parameters of any type. The arguments are passed to the +constructor of "my_class". + + +A complete example of this can be found +here +
+

© Copyright Robert Ramey 2005-2009. +Distributed under 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) +

+ + diff --git a/deal.II/contrib/boost/libs/serialization/doc/faq.html b/deal.II/contrib/boost/libs/serialization/doc/faq.html new file mode 100644 index 0000000000..5830b8f95b --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/doc/faq.html @@ -0,0 +1,53 @@ + + + + + + + + Serialization - Tips and Tricks + + + + + + + +
+

+ + C++ Boost

+
+

+ Serialization

+

+ Tips and Tricks

+
+
+This section will be used to list answers to questions raise in the mailing +lists. Most of these are due to subtle aspects of the library which are +overlooked even though they might be described in the documenation. Often, +these issues are very easy to address - but can be excruciating difficult to +find. Should you have such an experience, feel free to vent your frustration +in a constructive way by adding in your own item. The best way to do this +is to create a "TRAK" item +which includes the text you want to add to this list. + +
    +
  • + Differences from Boost 1.37

    +
  • +
+
+

+ © Copyright Robert Ramey 2002-2009. Distributed + under 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) +

+ + diff --git a/deal.II/contrib/boost/libs/serialization/doc/headers.html b/deal.II/contrib/boost/libs/serialization/doc/headers.html new file mode 100644 index 0000000000..057c326735 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/doc/headers.html @@ -0,0 +1,447 @@ + + + + + + + +Serialization - Code Structure + + + + + + + +
+

C++ Boost

+
+

Serialization

+

Code Structure

+
+
+ +
+
Files Included by User Programs +
+
Archive Implementations +
Serialization Declarations +
Serialization Implementations +
+
Files Which Implement the Library +
+
Archive Development +
Archive Internals +
Archive Library Code Modules +
Dataflow Iterators +
+
+ +This library includes a large number of files. The are organized and classified +according to purpose listed in the above index. +

+namespace of a classes and templates is syncronized +with the directory in which the file is found. For example, the class declaration +


+boost::archive::text_oarchive
+
+is included with the following declaration +

+#include <boost/archive/text_oarchive.hpp>
+
+ + +

Files Included by User Programs

+Using this library entails including headers listed in this section. +It should not be necessary to explictly include any other header files. + +
+

Archive Implementations

+These header files contain declarations used to save and restore data to each type +of archive. Include the archives according to the facilities the code module requires. + +
+ +
+boost/archive/archive_exception.hpp + +
Exceptions which might be invoked by the library.
+ +
+boost/archive/binary_iarchive.hpp + +
native binary input archive used for loading.
+ +
+boost/archive/binary_oarchive.hpp + +
native binary output archive used for saving.
+ +
+boost/archive/text_iarchive.hpp + +
text input archive used for loading.
+ +
+boost/archive/text_oarchive.hpp + +
text output archive used for saving.
+ +
+boost/archive/text_wiarchive.hpp + +
wide character text input archive used forloading.
+ +
+boost/archive/text_woarchive.hpp + +
wide character text input archive used for saving.
+ +
+boost/archive/xml_iarchive.hpp + +
xml input archive used for loading.
+ +
+boost/archive/xml_oarchive.hpp + +
xml output archive used for saving.
+ +
+boost/archive/xml_wiarchive.hpp + +
wide character xml input archive used for loading.
+ +
+boost/archive/xml_woarchive.hpp + +
wide character xml output archive used for saving.
+ +
+ + +

Serialization Declarations

+To specify how a type is serialized, one codes templates for serialization functions. +In the simplest cases, this does not require the inclusion of any header files for this purpose. +In most cases one or more of the following header files will have to be included in order +to complete or refine the description of the serializaition implementation for a given class. + +
+ +
+boost/serialization/base_object.hpp + +
For serialization of base classes.
+ +
+boost/serialization/nvp.hpp + +
To associate a name tag with a serializable object. This is necessary to +properly render an xml archive which includes the object name.
+ +
+boost/serialization/split_free.hpp + +
To divide implementation of non-intrusive serialization into separate +save and load functions.
+ +
+boost/serialization/split_member.hpp + +
To divide implementation of intrusive serialization into separate +save and load functions.
+ +
+boost/serialization/export.hpp + +
For serialization of pointers to derived classes via key export.
+ +
+boost/serialization/assume_abstract.hpp + +
This is just a thin wrapper which permits one to explicitly specify that a +particular type is an abstract base class. It is necessary to use this +for compilers which don't support the boost type traits implementation of +is_abstact. +
+ +
+ +This group will be required less frequently. The are used to override aspects of +the default implementation of the serialization process for specified types. + +
+ +
+boost/serialization/version.hpp + +
To override the default version index (0) assigned to a class.
+ +
+boost/serialization/level.hpp + +
To override the default implementaton level trait for a type.
+ +
+boost/serialization/tracking.hpp + +
To override the default tracking trait for a type.
+ +
+boost/serialization/type_info_implementation.hpp + +
By default, the library uses RTTI, to identify types at runtime. In some cases, E.G. +such as a platform which doesn't implement RTTI, this header can be included to permit +the override of the default runtime type identification system.
+ +
+ + +

Serialization Implementations

+This group of headers includes templates which implement serialization for Standard +Library or Boost Library templates. Any program which uses these templates can +invoke serialization of objects of these types just by including the corresponding header. +

+By convention' these header files are named: + +boost/serialization/xxx.hpp + +where xxx is the name of the header file which contains the type to be serialized. +For example, the declaration +


+#include <boost/serialization/list.hpp>
+
+ +includes the code to implement serialization of the STL +std::list type. While + +

+#include <boost/serialization/shared_ptr.hpp>
+
+ +includes code to implement serialization of the BOOST boost::shared_ptr type. + +Note that including the serialization header for a type automatically includes the +appropriate header of the type to be serialized. + +As of this writing, the library includes templates of all STL library templates as well +as templates for boost::optional, +boost::shared_ptr, and +boost::scoped_ptr. +Presumably, this list will expand with the passage of time. + +
+

Files Which Implement the Library

+ +
+

Archive Development

+These header files contain declarations for basic types used to create +concrete archive types that are made available to users above. Users wishing +to make their own type of archive may want to examine these headers to +see how the archives included with the libary have been constructed. + +
+ +
+boost/archive/basic_archive.hpp + +
+
+This file includes declarations for certain types that have to be accounted +for in all archive implementations. The serialization system relies on +certain special types such as class_id_type and others to +record information in archives that is required to reconstruct the original +data structure. These are handled exactly as any other serializable type. +That is, the can be handled as simple primitives such as they are in simple +text files, or with special code as they are in xml archives. +
+ +
+boost/archive/basic_text_oprimitive.hpp + +
+boost/archive/basic_text_iprimitive.hpp + +
+
+Implementation of serialization of primitive types in terms of an character +or wide character text streams. This is used in the implementation of text and +xml archives. Presumably this would be useful for implementations of other variations +of text archives such as user friendly text or windows ini files. +
+ +
+boost/archive/basic_binary_oprimitive.hpp + +
+boost/archive/basic_binary_iprimitive.hpp + +
+
+Implementation of serialization of primitive types in terms of an character +or wide character binary streams. +
+ +
+boost/archive/basic_binary_oarchive.hpp + +
+boost/archive/basic_binary_iarchive.hpp + +
+Implementation of serialization of all types in terms of an character +or wide character binary streams. This is factored out separately from the +implementation of binary primitives above. This may facilitate the creation of +other types of binary archives in the future. It also preserves analogy and symetry with +the rest of the library which aids in understanding. +
+
+boost/archive/basic_text_oarchive.hpp + +
+boost/archive/basic_text_iarchive.hpp + +
+
+boost/archive/basic_xml_oarchive.hpp + +
+boost/archive/basic_xml_iarchive.hpp + +
+
+Implementation of serialization of all types in terms of an character +or wide character text streams. These classes specify archive type specific +behavior on a type by type basis. For example, basic_xml_oarchive.hpp +includes code to guarentee that any object not attached to a name will +trap during compile time. On the other hand, basic_text_oarchive.hpp +contains code to strip out and ingore any names attached to objects. +

+

+boost/archive/detail/common_iarchive.hpp + +
+boost/archive/detail/common_oarchive.hpp + +
+All archive implementations are derived from these header files. They provide +the interface to the internal implementation details of the library. +
+ +
+ + +

Archive Internals

+ +The interface (see
Archive Concepts) +and implementation are factored out into separate classes to minimize code duplication. + +These files are found in the directory +boost/archive/detail. +These are included as necessary by the archive class implemenations listed above. +This has the unfortunate side effect of making the implementation less transparent. +of the library in order to implement either a class serialization or a new +archive type. Users should never find it necessary to change these files. +

+The following discussion is based on the +class diagram. +

+

+boost/archive/detail/interface_iarchive.hpp +
+boost/archive/detail/interface_iarchive.hpp +
+Here are the declarations and definitions which for the +archive_concept. This class redirects calls to the +archive interface to a function named save_override in the most derived +archive class. +
+save_override is declared and implemented in each class in +the archive hierarchy. + +

+template
+void save_override(T & t, BOOST_PFTO int){
+    // All for otherwise unhandled types are forwarded to the base class.
+    // This emulates behavior for function overloading.
+    this->base::save_override(t, 0);
+}
+void save_override(const some_type & t, int){
+    // any special handling for some type
+    // this will usually entail forwarding some other operation
+    // in the most derived class.
+    this->This()->...
+    // or in one of its parents basic_text_oprimitive
+    this->This()->save(static_cast<int>(t));
+}
+... // other special type handling
+
+ +Note the usage of +Partial Function Template Ordering +to permit the correct save implementation to be selected. + + + +

Archive Library Code Modules

+Parts of the library are implemented as library code. All of this code is to be found in +
libs/serialization/src. +in the form of *.cpp. The directory +boost/archive/impl +contains *.ipp files which implement templates. These templates are instantiated +only by archive implementation so are generally not included in user code modules. +

+The trade offs related to library implementation via pre-compiled code and templated +headers are well known. This library uses both. It uses templated headers +to generate code to serialize user and primitive types and it uses pre-compiled +library code for that part of the code which only depends upon the archive type. +Building of the library generates and compiles code for all archives implemented. + +

    +
  • Serialization of user and primitive types runs a top speed. This is a noticiable + difference with a previous version of the library which did not use templates for archives. +
  • Library implementation code that never changes need only be compiled once + rather than each time a user's program is recompiled. This can save much + development time. +
  • Headers which solely related to implementation need only be included + in the library code modules. This prevents a user program from accidently + depending on an implementation feature of the serialization library. +
  • In building the library I came to the conclusions that there can arise + situations regarding static code/data instantiation that could not be + satisfactorily addressed without a code module. Unfortunately, I've forgotten + the circumstances which led me to this conclusion. +
+An example of this is the usage of the spirit library in the library. +It takes a long time to compile and includes lots of other files. Having this +only in the library is much more convenient that having to include in every +program which uses xml serialization. + + +

Dataflow Iterators

+In the course of developing this library, it became convenient to make a set +of composable iterator adaptors for handling archive text. Applications include +escaping and unescaping xml text, implementi'g to/from base64 conversion among +others. +

+This is a ripe topic in itself. Its touched upon by the +boost iterator libraries, +View Template Library, and others. +

+The code for these iterators is really independent of this library. But since it +hasn't been and probably won't be reviewed outside of this context. I've left in a directory +local to the serialization library: +boost/archive/iterators. +These iterators are described in +Dataflow Iterators. +


+

© Copyright Robert Ramey 2002-2004. +Distributed under 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) +

+ + diff --git a/deal.II/contrib/boost/libs/serialization/doc/history.html b/deal.II/contrib/boost/libs/serialization/doc/history.html new file mode 100644 index 0000000000..bf3662f003 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/doc/history.html @@ -0,0 +1,141 @@ + + + + + + + +Serialization - History + + + + + + + +
+

C++ Boost

+
+

Serialization

+

History

+
+
+
    +
  1. 26 Feb 2002 initial version uploaded to boost +
  2. 27 Feb 2002 +
      +
    • divide interface from implementation for class + serialization to permit compiliation on gcc +
    • improved template instantanciation for type templates +
    +
  3. 18 Mar 2002 - draft #2 uploaded to boost +
      +
    • elminated locale effects on archives +
    • added signature and library version to archive header +
    • improved detection of errors when objects are serializationed + as pointers and subsequently serializationed as objects +
    • permit non-portable binary archives +
    • implement work around for systems such as MSVC 6.0 that + don'tsupport partial ordering +
    +
  4. 16 May 2002 - draft #3 uploaded to boost +
      +
    • Ability to specify serialization of other templates in a + non-intrusive way. +
    • Included and example which uses boost::shared_ptr. +
    • improved documentation +
    • More test cases +
    • More testing and documentation of obscure situtations +
    • Better code organization for transparency +
    • Wide character support implemented and tested with unicode. +
    +
  5. 28 Jun 2002 - #4 library submission +
      +
    • minor corrections +
    • replaced erroneous shared_ptr example with std::auto_ptr example +
    • prevention of memory leaks when exceptions are invoked +
    +
  6. 30 Aug 2002 - #5 library submission +
      +
    • minor corrections +
    • Additions to documentation to explicitly address issues of + exception safety. +
    • More test cases/demos to illustrate handlling of the above issues. +
    • Additions to documentation to include rationale for not depending + on type_id +
    • Implementation of serialization of boost::shared_ptr. + This is included as a demo as it depends upon a minor alteration + of boost::shared_count. +
    +
  7. 08 Nov 2002 - #6 library submission +
      +
    • minor corrections +
    • corrected error which manifested itself when serializing + polymorphic pointers to obects derived from multiple + base classes +
    • minor adjustments to support plug-ins via virtual + save/load/version functions +
    • test cases to support the above +
    +
  8. 08 September 2003- version # 12 library submission +
      +
    • attempts to address all issues raised during the November 2002 review +
    +
  9. November 2003 - draft #13 uploaded +
      +
    • corrections, enhancements, change in api for pointer overload +
    +
  10. 28 December 2003 +
      +
    • implementation of save/loadbinary +
    • enhancements included archives to permit derivation +
    +
  11. 1 March 2004 - draft # 17 upload +
      +
    • portability to intel 8.0, and VC 6.0 +
    • Alter archive implementation to permit derivation. Make tests. +
    • Implement serialize/save/load binary for text and XML archives + using base64 character encoding. +
    • Added documentation and test for serialization of large binary objects. +
    • Added "Derivation from an Existing Archive Class" to documentation along + with example program. +
    • Added PIMPL example +
    • certain special situations are now detected and addressed at + compile time to generate all in-line code. For example, for types + serialized without class information, and without memory tracking, + the serialization process can be reduced to a minimal amount of inline + code. +
    • All tests have been run in release as well as debug mode +
    • Many improvements in code and documentation to improve accuracy and completeness. +
    +
  12. 11 April 2004 - draft # 18 upload +
      +
    • Reorganization of header and template files. +
    • Enhanced documentation to help explain implementation issues. +
    • Adjustments to improve support for less conformant compilers. +
    • A few bug fixes. +
    +
  13. 31 May 2004 - draft # 20 upload +
      +
    • Polymorphic archives. +
    • A few bug fixes. +
    +
  14. 1 November 2004 - final changes for first boost official release 1.32 . +
      +
    • Adjustments to address make package compatible with two-phase lookup. +
    • Many small adjustments to accomdate quirks of various compilers. +
    • A few bug fixes. +
    +
+
+

© Copyright Robert Ramey 2002-2004. +Distributed under 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) +

+ + diff --git a/deal.II/contrib/boost/libs/serialization/doc/implementation.html b/deal.II/contrib/boost/libs/serialization/doc/implementation.html new file mode 100644 index 0000000000..b1e20c3eb2 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/doc/implementation.html @@ -0,0 +1,443 @@ + + + + + + + +Serialization - Implementation Notes + + + + + + + +
+

C++ Boost

+
+

Serialization

+

Implementation Notes

+
+
+
+
Partial Function Template Ordering +
Character Encoding +
Template Invocation syntax +
Partial Template Specialization +
Specific Compiler/Library Issues +
+
GCC 3.X, 4.X +
GCC 2.95 +
Intel 8.0 +
Visual C++ 8.0 +
Visual C++ 7.1 +
Visual C++ 7.0 +
Visual C++ 6.0 +
Borland 5.64 and 5.51 +
Comeau 4.3.3 +
Code Warrior 9.x +
Code Warrior 8.3 +
TRU64 +
Dinkumware Library +
STLPort 4.5.3 +
+
+ +

Partial Function Template Ordering

+Not all C++ compilers correctly support partial function template ordering (PFTO). +For these compilers, the following code will fail to compile: +

+template<class Archive, class T>
+void serialize(
+    Archive & ar, 
+    T & t, 
+    const unsigned int file_version
+){
+    ...
+}
+
+template<class Archive, class T>
+void serialize(
+    Archive & ar, 
+    my_template<T> & t, 
+    const unsigned int file_version
+){
+    ...
+}
+
+The serialization library works around this issue by using a different +default definition of the first template: +

+template<class Archive, class T>
+void serialize(
+    Archive & ar, 
+    T & t, 
+    const unsigned long int file_version  // Note: change to long
+){
+    ...
+}
+
+Now, the second template is not matched with the first one so there +is no PFTO and no compile error. When the serialization library invokes +

+serialize(ar, t, 0);
+
+the function declaration is first matched against templates with +an integer for the third argument. If there is a match, the matching +template is instantiated and later invoked. If there is no match, +an attempt is made to match other templates by converting arguments to other types. +In this case the third argument can be converted to long to match +the first template - which is the default. So in this case, the first +template will be instantiated and later invoked. We have managed to +use function overloading to achieve the same effect as PFTO +were it correctly implemented. +

+This depends upon undefined behavior of a compiler already +determined to be non-conforming. In other words, there is no +guarantee that this will work on all compilers. If a compiler does not +correctly support PFTO and this method cannot be used to workaround +it, non-intrusive serialization cannot be supported for that compiler. +As of this writing, such a compiler has not been encountered. +

+It turns out that using this "trick" can create problems with +compilers that DO correctly support PFTO. For this reason we +define a macro BOOST_PTFO which +is defined to be long +for non-conforming compilers and nothing for conforming ones. So +the default definition is really: +The serialization library works around this issue by using a different +default definition of the first template: +


+template<class Archive, class T>
+void serialize(
+    Archive & ar, 
+    T & t, 
+    const unsigned BOOST_PFTO int file_version  // Note: change to BOOST_PFTO
+){
+    ...
+}
+
+ +

Character Encoding

+The whole question of character encoding combined with wide characters +is much more complicated than it would seem to be. The current library +defines in 3 formats (text, binary, and XML), wide and narrow characters, +an attempts to be portable between compiler libraries. The results of +a rather long consideration of all these factors has been to set +default encoding according to the following rules. +
    +
  • All text archives (i.e. text_?archive) will produce + text output in the current stream locale. Generally this will + produce no changes in string data. +
  • To produce binary output with Microsoft compilers, the stream + will have to be opened with mode ios::binary. + Failure to do so will result in 0x0d characters (carriage-return) + characters being removed from the input stream if they are followed + by a 0x0a character (line-feed). This could corrupt the input + and make the file unreadable. On UNIX systems the ios::binary + is not required and is ignored if used. +
  • character XML archives (i.e. xml_oarchive) will produce XML output + with characters encoded according to the current stream locale. +
  • wide character XML archives (i.e. xml_woarchive) will produce + files encoded in UTF-8. +
+This character encoding is implemented by changing the locale of the +i/o stream used by an archive when the archive is constructed, the stream +local is changed back to its original value. This action can be overridden +by specifying boost::archive::no_codecvt +when the archive is opened. In this case, the stream locale will +not be changed by the serialization library. +

+Note that the code conversion included for wide character text and XML +archives could alter std::string data stored in archives. +Suppose a normal (multi-byte) character string +is written to a wide character stream. Our system uses the current locale +to translate it to a wide character string before writing it out. +Upon reading, it is translated back to a (multi-byte)string. +If the locale on the platform that reads the archive is different than +the locale on the platform that wrote the stream, the actual string data +may be altered by the serialization process. To avoid this, either +avoid usage of locale dependent multi-byte strings or be sure that +the locale is set correctly before reading the archive. +

+To produce wide character text output (i.e. 16 bit characters on Win32 systems), +do the following. +

    +
  • Open a wide character stream. +
  • Alter the stream locale to use + boost::archive::codecvt_null<OStream::char_type> +
  • Create the archive with the flag no_codecvt. +
+Naturally, the input process has to be symmetrical. +

Partial Template Specialization

+Compilers which fail to support partial template specialization will fail to compile +the following code. To make this compiler, the const has to be removed. +

+void f(A const* a, text_oarchive& oa)
+{
+  oa << a;
+}
+
+

Template Invocation syntax

+Some compilers may not recognize the syntax: +

+ar.template register_type<T>();
+
+for "registering" derived pointers of polymorphic classes. The actual +function prototype is: +

+template<T>
+void register_type(T * t = NULL);
+
+so that one may write ar.register_type(static_cast<T *>(NULL)) instead of +the syntax described above. + +

Specific Compiler/Library Issues

+ +

GCC 3.X, 4.X

+
    +
  • GCC versions for Cygwin and MinGW fail to support wide character I/O. + So all tests using wide char I/O fail. Note that if wide character I/O support + is added with STLPort, all tests complete successfully. +
  • This compiler generates long warning messages related to the usage of + non virtual destructors in polymorphic classes. These warnings have been + carefully considered and the code that generates these warning has been + unchanged. In this case the warning should should be ignored as in certain + usages of the library, making the destructors virtual could lead to problems. + As an alternative, base class destructors have been made "protected" to + address the concerns that motivate these warning messages. When building + the serialization library and tests with bjam, these warnings are suppressed. + When building one's own applications, these warnings can be suppressed by + adding the following to the compiler command line: +
    
    +    -Wno-non-virtual-dtor
    +    -Wno-ctor-dtor-privacy
    +    
    +
+

GCC 2.95

+All of the above plus:
+
    +
  • The serialization library depends on the templated stream + implementation to function properly. + to function properly. So STLPort must be used to build the library. +
  • Polymorphic archive tests fail. +
  • XML serialization only works with version 1.6x of spirit. In order to build + and use this library with this compiler, one must use version 1.6x rather than the + latest version shipped with boost. See Release Notes. +
+

Intel C++ 8.0

+No known issues. All tests compile and run in debug and release modes. + +

Visual C++ 8.0

+This compiler emits warnings for calls to functions from the standard +library which are deemed security risks. The serialization depends upon +making some of these calls so programs which use the serialization library +will get warning messages. These messages can be suppressed from the command +line by including the following switch: +

+    /wd4996
+    
+ +

Visual C++ 7.1

+Derivation from an archive class defined in a DLL as described in ... will not work. +This is due to the way that VC++ handles templated code with __decl(dllexport) and +__decl(dllimport) specifications. Basically, this compiler requires that all the +instantiations have the same specification - even though they have different +template arguments. The example +demo_portable_iarchive.cpp would have to reformulated as a library or dll +similar to the pre-defined archives in order to function. +

+This compiler does not have RTTI or exception handling turned on by default. Although +they are not strictly necessary to use the serialization package, the example and test +program presume that they are enabled. So be sure your command line or IDE settings +enable these features if you want to build and run these programs. +

+This compiler can treat wchar_t as either +a short integer or an intrinsic type. +If /Zc:wchar_t is specified on the +compile command line, wchar_t will be +considered an intrinsic type - otherwise +it will be treated as a synonym for a 16 bit integer. The library can be used +either way - BUT - both the libray AND the application +must be compiled with the same switch settings. Note that BJAM +includes this switch by default. So if want to use the libraries that +BJAM builds, you should include this switch +when you compile your own applications. +

Using the Visual C++ IDE
+The library includes a VC++ 7.1 "Solution" - BoostSerializationLibrary +along with of a set of project files - one for each demo and test. Consider the following if you +decided to use these configurations. +
    +
  • The projects assume that the tests have been built with bjam using the default + locations. This will result in a bin subdirectory + within one's main boost directory. Below this there is a whole structure which maintains + object and library files according to the type of build. The easiest way to build this is to + invoke the runtest script which uses bjam. (see below) If the libraries are not in these locations, + the projects will have to be modified accordingly. +
  • There are project configurations for all the combinations of build variants that boost + supports. That is for release, debug, static, static multi-threading, etc.. +
  • If you want to use/debug the DLL versions of libraries and corresponding tests, alter + the project file to define BOOST_ALL_DYN_LINK=1. + Note that for the executables to run, the PATH + environmental variable will have to include the directories that contain the DLL versions of + the boost libraries. +
  • If you have difficulties building your own projects and linking with the boost libraries, + compare the project settings of your own projects with the ones here. VC sometimes requires + consistent settings between projects and the libraries they use in order to link properly. + In particular, check support for exceptions, runtime typing(RTTI), and intrinsic support for + wide characters. The standard version of this library presumes that these facilities are + enabled. Projects generated by the IDE wizard do not have these features enabled by default. +
  • Frequently when trying to build a project or view project properties, one is presented with + a message box with the message "unspecified error". This seems to occur when one changes the + build configuration selection. It turns out this can be "fixed" by going to the "Build" + menu item, selecting "Configuration Manager" and selecting a build configuration for the project + you're working with. +
  • To test that boost libraries are built correctly, one can build and test them the way we do. + This entails: +
      +
    1. downloading a copy of bjam.exe +
    2. building process_jam_log +
    3. building compiler_status +
    4. invoking runtest.bat +
    + This will build the serialization library and run the tests on your system. If there are more than a + a couple of test failures, you likely won't be able to get your own projects working. If most of the + tests pass, you can be confident that your own projects will work once you get your project settings + in sync with those included here. +
+ +

Visual C++ 7.0

+
    +
  • The "pimpl" demo fails to link. Cause and workaround for this is unknown +
  • XML serialization only works with version 1.6x of spirit. In order to build and use this + library with this compiler, one must use version 1.6x rather than the latest version + shipped with boost. See Release Notes. +
  • This compiler does not support partial template specialization. + The implementation of the new shared_ptr serialization depends upon + compiler support for partial template specialization. This compiler doesn't implement this + feature. In order to serialize shared_ptr<A>, + invoke the macro BOOST_SERIALIZATION_SHARED_PTR(A) + in the header code. +
  • Lack of support for partial template specialization also creates problems for + serialization of std::map. In order to serialize + instances of this type include the invocation of BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION + for the key type of the map. +
+

Visual C++ 6.5

+all the above issues for Visual C++ 7.0 plus: +
    +
  • Out of line template definitions are not recognized and fail with a confusing + error message. To function save/load/serialize member function templates must be defined + within the class definition. This feature is essential to demo_pimpl. Hence, + this program will fail to compile. In this case the problem can't be worked around and + still demonstrate this facility. +
  • This compiler does not support wchar_t as a separate type. It defines + wchar_t as an alias for short int. In general things will still + function. However certain customization, such as overloading archive operators for + saving/loading wide character arrays would produce surprises in this environment. +
  • Under certain circumstances, a program will fail to link with the message: + LIN1179 - "invalid or corrupt file: duplicate comdat". According + to + http://groups.google.com/groups?th=8a05c82c4ffee280 + (look for P78) + A LNK1179 error occurs when: +
      +
    • The template class takes at least two arguments. +
    • The template is used at least two times with identical first + and different second arguments. +
    • The static member variable is of an object type with at least one + base class. (In another scenario it also occurred using a member + without a base class.) +
    + Working around this in the implementation of the library for this compiler + entailed a ridiculous amount of effort. Even so, the effort wasn't entirely successful. + With this compiler, this message will still appear under the following conditions: +
      +
    • When serializing a class with multiple base classes. This problem causes two + failure in the test suite. I have been unable to devise a way to work around this. +
    • Using more than one kind of archive in the same code module. This should be easy + to work around in practice. +
    +
  • Code modules exceeding some undetermined size that use the library will fail with + fatal error C1204: compiler limit : internal structure overflow. This can be addressed + by dividing the module into smaller ones. +
+

Borland 5.64 and 5.51

+
    +
  • enum data members cannot be serialized. + Conversion to/from integers will work around the problem. +
  • If class serialize functions are not accessible either by making them public or by + including friend declarations as described in + Class Serialization - Member Function, the + will compile but fail at runtime. +
  • Tests using custom extended type which doesn't use RTTI fails. (5.64 only !). +
  • Tests built in release mode fail. This seems to be an issue with the boost test system + with this compiler. +
  • XML serialization only works with version 1.6x of spirit. In order to build + and use this library with this compiler, one must use version 1.6x rather than the + latest version shipped with boost. See Release Notes. +
+

Comeau 4.3.3

+
    +
  • This compiler fails to make a DLL with export under windows. +
  • The associated library - libcomo fails when using a codecvt facet. + This generates a failure with all wide character archives. +
  • the test_set fails by going into an infinite memory leak. +
+ +

Code Warrior 9.x

+
    +
  • Some tests and demos demos fail - still under investigation +
+ +

Code Warrior 8.3

+all the above issues for Code Warrior 9.x plus: +
    +
  • This compiler only supports templated streams with the static library version. +
  • The above inhibits the build of DLL versions of the library. +
  • Some demos fail - still under investigation +
+ +

TRU64

+All tests and demos pass except for test_variant. Boost Variant doesn't function +wih this compiler + +

Dinkumware Library

+Several compilers, including Visual C++ 6.0, use an older dinkumware library. +These platforms have several issues: +
    +
  • The dinkumware library shipped with this compiler does not change the locale facet + of an i/o stream unless the imbue function is called before the the + stream is opened. In order to use this library with this environment to generate UTF-8 + files, one cannot depend on the "automatic" setting of locale that archives implement. The + stream locale must be set explicitly on the stream before an archive is opened on it. The + archive should be opened with the no_codecvt flag. Note this problem will + occur on all compilers shipped with this library. +
  • Other issues have been worked around in the file. + dinkumware.hpp +
+ +

STLPort 4.5.3

+
    +
  • when built to use dynamic linking versions of C++ runtime code (dynamic) + all tests fail to link. This is due to a missing symbol in the stlport library related + to custom codecvt facets. +
  • the test_set fails to run correctly. It seems the hashed set iterator doesn't + implement the ++ operator correctly. This causes the test to fail by consuming all available + memory. Given this, this test is commented out. +
+ +
+

Revised 1 November, 2004 +

© Copyright Robert Ramey 2002-2004. +Distributed under 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) +

+ + diff --git a/deal.II/contrib/boost/libs/serialization/doc/index.html b/deal.II/contrib/boost/libs/serialization/doc/index.html new file mode 100644 index 0000000000..38dc3429ed --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/doc/index.html @@ -0,0 +1,19 @@ + + + + + +Serialization + + + + + <a href="overview.html"</a> + + diff --git a/deal.II/contrib/boost/libs/serialization/doc/minus.gif b/deal.II/contrib/boost/libs/serialization/doc/minus.gif new file mode 100644 index 0000000000..fe9830a16f Binary files /dev/null and b/deal.II/contrib/boost/libs/serialization/doc/minus.gif differ diff --git a/deal.II/contrib/boost/libs/serialization/doc/new_case_studies.html b/deal.II/contrib/boost/libs/serialization/doc/new_case_studies.html new file mode 100644 index 0000000000..5ad9d4f01e --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/doc/new_case_studies.html @@ -0,0 +1,91 @@ + + + + + + + +Serialization - Proposed Case Studies + + + + + + + +
+

C++ Boost

+
+

Serialization

+

Proposed Case Studies

+
+
+
+
Serializing a Function Object
+
Archive Adaptors
+
Archive Helpers
+
+ +These are not part of the library itself, but rather +techiques on how to use the library to address specific situations. + +

Serializing a Function Object

+An example on how to serialize a function object. I believe this +could be done by serializing pointer to the object in question. Since +the Serialization library resurrects pointer of the correct type +this should be easily implementable. +

+If a group of function objects were all derived from the +same polymorphic base class - perhaps via multiple inheritance, +the the function object effectively becomes a "variable" which +encapsulates code. +

+This case study would show how to do this. + +

Archive Adaptors

+ +Often users want to add their own special functionality to an +existing archive. Examples of this are performance enhancements +for specific types, Adjustment of output syntax for xml archives, +and logging/debug output as archives are written and/or read. +If this functionalty is implemented as an "adaptor" template +which takes the base class as a template argument, such functionality +appended to any archive for which that funtionality makes sense. +For example, an adaptor for generating an xml schema could be +appended to both wide narrow character versions of xml archives. +

+This case study would show how to make a useful archive adaptor. + +

Archive Helpers

+Some types are not serializable as they stand. That is - they +do not fullfill the requirements of the "Serializable Concept". +The iconic example of this is boost::shared_ptr. Sometimes +these types could be made serializable by adding code inside +the library. Of course, doing that would create a lifetime +of unpaid employment for the library author. Rather than +adding a bunch of special code to the library itself, this +code can packaged as a "helper" or "mix-in" class. Then +a new archive is derived from both the "base" archive class +AND the "helper" class. This is how boost::shared_ptr +has been implemented. +

+It would also be possible to make a "generic runtime helper" +which would effectively extend the API of the library. Previously +the library included such a helper class. It was removed +in favor of the current implementation. But this functionality +should be added back in with another adaptor which would +become part of the library. + +


+

Revised 1 November, 2008 +

© Copyright Robert Ramey 2002-2008. +Distributed under 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) +

+ + diff --git a/deal.II/contrib/boost/libs/serialization/doc/overview.html b/deal.II/contrib/boost/libs/serialization/doc/overview.html new file mode 100644 index 0000000000..47a87071ad --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/doc/overview.html @@ -0,0 +1,146 @@ + + + + + + + +Serialization - Overview + + + + + + + +
+

C++ Boost

+
+

Serialization

+

Overview

+
+
+
+
Requirements
+
Other Implementations
+
+

Here, we use the term "serialization" to mean +the reversible deconstruction of an arbitrary set of C++ data structures +to a sequence of bytes. Such a system can be used to reconstitute +an equivalent structure in another program context. Depending on +the context, this might used implement object persistence, remote +parameter passing or other facility. In this system we use the term +"archive" to refer to a specific rendering of this +stream of bytes. This could be a file of binary data, text data, +XML, or some other created by the user of this library. +

Our goals for such a system are:

+
    +
  1. Code portability - depend only on ANSI C++ facilities. + +
  2. Code economy - exploit features of C++ such as RTTI, + templates, and multiple inheritance, etc. where appropriate to + make code shorter and simpler to use. + +
  3. Independent versioning for each class definition. That + is, when a class definition changed, older files can still be + imported to the new version of the class. + +
  4. Deep pointer save and restore. That is, save and restore + of pointers saves and restores the data pointed to. + +
  5. Proper restoration of pointers to shared data. + +
  6. Serialization of STL containers and other commonly used + templates. + +
  7. Data Portability - Streams of bytes created on one platform + should be readable on any other. + +
  8. Orthogonal specification of class serialization and archive format. + That is, any file format should be able to store serialization + of any arbitrary set of C++ data structures without having to + alter the serialization of any class. + +
  9. Non-intrusive. Permit serialization to be applied to + unaltered classes. That is, don't require that classes to be + serialized be derived from a specific base class or implement + specified member functions. This is necessary to easily + permit serialization to be applied to classes from class + libraries that we cannot or don't want to have to alter. + +
  10. The archive interface must be simple + enough to easily permit creation of a new type of archive. + +
  11. The archive interface must be rich + enough to permit the creation of an archive + that presents serialized data as XML in a useful manner. +
+ +

Other implementations

+ Before getting started I searched around for current + implementations. I found several. + +
    +
  • MFC This is the one that I am very familiar with. + I have used it for several years and have found it very useful. + However it fails requirements 1, 2, 3, 6, 7, and 9. In spite + of all the requirements not fulfilled, this is the most + useful implementation I've found. It turns out that class + versioning - partially implemented in MFC - really is + indispensable for my applications. Inevitably, version 1.x of + a shipping program needs to store more information in files + than was originally provided for. MFC is the only one of these + implementations that supports this - though only for the most + derived class. Still it's better than nothing and does the + job. MFC doesn't implement serialization of STL collections. + Though it does so for MFC collections. + +
  • CommonC++ libraries [1] + As far as I can tell, this + closely follows the MFC implementation but does address a few + of the issues. It is portable and creates portable archives but + skips versioning. It does support proper and complete + restoration of pointers and STL collections. It does address + compression though not in the way that I would prefer. The + package would also benefit from having better documentation. + So it fails to address 2, 3, 7, 8, and 9. + +
  • Eternity [2] + This is a bare bones package. It + seems well coded but it really needs documentation and + examples. It's not obvious how to use it without time + consuming study of the source code. Recent versions do support + files in XML format. This Fails 3, 6, 7?, 8, and 9. + +
  • Holub's implementation [3] This is the article that + first got me thinking about my own requirements for + a serialization implementation. Interesting and worth + the read if you can overlook the arrogant tone of the prose. + This implementation fails 2, 3, 4, 5, and 6. + +
  • s11n [13] + This library has similar goals to this one. Some aspects of the + implemenation are also similar. As of this writing, it would seem that: +
      +
    • Portability(1) is guarenteed only for recent versions of GCC. +
    • Versioning(3) of class definitions is not explicitly supported by + the library. +
    • it doesn't seem to automatically account for shared pointers(5). + I concluded this from the documentation as well as the statement that + serialization of graph like structures is not supported. +
    + Its has lots of differences - and lots in common with this implementation. +
+
+

Revised 1 November, 2004 +

© Copyright Robert Ramey 2002-2004. +Distributed under 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) +

+ + diff --git a/deal.II/contrib/boost/libs/serialization/doc/performance_status.html b/deal.II/contrib/boost/libs/serialization/doc/performance_status.html new file mode 100644 index 0000000000..ed44a2d5a4 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/doc/performance_status.html @@ -0,0 +1,30 @@ + + +Boost Library Status Automatic Test + + + + + + +
+

Library Status: serialization

+Run Date: 02:42:48 UTC, Tuesday 10 June 2008 +
+
+ + + + + + + + + + + + + +
Test Namegcc-3.4.4
profile
peformance_array_binary_archivePass Profile
peformance_array_text_archivePass Profile
peformance_array_text_warchiveMissing
peformance_array_xml_archivePass Profile
peformance_array_xml_warchiveMissing
performance_iteratorsPass Profile
performance_iterators_base64Pass Profile
+ + diff --git a/deal.II/contrib/boost/libs/serialization/doc/pimpl.html b/deal.II/contrib/boost/libs/serialization/doc/pimpl.html new file mode 100644 index 0000000000..4a8ca9b337 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/doc/pimpl.html @@ -0,0 +1,124 @@ + + + + + + + +Serialization - PIMPL + + + + + + + +
+

C++ Boost

+
+

Serialization

+

PIMPL

+
+
+PIMPL is a C++ programming idiom described by Herb Sutter [10] +which stands for "Private Implementation". It is also referred to as +the "Handle Body Idiom". Included in this library is a program called +demo_pimpl.cpp +which illustrates how this is used. The file +demo_pimpl_A.hpp +contains the declaration of the a class that hides its implementation +by including a pointer to struct B that is only defined as a pointer. +

+// class whose declaration is hidden by a pointer
+struct B;
+
+struct A {
+    // class a contains a pointer to a "hidden" declaration
+    B *pimpl;
+    template<class Archive>
+    void serialize(Archive & ar, const unsigned int file_version);
+    A();
+};
+
+Serialization of A requires access to the definition of B in order so it +is defined in the separately compiled module: +demo_pimpl_A.cpp +by: +

+#include "demo_pimpl_A.hpp"
+
+// "hidden" definition of class B
+struct B {
+    int b;
+    template<class Archive>
+    void serialize(Archive & ar, const unsigned int file_version){
+        ar & b;
+    }
+};
+
+A::A() :
+    pimpl(new B)
+{}
+
+A::~A(){
+    delete pimpl;
+}
+
+// now we can define the serialization for class A
+template<class Archive>
+void A::serialize(Archive & ar, const unsigned int file_version){
+    ar & pimpl;
+}
+
+As described in [10] this brings the +following advantages: +
    +
  • type "B" can be used without using its header. +
  • implementation of B can be changed without generating a + cascade of recompilations. +
+So, we compile the modules and everything is fine. However when we +link, we get an error. Two symbols are undefined: +

+void A::serialize(boost::archive::text_oarchive & ar, const unsigned int file_version);
+void A::serialize(boost::archive::text_iarchive & ar, const unsigned int file_version);
+
+The problem is that when compiling the above code, +there is no instantiation of the serialize template. +There can't be as its not "known" what types of archives +the serialization is going to be used with. So these functions are "missing" +when an attempt to link is made. The solution is to explicitly instantiate +serialization code for those archives which are going to be used. In this +example, including the the following code in any *.cpp file does just that: +

+#include <boost/archive/text_iarchive.hpp>
+#include <boost/archive/text_oarchive.hpp>
+
+template void A::serialize<boost::archive::text_iarchive>(
+    boost::archive::text_iarchive & ar, 
+    const unsigned int file_version
+);
+template void A::serialize<boost::archive::text_oarchive>(
+    boost::archive::text_oarchive & ar, 
+    const unsigned int file_version
+);
+
+The program should now link as well as compile. +

+The downside of this is that one has to know which archives are going +to be used with hidden serializations. This is an effect of using template +driven code. One can invoke explicity instantiation for all known templates and +presume that the linker will exclude unreferenced code. This should +work but is platform dependent. +


+

© Copyright Robert Ramey 2002-2004. +Distributed under 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) +

+ + diff --git a/deal.II/contrib/boost/libs/serialization/doc/plus.gif b/deal.II/contrib/boost/libs/serialization/doc/plus.gif new file mode 100644 index 0000000000..9ee3838a39 Binary files /dev/null and b/deal.II/contrib/boost/libs/serialization/doc/plus.gif differ diff --git a/deal.II/contrib/boost/libs/serialization/doc/profile1.txt b/deal.II/contrib/boost/libs/serialization/doc/profile1.txt new file mode 100644 index 0000000000..db95c841fd --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/doc/profile1.txt @@ -0,0 +1,149 @@ +Flat profile: + +Each sample counts as 0.01 seconds. + no time accumulated + + % cumulative self self total + time seconds seconds calls Ts/call Ts/call name + 0.00 0.00 0.00 200 0.00 0.00 void accumulate(unsigned int&, unsigned long const&) + 0.00 0.00 0.00 150 0.00 0.00 _pei386_runtime_relocator + 0.00 0.00 0.00 1 0.00 0.00 std::ostream::operator<<(void const*) + 0.00 0.00 0.00 1 0.00 0.00 __divdi3 + + % the percentage of the total running time of the +time program used by this function. + +cumulative a running sum of the number of seconds accounted + seconds for by this function and those listed above it. + + self the number of seconds accounted for by this +seconds function alone. This is the major sort for this + listing. + +calls the number of times this function was invoked, if + this function is profiled, else blank. + + self the average number of milliseconds spent in this +ms/call function per call, if this function is profiled, + else blank. + + total the average number of milliseconds spent in this +ms/call function and its descendents per call, if this + function is profiled, else blank. + +name the name of the function. This is the minor sort + for this listing. The index shows the location of + the function in the gprof listing. If the index is + in parenthesis it shows where it would appear in + the gprof listing if it were to be printed. + + Call graph (explanation follows) + + +granularity: each sample hit covers 4 byte(s) no time propagated + +index % time self children called name + 0.00 0.00 200/200 setvbuf [1286] +[4] 0.0 0.00 0.00 200 void accumulate(unsigned int&, unsigned long const&) [4] +----------------------------------------------- + 0.00 0.00 150/150 _cygwin_crt0_common@8 [1230] +[5] 0.0 0.00 0.00 150 _pei386_runtime_relocator [5] +----------------------------------------------- + 0.00 0.00 1/1 _lseek64 [1234] +[6] 0.0 0.00 0.00 1 std::ostream::operator<<(void const*) [6] +----------------------------------------------- + 0.00 0.00 1/1 __tcf_1 [1221] +[7] 0.0 0.00 0.00 1 __divdi3 [7] +----------------------------------------------- + 2 main [1263] +[1263] 0.0 0.00 0.00 0+2 main [1263] + 2 main [1263] +----------------------------------------------- + + This table describes the call tree of the program, and was sorted by + the total amount of time spent in each function and its children. + + Each entry in this table consists of several lines. The line with the + index number at the left hand margin lists the current function. + The lines above it list the functions that called this function, + and the lines below it list the functions this one called. + This line lists: + index A unique number given to each element of the table. + Index numbers are sorted numerically. + The index number is printed next to every function name so + it is easier to look up where the function in the table. + + % time This is the percentage of the `total' time that was spent + in this function and its children. Note that due to + different viewpoints, functions excluded by options, etc, + these numbers will NOT add up to 100%. + + self This is the total amount of time spent in this function. + + children This is the total amount of time propagated into this + function by its children. + + called This is the number of times the function was called. + If the function called itself recursively, the number + only includes non-recursive calls, and is followed by + a `+' and the number of recursive calls. + + name The name of the current function. The index number is + printed after it. If the function is a member of a + cycle, the cycle number is printed between the + function's name and the index number. + + + For the function's parents, the fields have the following meanings: + + self This is the amount of time that was propagated directly + from the function into this parent. + + children This is the amount of time that was propagated from + the function's children into this parent. + + called This is the number of times this parent called the + function `/' the total number of times the function + was called. Recursive calls to the function are not + included in the number after the `/'. + + name This is the name of the parent. The parent's index + number is printed after it. If the parent is a + member of a cycle, the cycle number is printed between + the name and the index number. + + If the parents of the function cannot be determined, the word + `' is printed in the `name' field, and all the other + fields are blank. + + For the function's children, the fields have the following meanings: + + self This is the amount of time that was propagated directly + from the child into the function. + + children This is the amount of time that was propagated from the + child's children to the function. + + called This is the number of times the function called + this child `/' the total number of times the child + was called. Recursive calls by the child are not + listed in the number after the `/'. + + name This is the name of the child. The child's index + number is printed after it. If the child is a + member of a cycle, the cycle number is printed + between the name and the index number. + + If there are any cycles (circles) in the call graph, there is an + entry for the cycle-as-a-whole. This entry shows who called the + cycle (as parents) and the members of the cycle (as children.) + The `+' recursive calls entry shows the number of function calls that + were internal to the cycle, and the calls entry for each member shows, + for that member, how many times it was called from other members of + the cycle. + + +Index by function name + + [4] void accumulate(unsigned int&, unsigned long const&) [7] __divdi3 + [6] std::ostream::operator<<(void const*) [5] _pei386_runtime_relocator diff --git a/deal.II/contrib/boost/libs/serialization/doc/profile2.txt b/deal.II/contrib/boost/libs/serialization/doc/profile2.txt new file mode 100644 index 0000000000..a2cac6d272 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/doc/profile2.txt @@ -0,0 +1,203 @@ +Flat profile: + +Each sample counts as 0.01 seconds. + % cumulative self self total + time seconds seconds calls Ts/call Ts/call name +100.00 0.01 0.01 __gnu_cxx::__atomic_add(int volatile*, int) + 0.00 0.01 0.00 51 0.00 0.00 boost::archive::iterators::transform_width::fill() + 0.00 0.01 0.00 36 0.00 0.00 boost::archive::iterators::transform_width<__gnu_cxx::__normal_iterator > >, 8, 6, char>::fill() + 0.00 0.01 0.00 30 0.00 0.00 std::vector >::_M_insert_aux(__gnu_cxx::__normal_iterator > >, char const&) + 0.00 0.01 0.00 11 0.00 0.00 boost::archive::iterators::xml_escape::fill(char const*&, char const*&) + 0.00 0.01 0.00 9 0.00 0.00 void test_transform_width<6, 8>(unsigned int) + 0.00 0.01 0.00 9 0.00 0.00 boost::archive::iterators::xml_unescape::drain() + 0.00 0.01 0.00 5 0.00 0.00 boost::archive::iterators::xml_unescape::drain_residue(char const*) + 0.00 0.01 0.00 2 0.00 0.00 __static_initialization_and_destruction_0(int, int) + 0.00 0.01 0.00 1 0.00 0.00 void test_xml_escape(char const*, char const*, unsigned int) + 0.00 0.01 0.00 1 0.00 0.00 void test_xml_unescape(char const*, char const*, unsigned int) + 0.00 0.01 0.00 1 0.00 0.00 void test_stream_iterators(char const*, unsigned int) + 0.00 0.01 0.00 1 0.00 0.00 test_main(int, char**) + 0.00 0.01 0.00 1 0.00 0.00 char* std::string::_S_construct(char*, char*, std::allocator const&, std::forward_iterator_tag) + 0.00 0.01 0.00 1 0.00 0.00 std::basic_string, std::allocator >::basic_string(char*, char*, std::allocator const&) + + % the percentage of the total running time of the +time program used by this function. + +cumulative a running sum of the number of seconds accounted + seconds for by this function and those listed above it. + + self the number of seconds accounted for by this +seconds function alone. This is the major sort for this + listing. + +calls the number of times this function was invoked, if + this function is profiled, else blank. + + self the average number of milliseconds spent in this +ms/call function per call, if this function is profiled, + else blank. + + total the average number of milliseconds spent in this +ms/call function and its descendents per call, if this + function is profiled, else blank. + +name the name of the function. This is the minor sort + for this listing. The index shows the location of + the function in the gprof listing. If the index is + in parenthesis it shows where it would appear in + the gprof listing if it were to be printed. + + Call graph (explanation follows) + + +granularity: each sample hit covers 4 byte(s) for 100.00% of 0.01 seconds + +index % time self children called name + +[1] 100.0 0.01 0.00 __gnu_cxx::__atomic_add(int volatile*, int) [1] +----------------------------------------------- + 0.00 0.00 51/51 void test_transform_width<6, 8>(unsigned int) [9] +[5] 0.0 0.00 0.00 51 boost::archive::iterators::transform_width::fill() [5] +----------------------------------------------- + 0.00 0.00 36/36 void test_transform_width<6, 8>(unsigned int) [9] +[6] 0.0 0.00 0.00 36 boost::archive::iterators::transform_width<__gnu_cxx::__normal_iterator > >, 8, 6, char>::fill() [6] +----------------------------------------------- + 0.00 0.00 30/30 void test_transform_width<6, 8>(unsigned int) [9] +[7] 0.0 0.00 0.00 30 std::vector >::_M_insert_aux(__gnu_cxx::__normal_iterator > >, char const&) [7] +----------------------------------------------- + 0.00 0.00 11/11 void test_xml_escape(char const*, char const*, unsigned int) [13] +[8] 0.0 0.00 0.00 11 boost::archive::iterators::xml_escape::fill(char const*&, char const*&) [8] +----------------------------------------------- + 0.00 0.00 9/9 test_main(int, char**) [16] +[9] 0.0 0.00 0.00 9 void test_transform_width<6, 8>(unsigned int) [9] + 0.00 0.00 51/51 boost::archive::iterators::transform_width::fill() [5] + 0.00 0.00 36/36 boost::archive::iterators::transform_width<__gnu_cxx::__normal_iterator > >, 8, 6, char>::fill() [6] + 0.00 0.00 30/30 std::vector >::_M_insert_aux(__gnu_cxx::__normal_iterator > >, char const&) [7] +----------------------------------------------- + 0.00 0.00 9/9 void test_xml_unescape(char const*, char const*, unsigned int) [14] +[10] 0.0 0.00 0.00 9 boost::archive::iterators::xml_unescape::drain() [10] + 0.00 0.00 5/5 boost::archive::iterators::xml_unescape::drain_residue(char const*) [11] +----------------------------------------------- + 0.00 0.00 5/5 boost::archive::iterators::xml_unescape::drain() [10] +[11] 0.0 0.00 0.00 5 boost::archive::iterators::xml_unescape::drain_residue(char const*) [11] +----------------------------------------------- + 0.00 0.00 1/2 global constructors keyed to main [38] + 0.00 0.00 1/2 global destructors keyed to main [35] +[12] 0.0 0.00 0.00 2 __static_initialization_and_destruction_0(int, int) [12] +----------------------------------------------- + 0.00 0.00 1/1 test_main(int, char**) [16] +[13] 0.0 0.00 0.00 1 void test_xml_escape(char const*, char const*, unsigned int) [13] + 0.00 0.00 11/11 boost::archive::iterators::xml_escape::fill(char const*&, char const*&) [8] +----------------------------------------------- + 0.00 0.00 1/1 test_main(int, char**) [16] +[14] 0.0 0.00 0.00 1 void test_xml_unescape(char const*, char const*, unsigned int) [14] + 0.00 0.00 9/9 boost::archive::iterators::xml_unescape::drain() [10] +----------------------------------------------- + 0.00 0.00 1/1 test_main(int, char**) [16] +[15] 0.0 0.00 0.00 1 void test_stream_iterators(char const*, unsigned int) [15] + 0.00 0.00 1/1 std::basic_string, std::allocator >::basic_string(char*, char*, std::allocator const&) [18] +----------------------------------------------- + 0.00 0.00 1/1 main [1211] +[16] 0.0 0.00 0.00 1 test_main(int, char**) [16] + 0.00 0.00 9/9 void test_transform_width<6, 8>(unsigned int) [9] + 0.00 0.00 1/1 void test_xml_escape(char const*, char const*, unsigned int) [13] + 0.00 0.00 1/1 void test_xml_unescape(char const*, char const*, unsigned int) [14] + 0.00 0.00 1/1 void test_stream_iterators(char const*, unsigned int) [15] +----------------------------------------------- + 0.00 0.00 1/1 std::basic_string, std::allocator >::basic_string(char*, char*, std::allocator const&) [18] +[17] 0.0 0.00 0.00 1 char* std::string::_S_construct(char*, char*, std::allocator const&, std::forward_iterator_tag) [17] +----------------------------------------------- + 0.00 0.00 1/1 void test_stream_iterators(char const*, unsigned int) [15] +[18] 0.0 0.00 0.00 1 std::basic_string, std::allocator >::basic_string(char*, char*, std::allocator const&) [18] + 0.00 0.00 1/1 char* std::string::_S_construct(char*, char*, std::allocator const&, std::forward_iterator_tag) [17] +----------------------------------------------- + + This table describes the call tree of the program, and was sorted by + the total amount of time spent in each function and its children. + + Each entry in this table consists of several lines. The line with the + index number at the left hand margin lists the current function. + The lines above it list the functions that called this function, + and the lines below it list the functions this one called. + This line lists: + index A unique number given to each element of the table. + Index numbers are sorted numerically. + The index number is printed next to every function name so + it is easier to look up where the function in the table. + + % time This is the percentage of the `total' time that was spent + in this function and its children. Note that due to + different viewpoints, functions excluded by options, etc, + these numbers will NOT add up to 100%. + + self This is the total amount of time spent in this function. + + children This is the total amount of time propagated into this + function by its children. + + called This is the number of times the function was called. + If the function called itself recursively, the number + only includes non-recursive calls, and is followed by + a `+' and the number of recursive calls. + + name The name of the current function. The index number is + printed after it. If the function is a member of a + cycle, the cycle number is printed between the + function's name and the index number. + + + For the function's parents, the fields have the following meanings: + + self This is the amount of time that was propagated directly + from the function into this parent. + + children This is the amount of time that was propagated from + the function's children into this parent. + + called This is the number of times this parent called the + function `/' the total number of times the function + was called. Recursive calls to the function are not + included in the number after the `/'. + + name This is the name of the parent. The parent's index + number is printed after it. If the parent is a + member of a cycle, the cycle number is printed between + the name and the index number. + + If the parents of the function cannot be determined, the word + `' is printed in the `name' field, and all the other + fields are blank. + + For the function's children, the fields have the following meanings: + + self This is the amount of time that was propagated directly + from the child into the function. + + children This is the amount of time that was propagated from the + child's children to the function. + + called This is the number of times the function called + this child `/' the total number of times the child + was called. Recursive calls by the child are not + listed in the number after the `/'. + + name This is the name of the child. The child's index + number is printed after it. If the child is a + member of a cycle, the cycle number is printed + between the name and the index number. + + If there are any cycles (circles) in the call graph, there is an + entry for the cycle-as-a-whole. This entry shows who called the + cycle (as parents) and the members of the cycle (as children.) + The `+' recursive calls entry shows the number of function calls that + were internal to the cycle, and the calls entry for each member shows, + for that member, how many times it was called from other members of + the cycle. + + +Index by function name + + [13] void test_xml_escape(char const*, char const*, unsigned int) [16] test_main(int, char**) [5] boost::archive::iterators::transform_width::fill() + [14] void test_xml_unescape(char const*, char const*, unsigned int) [8] boost::archive::iterators::xml_escape::fill(char const*&, char const*&) [1] __gnu_cxx::__atomic_add(int volatile*, int) + [9] void test_transform_width<6, 8>(unsigned int) [11] boost::archive::iterators::xml_unescape::drain_residue(char const*) [17] char* std::string::_S_construct(char*, char*, std::allocator const&, std::forward_iterator_tag) + [15] void test_stream_iterators(char const*, unsigned int) [10] boost::archive::iterators::xml_unescape::drain() [18] std::basic_string, std::allocator >::basic_string(char*, char*, std::allocator const&) + [12] __static_initialization_and_destruction_0(int, int) (performance_iterators.cpp) [6] boost::archive::iterators::transform_width<__gnu_cxx::__normal_iterator > >, 8, 6, char>::fill() [7] std::vector >::_M_insert_aux(__gnu_cxx::__normal_iterator > >, char const&) diff --git a/deal.II/contrib/boost/libs/serialization/doc/profile3.txt b/deal.II/contrib/boost/libs/serialization/doc/profile3.txt new file mode 100644 index 0000000000..807e243cbb --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/doc/profile3.txt @@ -0,0 +1,153 @@ +Flat profile: + +Each sample counts as 0.01 seconds. + no time accumulated + + % cumulative self self total + time seconds seconds calls Ts/call Ts/call name + 0.00 0.00 0.00 200 0.00 0.00 boost::archive::iterators::transform_width::fill() + 0.00 0.00 0.00 150 0.00 0.00 boost::archive::iterators::transform_width >, char>, 8, 6, char>::fill() + 0.00 0.00 0.00 2 0.00 0.00 __static_initialization_and_destruction_0(int, int) + 0.00 0.00 0.00 1 0.00 0.00 void test_base64() + 0.00 0.00 0.00 1 0.00 0.00 std::_List_base >::_M_clear() + + % the percentage of the total running time of the +time program used by this function. + +cumulative a running sum of the number of seconds accounted + seconds for by this function and those listed above it. + + self the number of seconds accounted for by this +seconds function alone. This is the major sort for this + listing. + +calls the number of times this function was invoked, if + this function is profiled, else blank. + + self the average number of milliseconds spent in this +ms/call function per call, if this function is profiled, + else blank. + + total the average number of milliseconds spent in this +ms/call function and its descendents per call, if this + function is profiled, else blank. + +name the name of the function. This is the minor sort + for this listing. The index shows the location of + the function in the gprof listing. If the index is + in parenthesis it shows where it would appear in + the gprof listing if it were to be printed. + + Call graph (explanation follows) + + +granularity: each sample hit covers 4 byte(s) no time propagated + +index % time self children called name + 0.00 0.00 200/200 void test_base64() [7] +[4] 0.0 0.00 0.00 200 boost::archive::iterators::transform_width::fill() [4] +----------------------------------------------- + 0.00 0.00 150/150 void test_base64() [7] +[5] 0.0 0.00 0.00 150 boost::archive::iterators::transform_width >, char>, 8, 6, char>::fill() [5] +----------------------------------------------- + 0.00 0.00 1/2 global constructors keyed to main [27] + 0.00 0.00 1/2 global destructors keyed to main [24] +[6] 0.0 0.00 0.00 2 __static_initialization_and_destruction_0(int, int) [6] +----------------------------------------------- + 0.00 0.00 1/1 main [1156] +[7] 0.0 0.00 0.00 1 void test_base64() [7] + 0.00 0.00 200/200 boost::archive::iterators::transform_width::fill() [4] + 0.00 0.00 150/150 boost::archive::iterators::transform_width >, char>, 8, 6, char>::fill() [5] + 0.00 0.00 1/1 std::_List_base >::_M_clear() [8] +----------------------------------------------- + 0.00 0.00 1/1 void test_base64() [7] +[8] 0.0 0.00 0.00 1 std::_List_base >::_M_clear() [8] +----------------------------------------------- + + This table describes the call tree of the program, and was sorted by + the total amount of time spent in each function and its children. + + Each entry in this table consists of several lines. The line with the + index number at the left hand margin lists the current function. + The lines above it list the functions that called this function, + and the lines below it list the functions this one called. + This line lists: + index A unique number given to each element of the table. + Index numbers are sorted numerically. + The index number is printed next to every function name so + it is easier to look up where the function in the table. + + % time This is the percentage of the `total' time that was spent + in this function and its children. Note that due to + different viewpoints, functions excluded by options, etc, + these numbers will NOT add up to 100%. + + self This is the total amount of time spent in this function. + + children This is the total amount of time propagated into this + function by its children. + + called This is the number of times the function was called. + If the function called itself recursively, the number + only includes non-recursive calls, and is followed by + a `+' and the number of recursive calls. + + name The name of the current function. The index number is + printed after it. If the function is a member of a + cycle, the cycle number is printed between the + function's name and the index number. + + + For the function's parents, the fields have the following meanings: + + self This is the amount of time that was propagated directly + from the function into this parent. + + children This is the amount of time that was propagated from + the function's children into this parent. + + called This is the number of times this parent called the + function `/' the total number of times the function + was called. Recursive calls to the function are not + included in the number after the `/'. + + name This is the name of the parent. The parent's index + number is printed after it. If the parent is a + member of a cycle, the cycle number is printed between + the name and the index number. + + If the parents of the function cannot be determined, the word + `' is printed in the `name' field, and all the other + fields are blank. + + For the function's children, the fields have the following meanings: + + self This is the amount of time that was propagated directly + from the child into the function. + + children This is the amount of time that was propagated from the + child's children to the function. + + called This is the number of times the function called + this child `/' the total number of times the child + was called. Recursive calls by the child are not + listed in the number after the `/'. + + name This is the name of the child. The child's index + number is printed after it. If the child is a + member of a cycle, the cycle number is printed + between the name and the index number. + + If there are any cycles (circles) in the call graph, there is an + entry for the cycle-as-a-whole. This entry shows who called the + cycle (as parents) and the members of the cycle (as children.) + The `+' recursive calls entry shows the number of function calls that + were internal to the cycle, and the calls entry for each member shows, + for that member, how many times it was called from other members of + the cycle. + + +Index by function name + + [7] void test_base64() [5] boost::archive::iterators::transform_width >, char>, 8, 6, char>::fill() [8] std::_List_base >::_M_clear() + [6] __static_initialization_and_destruction_0(int, int) (performance_iterators_base64.cpp) [4] boost::archive::iterators::transform_width::fill() diff --git a/deal.II/contrib/boost/libs/serialization/doc/rationale.html b/deal.II/contrib/boost/libs/serialization/doc/rationale.html new file mode 100644 index 0000000000..c963788be0 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/doc/rationale.html @@ -0,0 +1,125 @@ + + + + + + + +Seriealization - Rationale + + + + + + + +
+

C++ Boost

+
+

Serialization

+

Rationale

+
+
+
+
The term "serialization" is preferred to "persistence"
+
Archives are not streams
+
Strings are treated specially in text archives
+
typeid information is not included in archives
+ +
+

The term "serialization" is preferred to "persistence"

+

+I found that persistence is often used to refer +to something quite different. Examples are storage of class +instances (objects) in database schema [4] +This library will be useful in other contexts besides implementing persistence. The +most obvious case is that of marshalling data for transmission to another system. +

Archives are not streams

+

+Archive classes are NOT derived from +streams even though they have similar syntax rules. +

    +
  • Archive classes are not kinds of streams though they + are implemented in terms of streams. This + distinction is addressed in [5] item number item 41 . +
  • We don't want users to insert/extract data + directly into/from  the stream .  This could + create a corrupted archive. Were archives + derived from streams, it would possible to + accidentally do this. So archive classes + only define operations which are safe and necessary. +
  • The usage of streams to implement the archive classes that + are included in the library is merely convenient - not necessary. + Library users may well want to define their own archive format + which doesn't use streams at all. +
+

Archive Members are Templates +Rather than Virtual Functions

+The previous version of this library defined virtual functions for all +primitive types. These were overridden by each archive class. There were +two issues related to this: + +
  • Some disliked virtual functions because of the added execution time + overhead. +
  • This caused implementation difficulties since the set of primitive + data types varies between platforms. Attempting to define the correct + set of virtual functions, (think long long, + __int64, + etc.) resulted in messy and fragile code. Replacing this with templates + and letting the compiler generate the code for the primitive types actually + used, resolved this problem. Of course, the ripple effects of this design + change were significant, but in the end led to smaller, faster, more + maintainable code. + +

    std::strings are treated specially in text files

    +

    +Treating strings as STL vectors would result in minimal code size. This was +not done because: +

      +
    • In text archives it is convenient to be able to view strings. Our text + implementation stores single characters as integers. Storing strings + as a vector of characters would waste space and render the archives + inconvenient for debugging. +
    • Stream implementations have special functions for std::string + and std::wstring. + Presumably they optimize appropriately. +
    • Other specializations of std::basic_string are in fact handled + as vectors of the element type. +
    +

    +

    typeid information is not included in archives

    +

    +I originally thought that I had to save the name of the class specified by std::type_of::name() +in the archive. This created difficulties as std::type_of::name() is not portable and +not guaranteed to return the class name. This makes it almost useless for implementing +archive portability. This topic is explained in much more detail in +[7] page 206. It turned out that it was not necessary. +As long as objects are loaded in the exact sequence as they were saved, the type +is available when loading. The only exception to this is the case of polymorphic +pointers never before loaded/saved. This is addressed with the register_type() +and/or export facilities described in the reference. +In effect, export generates a portable equivalent to +typeid information. + + +


    +

    © Copyright Robert Ramey 2002-2004. +Distributed under 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) +

    + + diff --git a/deal.II/contrib/boost/libs/serialization/doc/reference.html b/deal.II/contrib/boost/libs/serialization/doc/reference.html new file mode 100644 index 0000000000..b97cbe3a20 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/doc/reference.html @@ -0,0 +1,42 @@ + + + + + + + +Serialization - Serialization of Classes + + + + + + + +
    +

    C++ Boost

    +
    +

    Serialization

    +

    Serializable Concept

    +
    +
    +
    +
    Archive Concepts +
    Serializable Concept +
    Special Considerations +
    Archive Class Reference +
    Implementation Notes +
    + +
    +

    © Copyright Robert Ramey 2002-2004. +Distributed under 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) +

    + + \ No newline at end of file diff --git a/deal.II/contrib/boost/libs/serialization/doc/release.html b/deal.II/contrib/boost/libs/serialization/doc/release.html new file mode 100644 index 0000000000..1559c94af5 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/doc/release.html @@ -0,0 +1,242 @@ + + + + + + + + Serialization - Release Notes + + + + + + + +
    +

    + C++ Boost

    +
    +

    + Serialization

    +

    + Release Notes

    +
    +
    +
    +
    Differences from version 1.42
    +
    Differences from version 1.41
    +
    Differences from version 1.40
    +
    Differences from version 1.39
    +
    Differences from version 1.37
    +
    Differences from version 1.35
    +
    Differences from version 1.34
    +
    Differences from version 1.33
    +
    Differences from version 1.32
    +
    Pending Issues
    +
    +As of this writing, there are no known bugs. However, due to compiler/library +quirks and or bugs, some tests fail with some combinations of compilers and +libraries. +

    Differences from Boost 1.42

    +
      +
    • fixed failure of shared_ptr serialization when serializing pointers +created from enable_shared_from_this. +
    • added example for a simple archive which can be used as a debug log. +This example illustrates the implemenation of the archive concept to aid +understanding required to create one's own archive classes. The resulting +archive is useful for debugging in that it only 160 lines of code and is +header only - that is, it doesn't required linking to the serialization library. +
    • replaced example used to show how to derive from an existing archive. +This example creates an XML archive class which doesn't include serialization +traits such as class_id, class_version, etc. It might be useful for exporting +one's class information to osme XML processor and/or debugging programs. +
    • compile time warnings have been implemented to detect practices which + though correct, will result in operation or side effects different than + a user probably intends. +
    • Some memory leaks associated with void_cast have been fixed. +
    +

    Differences from Boost 1.41

    +
      +
    • adjustments have been made to minimize compile time warnings. +
    • compile time warnings have been implemented to detect practices which + though correct, will result in operation or side effects different than + a user probably intends. +
    • Some memory leaks associated with void_cast have been fixed. +
    +

    Differences from Boost 1.40

    +This library has been tested against Boost version 1.39 and 1.40. +

    + Changes have been made to archive classes included with the library. Users who + have used these a guide to making their own archive classes will find that + these will likely no longer compile. This can be remedied by making the + following changes in the code which instantiates these archive classes. +

    +Old Code:
    +
    +...
    +#include <boost/archive/impl/archive_pointer_iserializer.ipp>
    +...
    +template class detail::archive_pointer_iserializer<naked_text_iarchive> ;
    +...
    +template class detail::archive_pointer_iserializer<text_iarchive> ;
    +
    should be replaced with this new code:
    +#include <boost/archive/impl/archive_serializer_map.ipp>
    +...
    +template class detail::archive_serializer_map<naked_text_iarchive> ;
    +...
    +template class detail::archive_serializer_map<text_iarchive> ;
    +
    + +

    Differences from Boost 1.39

    +
      +
    • + It is now possible to serialize an object through a pointer to a class which + implements its own new/delete + operators. This functionaly is not available on some compilers. +
    • + serialization of polymorphic objects has been sped up considerably. +
    +As of this writing, all bug reports filed as TRAK tickets have been addressed. +There are some TRAK tickets pending which would best be described as feature +requests. See Pending Issues. +

    Differences from Boost 1.37

    +There are no new features in this version. As of this writing, all bug reports +filed as TRAK tickets have been addressed. There are some TRAK tickets pending +which would best be described as feature requests. See Pending + Issues. +

    Differences from Boost 1.36

    +There are no new features in this version. As of this writing, all bug reports +filed as TRAK tickets have been addressed. +

    Differences from Boost 1.35

    +
      +
    • + The library is now thread safe. That is, multiple archives can be open in + different threads. This has been implmented with a lock-free algorithm to avoid + any performance bottlenecks. +
    • + Serialization of types defined in shared libraries is now supported. shared + libraries (DLLS) can be loaded/unloaded dynamically at runtime. This includes + the serialization of instances of abstract base classes so that a program can + be written so as to be compatible with as yet undefined and un-implemented + code. +
    • + The extended type info system has been enhanced to in order to implement the + above. It is now a general purpose system for creating and casting of types + about which is only known a string ID and an abstract base class. +
    • + All bug reports filed as TRAK tickets have been addressed. +
    • + As of this writing, the library will fail build on older compilers such as MSVC + before version 7.1 and older versions of Borland compilers. This might or might + not change in the future. +
    +

    Differences from Boost 1.34

    +
      +
    • + Enhanced support for fast serialization for native binary archives. By Mattias + Troyer. +
    • + Improved implementation of "export" functionality. Removes header ordering + requirement and eliminates the maintenance of a pre-determined list of "known + archives" By David Abrahams. +
    • + Improved support for STLPort. +
    +

    Differences from Boost 1.33

    +
      +
    • + Native Binary archives use the std::streambuf + interface. This should result in noticeably faster execution in many cases. +
    +

    Differences from Boost 1.32

    +
      +
    • + Dynamic Linking Library (DLLs and shared libraries) for platforms which support + them. See Automatic + Linking on Windows. +
    • + Implementation of auto-link for compilers which can support this. +
    • + Better support for Argument Dependent Lookup + and two-phase lookup. This results in simpler rules regarding the placing of + serialization specializations namespaces. +
    • + Enhanced documentation to help explain usage of the above. +
    • + Adjustments to improve support for less conformant compilers. +
    • + Improved const correctness for save/load operators. Note that this + may produce compile time errors in code which compiled without problem in + earlier boost releases. In most cases the fix is trivial. In other cases, code + should be scrutinized to be sure that it doesn't use the serialization system + in a way which may introduce subtle bugs in to the program. A fuller + explanation of this issue can be found + here. +
    • + A new implementation of serialization for shared_ptr<T>. + This is compatible with public interface of shared_ptr<T> + so it should be more robust and not have to change in the future. The + implementation optionally includes code to load shared_ptr<T> + stored in archives created with boost 1.32. This code is stored in 'he header: + boost/serialization/shared_ptr_132.hpp. If your application needs to + load archives created with boost 1.32 libraries, include the above header + before each inclusion of boost/serialization/shared_ptr.hpp. +
    • + More compilers tested and supported. +
    • + Miscellaneous bug fixes. +
    +

    Pending issues

    +
      +
    • + Rvalues cannot be serialized. It would be possible to implement this for + untracked types, but this has not been done. +
    • + Pointers to pointers cannot currently be serialized +
    • + Its possible that std::string and + std::wstring + contain characters such as '\0' and -1 (EOF) which cannot be rendered in text + and XML archives without an escape mechanism. Currently there is no such escape + mechanism implemented. +
    • + A subtle error in the implementation of serializaton of + std::map is fixed in this version. Unfortunately, the fix breaks + serialization of std::map + for those compilers which do not support partial template specialization. Also, + types which contain pointers or tracked types might not work correctly. +
    +

    + Aside from the above, there are a number of issues related to specific + platforms. These are listed in Specific + Compiler/Library Issues. +


    +

    + © Copyright Robert Ramey 2002-2009. + Distributed under 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) +

    + + diff --git a/deal.II/contrib/boost/libs/serialization/doc/serialization.html b/deal.II/contrib/boost/libs/serialization/doc/serialization.html new file mode 100644 index 0000000000..ec15eb123a --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/doc/serialization.html @@ -0,0 +1,932 @@ + + + + + + + +Serialization - Serialization of Classes + + + + + + + +
    +

    C++ Boost

    +
    +

    Serialization

    +

    Serializable Concept

    +
    +
    +
    +
    Primitive Types +
    Class Types +
    +
    Member Function +
    Free Function +
    +
    Namespaces for Free Function Overrides +
    +
    Class Members +
    +
    Base Classes +
    const Members +
    Templates +
    +
    Versioning +
    Splitting serialize into + save/load +
    +
    Member Functions +
    Free Functions +
    +
    +
    Pointers +
    +
    Non-Default Constructors +
    Pointers to Objects of Derived Classes +
    +
    Registration +
    Export +
    Instantiation +
    Selective Tracking +
    Runtime Casting +
    +
    +
    References +
    Arrays +
    Class Serialization Traits +
    Serialization Wrappers +
    Models - Serialization Implementations Included in the Library +
    + +A type T is Serializable +if and only if one of the following is true: +
      +
    • it is a primitive type.
      + In this document, we use the term primitive type to mean + types whose data is simply saved/loaded to/from an archive + with no further processing. Arithmetic (including characters), + bool, enum and stl::string and stl::wstring types are primitive types. Using + serialization traits, + any user type can also be designated as "primitive" + so that it is handled in this way. +
    • It is a class type and one of the following has been declared according + to the prototypes detailed below: +
        +
      • a class member function serialize +
      • a global function serialize +
      +
    • it is a pointer to a Serializable type. +
    • it is a reference to a Serializable type. +
    • it is a native C++ Array of Serializable type. +
    + +

    Primitive Types

    +The template operators &, <<, and >> of the archive classes +described above will generate code to save/load all primitive types +to/from an archive. This code will usually just add the +data to the archive according to the archive format. +For example, a four byte integer is appended to a binary archive +as 4 binary bytes while a to a text archive it would be +rendered as a space followed by a string representation. + +

    Class Types

    +For class/struct types, the template operators &, <<, and >> +will generate code that invokes the programmer's serialization code for the +particular data type. There is no default. An attempt to serialize a +class/struct for which no serialization has been explicitly specified +will result in a compile time error. The serialiation of a class can +be specified via either a class member function or a free funcation which +takes a reference to an instance of the class as an argument. + +

    Member Function

    +The serialization library invokes the following code to save or load a class instance +to/from and archive. +
    
    +template<class Archive, class T>
    +inline void serialize(
    +    Archive & ar, 
    +    T & t, 
    +    const unsigned int file_version
    +){
    +    // invoke member function for class T
    +    t.serialize(ar, file_version);
    +}
    +
    +That is, the default definition of template serialize +presumes the existence of a class member function template of the following +signature: +
    
    +template<class Archive>
    +void serialize(Archive &ar, const unsigned int version){
    +    ...
    +}
    +
    +If such a member function is not declared, a compile time error will occur. In order +that the member function generated by this template can be called to +append the data to an archive, it either must be public or the class must +be made accessible to the serialization library by including: +
    
    +friend class boost::serialization::access;
    +
    +in the class definition. This latter method should be preferred over the option +of making member function public. This will prevent serialization functions from +being called from outside the library. This is almost certainly an error. Unfortunately, +it may appear to function but fail in a way that is very difficult to find. +

    +It may not be immediately obvious how this one template serves for both +saving data to an archive as well as loading data from the archive. +The key is that the & operator is +defined as << +for output archives and as >> input archives. The +"polymorphic" behavior of the & permits the same template +to be used for both save and load operations. This is very convenient in that it +saves a lot of typing and guarantees that the saving and loading of class +data members are always in sync. This is the key to the whole serialization +system. + +

    Free Function

    +Of course we're not restricted to using the default implementation described +above. We can override the default one with our own. Doing this will +permit us to implement serialization of a class without altering +the class definition itself. We call this non-intrusive +serialization. Suppose our class is named my_class, the +override would be specified as: +
    
    +// namespace selection
    +
    +template<class Archive>
    +inline void serialize(
    +    Archive & ar, 
    +    my_class & t, 
    +    const unsigned int file_version
    +){
    +    ...
    +}
    +
    + +Note that we have called this override "non-intrusive". This is slightly +inaccurate. It does not require that the class have special functions, that +it be derived from some common base class or any other fundamental design changes. +However, it will require access to the class members that are to +be saved and loaded. If these members are private, it won't be +possible to serialize them. So in some instances, minor modifications to the +class to be serialized will be necessary even when using this "non-intrusive" +method. In practice this may not be such a problem as many libraries +(E.G. STL) expose enough information to permit implementation of non-intrusive +serialization with absolutly no changes to the library. + +

    Namespaces for Free Function Overrides

    +For maximum portability, include any free functions templates and definitions in the +namespace boost::serialization. If portability is not a concern and the +compiler being used supports ADL (Argument Dependent Lookup) the free functions and +templates can be in any of the following namespaces: +
      +
    • boost::serialization +
    • namespace of the archive class +
    • namespace of the type being serialized +
    +

    +Note that, at first glance, this suggestion may seem to be wrong for compilers which implement +two phase lookup. In fact, the serialization library used a perhaps overly clever +method to support this rule even for such compilers. Those with an interest in studying +this furter will find more information in +serialization.hpp + +

    Serialization of Class Members

    +Regardless of which of the above methods is used, the body of the serialize function must +specify the data to be saved/loaded by sequential application of the archive +operator & to all the data members of the class. +
    
    +{
    +    // save/load class member variables
    +    ar & member1;
    +    ar & member2;
    +}
    +
    + +

    Base Classes

    +The header file + +base_object.hpp + +includes the template: +
    
    +template<class Base, class Derived>
    +Base & base_object(Derived &d);
    +
    +which should be used to create a reference to an object of the base +which can be used as an argument to the archive serialization operators. +So for a class of Serializable type +T the base class state should be +serialized like this: +
    
    +{
    +    // invoke serialization of the base class 
    +    ar & boost::serialization::base_object<base_class_of_T>(*this);
    +    // save/load class member variables
    +    ar & member1;
    +    ar & member2;
    +}
    +
    +Resist the temptation to just cast *this to the base class. +This might seem to work but may fail to invoke code necessary for +proper serialization. +

    +Note that this is NOT the same as calling the serialize +function of the base class. This might seem to work but will circumvent +certain code used for tracking of objects, and registering base-derived +relationships and other bookkeeping that is required for the serialization +system to function as designed. For this reason, all serialize +member functions should be private. + +

    const Members

    +Saving const members to an archive +requires no special considerations. +Loading const members can be addressed by using a +const_cast: +
    
    +    ar & const_cast<T &>(t);
    +
    +Note that this violates the spirit and intention of the const +keyword. const members are intialized when a class instance +is constructed and not changed thereafter. However, this may +be most appropriate in many cases. Ultimately, it comes down to +the question about what const means in the context +of serialization. + +

    Templates

    +Implementation serialization for templates is exactly the same process +as for normal classes and requires no additional considerations. Among +other things, this implies that serialization of compositions of templates +are automatically generated when required if serialization of the +component templates is defined. For example, this library includes +definition of serialization for boost::shared_ptr<T> and for +std::list<T>. If I have defined serialization for my own +class my_t, then serialization for +std::list< boost::shared_ptr< my_t> > is already available +for use. +

    +See for an example that shows how this idea might be implemented for your own +class templates, see + +demo_auto_ptr.cpp. +This shows how non-intrusive serialization +for the template auto_ptr from the standard library +can be implemented. +

    +A somewhat trickier addition of serialization to a standard template +can be found in the example + +shared_ptr.hpp + + +

    +In the specification of serialization for templates, its common +to split serialize +into a load/save pair. +Note that the convenience macro described +above +isn't helpful in these cases as the number and kind of +template class arguments won't match those used when splitting +serialize for a simple class. Use the override +syntax instead. + +

    Versioning

    +It will eventually occur that class definitions change after archives have +been created. When a class instance is saved, the current version +in included in the class information stored in the archive. When the class instance +is loaded from the archive, the original version number is passed as an +argument to the loading function. This permits the load function to include +logic to accommodate older definitions for the class and reconcile them +with latest version. Save functions always save the current version. So this +results in automatically converting older format archives to the newest versions. +Version numbers are maintained independently for each class. This results in +a simple system for permitting access to older files and conversion of same. +The current version of the class is assigned as a +Class Serialization Trait described later in this manual. +
    
    +{
    +    // invoke serialization of the base class 
    +    ar & boost::serialization::base_object<base_class_of_T>(*this);
    +    // save/load class member variables
    +    ar & member1;
    +    ar & member2;
    +    // if its a recent version of the class
    +    if(1 < file_version)
    +        // save load recently added class members
    +        ar & member3;
    +}
    +
    + +

    Splitting serialize into Save/Load

    +There are times when it is inconvenient to use the same +template for both save and load functions. For example, this might occur if versioning +gets complex. + +

    Splitting Member Functions

    +For member functions this can be addressed by including +the header file +boost/serialization/split_member.hpp including code like this in the class: +
    
    +template<class Archive>
    +void save(Archive & ar, const unsigned int version) const
    +{
    +    // invoke serialization of the base class 
    +    ar << boost::serialization::base_object<const base_class_of_T>(*this);
    +    ar << member1;
    +    ar << member2;
    +    ar << member3;
    +}
    +
    +template<class Archive>
    +void load(Archive & ar, const unsigned int version)
    +{
    +    // invoke serialization of the base class 
    +    ar >> boost::serialization::base_object<base_class_of_T>(*this);
    +    ar >> member1;
    +    ar >> member2;
    +    if(version > 0)
    +        ar >> member3;
    +}
    +
    +template<class Archive>
    +void serialize(
    +    Archive & ar,
    +    const unsigned int file_version 
    +){
    +    boost::serialization::split_member(ar, *this, file_version);
    +}
    +
    +This splits the serialization into two separate functions save +and load. Since the new serialize template +is always the same it can be generated by invoking the macro +BOOST_SERIALIZATION_SPLIT_MEMBER() defined in the header file + +boost/serialization/split_member.hpp +. +So the entire serialize function above can be replaced with: +
    
    +BOOST_SERIALIZATION_SPLIT_MEMBER()
    +
    +

    Splitting Free Functions

    +The situation is same for non-intrusive serialization with the free +serialize function template. + + +To use save and +load function templates rather than +serialize: +
    
    +namespace boost { namespace serialization {
    +template<class Archive>
    +void save(Archive & ar, const my_class & t, unsigned int version)
    +{
    +    ...
    +}
    +template<class Archive>
    +void load(Archive & ar, my_class & t, unsigned int version)
    +{
    +    ...
    +}
    +}}
    +
    +include the header file +
    +boost/serialization/split_free.hpp +. +and override the free serialize function template: +
    
    +namespace boost { namespace serialization {
    +template<class Archive>
    +inline void serialize(
    +    Archive & ar,
    +    my_class & t,
    +    const unsigned int file_version
    +){
    +    split_free(ar, t, file_version); 
    +}
    +}}
    +
    +To shorten typing, the above template can be replaced with +the macro: +
    
    +BOOST_SERIALIZATION_SPLIT_FREE(my_class)
    +
    + +Note that although the functionality to split the +serialize function into save/load +has been provided, the usage of the serialize +function with the corresponding & operator +is preferred. The key to the serialization implementation is that objects are saved +and loaded in exactly the same sequence. Using the & +operator and serialize +function guarantees that this is always the case and will minimize the +occurence of hard to find errors related to synchronization of +save and load +functions. +

    +Also note that BOOST_SERIALIZATION_SPLIT_FREE +must be used outside of any namespace. + +

    Pointers

    +A pointer to any class instance can be serialized with any of the archive +save/load operators. +

    +To properly save and restore an object through a pointer the +following situations must be addressed: +

      +
    1. If the same object is saved multiple times through different + pointers, only one copy of the object need be saved. +
    2. If an object is loaded multiple times through different pointers, + only one new object should be created and all returned pointers + should point to it. +
    3. The system must detect the case where an object is first + saved through a pointer then the object itself is saved. + Without taking extra precautions, loading would result in the + creation of multiple copies of the original object. This system detects + this case when saving and throws an exception - see below. +
    4. An object of a derived class may be stored through a + pointer to the base class. The true type of the object must + be determined and saved. Upon restoration the correct type + must be created and its address correctly cast to the base + class. That is, polymorphic pointers have to be considered. +
    5. NULL pointers must be dectected when saved and restored + to NULL when deserialized. +
    + +This serialization library addresses all of the above +considerations. The process of saving and loading an object +through a pointer is non-trivial. It can be summarized as +follows: +

    Saving a pointer: +

      +
    1. determine the true type of the object being pointed to. +
    2. write a special tag to the archive +
    3. if the object pointed to has not already been written + to the archive, do so now +
    +Loading a pointer: +
      +
    1. read a tag from the archive. +
    2. determine the type of object to be created +
    3. if the object has already been loaded, return it's address. +
    4. otherwise, create a new instance of the object +
    5. read the data back in using the operators described above +
    6. return the address of the newly created object. +
    + +Given that class instances are saved/loaded to/from the archive +only once, regardless of how many times they are serialized with +the << +and >> operators +
      +
    • Loading the same pointer object multiple times + results in only one object being created, thereby replicating + the original pointer configuration. +
    • Structures such as collections of polymorphic pointers, + are handled with no special effort on the part of users of this library. +
    +Serialization of pointers of derived types through a pointer to the +base class may require a little extra "help". Also, the programmer +may desire to modify the process described above for his own reasons. +For example, it might be desired to suppress the tracking of objects +as it is known a priori that the application in question can never +create duplicate objects. Serialization of pointers can be "fine tuned" +via the specification of Class Serialization Traits +as described in + +another section of this manual + + +

    Non-Default Constructors

    +Serialization of pointers is implemented in the library with code +similar to the following: +
    
    +// load data required for construction and invoke constructor in place
    +template<class Archive, class T>
    +inline void load_construct_data(
    +    Archive & ar, T * t, const unsigned int file_version
    +){
    +    // default just uses the default constructor to initialize
    +    // previously allocated memory. 
    +    ::new(t)T();
    +}
    +
    +The default load_construct_data invokes the +default constructor "in-place" to initialize the memory. +

    +If there is no such default constructor, the function templates +load_construct_data and +perhaps save_construct_data +will have to be overridden. Here is a simple example: +

    
    +class my_class {
    +private:
    +    friend class boost::serialization::access;
    +    const int m_attribute;  // some immutable aspect of the instance
    +    int m_state;            // mutable state of this instance
    +    template<class Archive>
    +    void serialize(Archive &ar, const unsigned int file_version){
    +        ar & m_state;
    +    }
    +public:
    +    // no default construct guarentees that no invalid object
    +    // ever exists
    +    my_class(int attribute) :
    +        m_attribute(attribute),
    +        m_state(0)
    +    {}
    +};
    +
    +the overrides would be: +
    
    +namespace boost { namespace serialization {
    +template<class Archive>
    +inline void save_construct_data(
    +    Archive & ar, const my_class * t, const unsigned int file_version
    +){
    +    // save data required to construct instance
    +    ar << t->m_attribute;
    +}
    +
    +template<class Archive>
    +inline void load_construct_data(
    +    Archive & ar, my_class * t, const unsigned int file_version
    +){
    +    // retrieve data from archive required to construct new instance
    +    int attribute;
    +    ar >> attribute;
    +    // invoke inplace constructor to initialize instance of my_class
    +    ::new(t)my_class(attribute);
    +}
    +}} // namespace ...
    +
    +In addition to the deserialization of pointers, these overrides are used +in the deserialization of STL containers whose element type has no default +constructor. + +

    Pointers to Objects of Derived Classes

    +

    Registration

    +Consider the following: +
    
    +class base {
    +    ...
    +};
    +class derived_one : public base {
    +    ...
    +};
    +class derived_two : public base {
    +    ...
    +};
    +main(){
    +    ...
    +    base *b;
    +    ...
    +    ar & b; 
    +}
    +
    +When saving b what kind of object should be saved? +When loading b what kind of object should be created? +Should it be an object of class derived_one, +derived_two, or maybe base? +

    +It turns out that the kind of object serialized depends upon whether the base class +(base in this case) is polymophic or not. +If base is not polymorphic, that is if it has no +virtual functions, then an object of the type base +will be serialized. Information in any derived classes will be lost. If this is what is desired +(it usually isn't) then no other effort is required. +

    + +If the base class is polymorphic, an object of the most derived type +(derived_one +or derived_two +in this case) will be serialized. The question of which type of object is to be +serialized is (almost) automatically handled by the library. +

    +The system "registers" each class in an archive the first time an object of that +class it is serialized and assigns a sequential number to it. Next time an +object of that class is serialized in that same archive, this number is written +in the archive. So every class is identified uniquely within the archive. +When the archive is read back in, each new sequence number is re-associated with +the class being read. Note that this implies that "registration" has to occur +during both save and load so that the class-integer table built on load +is identical to the class-integer table built on save. In fact, the key to +whole serialization system is that things are always saved and loaded in +the same sequence. This includes "registration". +

    +Expanding our previous example: +

    
    +main(){
    +    derived_one d1;
    +    derived_two d2:
    +    ...
    +    ar & d1;
    +    ar & d2;
    +    // A side effect of serialization of objects d1 and d2 is that
    +    // the classes derived_one and derived_two become known to the archive.
    +    // So subsequent serialization of those classes by base pointer works
    +    // without any special considerations.
    +    base *b;
    +    ...
    +    ar & b; 
    +}
    +
    +When b is read it is +preceded by a unique (to the archive) class identifier which +has previously been related to class derived_one or +derived_two. +

    +If a derived class has NOT been automatically "registered" as described +above, an +unregistered_class exception +will be thrown when serialization is invoked. +

    +This can be addressed by registering the derived class explicitly. All archives are +derived from a base class which implements the following template: +

    
    +template<class T>
    +register_type();
    +
    +So our problem could just as well be addressed by writing: +
    
    +main(){
    +    ...
    +    ar.template register_type<derived_one>();
    +    ar.template register_type<derived_two>();
    +    base *b;
    +    ...
    +    ar & b; 
    +}
    +
    +Note that if the serialization function is split between save and load, both +functions must include the registration. This is required to keep the save +and corresponding load in syncronization. + +

    Export

    +The above will work but may be inconvenient. We don't always know which derived +classes we are going to serialize when we write the code to serialize through +a base class pointer. Every time a new derived class is written we have to +go back to all the places where the base class is serialized and update the +code. +

    +So we have another method: +

    
    +#include <boost/serialization/export.hpp>
    +...
    +BOOST_CLASS_EXPORT_GUID(derived_one, "derived_one")
    +BOOST_CLASS_EXPORT_GUID(derived_two, "derived_two")
    +
    +main(){
    +    ...
    +    base *b;
    +    ...
    +    ar & b; 
    +}
    +
    +The macro BOOST_CLASS_EXPORT_GUID associates a string literal +with a class. In the above example we've used a string rendering +of the class name. If a object of such an "exported" class is serialized +through a pointer and is otherwise unregistered, the "export" string is +included in the archive. When the archive +is later read, the string literal is used to find the class which +should be created by the serialization library. +This permits each class to be in a separate header file along with its +string identifier. There is no need to maintain a separate "pre-registration" +of derived classes that might be serialized. This method of +registration is referred to as "key export". More information on this +topic is found in the section Class Traits - +Export Key. +

    +

    Instantiation

    +Registration by means of any of the above methods fulfill another role +whose importance might not be obvious. This system relies on templated +functions of the form template<class Archive, class T>. +This means that serialization code must be instantiated for each +combination of archive and data type that is serialized in the program. +

    +Polymorphic pointers of derived classes may never be referred to +explictly by the program so normally code to serialize such classes +would never be instantiated. So in addition to including export key +strings in an archive, BOOST_CLASS_EXPORT_GUID explicitly +instantiates the class serialization code for all archive classes used +by the program. + +

    Selective Tracking

    +Whether or not an object is tracked is determined by its +object tracking trait. +The default setting for user defined types is track_selectively. +That is, track objects if and only if they are serialized through pointers anywhere +in the program. Any objects that are "registered" by any of the above means are presumed +to be serialized through pointers somewhere in the program and therefore +would be tracked. In certain situations this could lead to an inefficiency. +Suppose we have a class module used by multiple programs. Because +some programs serializes polymorphic pointers to objects of this class, we +export a class +identifier by specifying BOOST_CLASS_EXPORT in the +class header. When this module is included by another program, +objects of this class will always be tracked even though it +may not be necessary. This situation could be addressed by using +track_never +in those programs. +

    +It could also occur that even though a program serializes through +a pointer, we are more concerned with efficiency than avoiding the +the possibility of creating duplicate objects. It could be +that we happen to know that there will be no duplicates. It could +also be that the creation of a few duplicates is benign and not +worth avoiding given the runtime cost of tracking duplicates. +Again, track_never +can be used. +

    Runtime Casting

    +In order to properly translate between base and derived pointers +at runtime, the system requires each base/derived pair be found +in a table. A side effect of serializing a base object with +boost::serialization::base_object<Base>(Derived &) +is to ensure that the base/derived pair is added to the table +before the main function is entered. +This is very convenient and results in a clean syntax. The only +problem is that it can occur where a derived class serialized +through a pointer has no need to invoke the serialization of +its base class. In such a case, there are two choices. The obvious +one is to invoke the base class serialization with base_object +and specify an empty function for the base class serialization. +The alternative is to "register" the Base/Derived relationship +explicitly by invoking the template +void_cast_register<Derived, Base>();. +Note that this usage of the term "register" is not related +to its usage in the previous section. Here is an example of how this is done: +
    
    +#include <sstream>
    +#include <boost/serialization/serialization.hpp>
    +#include <boost/archive/text_iarchive.hpp>
    +#include <boost/serialization/export.hpp>
    +
    +class base {
    +    friend class boost::serialization::access;
    +    //...
    +    // only required when using method 1 below
    +    // no real serialization required - specify a vestigial one
    +    template<class Archive>
    +    void serialize(Archive & ar, const unsigned int file_version){}
    +};
    +
    +class derived : public base {
    +    friend class boost::serialization::access;
    +    template<class Archive>
    +    void serialize(Archive & ar, const unsigned int file_version){
    +        // method 1 : invoke base class serialization
    +        boost::serialization::base_object<base>(*this);
    +        // method 2 : explicitly register base/derived relationship
    +        boost::serialization::void_cast_register<derived, base>(
    +            static_cast<derived *>=NULL),
    +            static_cast<base *>(NULL)
    +        )
    +    }
    +};
    +
    +BOOST_CLASS_EXPORT_GUID(derived, "derived")
    +
    +main(){
    +    //...
    +    std::stringstream ss;
    +    boost::archive::text_iarchive ar(ss);
    +    base *b;
    +    ar >> b; 
    +}
    +
    +

    + +In order for this template to be invoked in code compiled by non-conforming +compilers, the following syntax may be used: +

    
    +boost::serialization::void_cast_register(
    +    static_cast<Derived *>(NULL),
    +    static_cast<Base *>(NULL)
    +);
    +
    +For more information, see Template Invocation syntax + +

    References

    +Classes that contain reference members will generally require +non-default constructors as references can only be set when +an instance is constructed. The example of the previous section +is slightly more complex if the class has reference members. +This raises the question of how and where the objects being +referred to are stored and how are they created. Also there is the question about +references to polymorphic base classes. Basically, these +are the same questions that arise regarding pointers. This is +no surprise as references are really a special kind of pointer. +We address these questions by serializing references as though +they were pointers. +
    
    +class object;
    +class my_class {
    +private:
    +    friend class boost::serialization::access;
    +    int member1;
    +    object & member2;
    +    template<class Archive>
    +    void serialize(Archive &ar, const unsigned int file_version);
    +public:
    +    my_class(int m, object & o) :
    +        member1(m), 
    +        member2(o)
    +    {}
    +};
    +
    +the overrides would be: +
    
    +namespace boost { namespace serialization {
    +template<class Archive>
    +inline void save_construct_data(
    +    Archive & ar, const my_class * t, const unsigned int file_version
    +){
    +    // save data required to construct instance
    +    ar << t.member1;
    +    // serialize reference to object as a pointer
    +    ar << & t.member2;
    +}
    +
    +template<class Archive>
    +inline void load_construct_data(
    +    Archive & ar, my_class * t, const unsigned int file_version
    +){
    +    // retrieve data from archive required to construct new instance
    +    int m;
    +    ar >> m;
    +    // create and load data through pointer to object
    +    // tracking handles issues of duplicates.
    +    object * optr;
    +    ar >> optr;
    +    // invoke inplace constructor to initialize instance of my_class
    +    ::new(t)my_class(m, *optr);
    +}
    +}} // namespace ...
    +
    + +

    Arrays

    +If T is a serializable type, +then any native C++ array of type T is a serializable type. +That is, if T +is a serializable type, then the following +is automatically available and will function as expected: +
    
    +T t[4];
    +ar << t;
    +    ...
    +ar >> t;
    +
    + +

    Class Serialization Traits

    + +

    Serialization Wrappers

    + +

    Models - Serialization Implementations Included in the Library

    +The facilities described above are sufficient to implement +serialization for all STL containers. In fact, this has been done +and has been included in the library. For example, in order to use +the included serialization code for std::list, use: +
    
    +#include <boost/serialization/list.hpp>
    +
    +rather than +
    
    +#include <list>
    +
    +Since the former includes the latter, this all that is necessary. +The same holds true for all STL collections as well as templates +required to support them (e.g. std::pair). +

    +As of this writing, the library contains serialization of the following boost clases: +

      +
    • optional +
    • variant +
    • scoped_ptr +
    • shared_ptr +
    • auto_ptr (demo) +
    +Others are being added to the list so check the boost files section and headers for +new implementations! +
    +

    © Copyright Robert Ramey 2002-2004. +Distributed under 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) +

    + + diff --git a/deal.II/contrib/boost/libs/serialization/doc/shared_ptr.html b/deal.II/contrib/boost/libs/serialization/doc/shared_ptr.html new file mode 100644 index 0000000000..932ab59d2e --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/doc/shared_ptr.html @@ -0,0 +1,233 @@ + + + + + + + +Template serialization - shared_ptr + + + + + + + +
    +

    C++ Boost

    +
    +

    Serialization

    +

    Template serialization - shared_ptr<class T>

    +
    +
    +All the code snippets included below are defined within the +boost::serialization namespace. +

    +shared_ptr<T> is defined in +shared_ptr.hpp. +

    +The general class outline for a shared_ptr<T> is: +

    +
    shared_ptr<T> contains: +
    +
    T *px; +
    shared_count pn; which contains a pointer to: +
    +
    sp_counted_base_impl<T, ...> which is +derived from the polymorphic abstract class +
    +
    sp_counted_base +
    +
    +
    +
    +The serialization process proceeds down the tree above. +

    +The first cut at implementing serialization for shared_ptr +just serializes the relevant members of shared_ptr. +It's almost trivial: +

    
    +template<class Archive, class T>
    +inline void serialize(
    +    Archive & ar,
    +    shared_ptr<T> & t,
    +    const unsigned int file_version,
    +    int
    +){
    +    ar & t.px; // save the raw pointer
    +    ar & t.pn; // save the shared reference count
    +}
    +
    +So far so good. Now for the serialization of shared_count: +
    
    +template<class Archive>
    +inline void save(
    +    Archive & ar,
    +    const boost::detail::shared_count & t,
    +    const unsigned int file_version
    +){
    +    ar << t.pi_;
    +}
    +
    +template<class Archive>
    +inline void load(
    +    Archive & ar,
    +    boost::detail::shared_count & t,
    +    const unsigned int file_version
    +){
    +    ar >> t.pi_;
    +}
    +
    +A key feature of this library is the ability to specify serialization +of a class or template without changing the class or template declaration +or definition. This is referred to as non-intrusive serialization. +

    +The pi_member of shared count is a pointer to an +instance of sp_counted_base_impl. Since this class +doesn't have a default constructor, serialization requires +specification of the following overload: +

    
    +template<class Archive, class P, class D>
    +inline void save_construct_data(
    +    Archive & ar,
    +    const boost::detail::sp_counted_base_impl * t, 
    +    const unsigned int file_version
    +){
    +    // variables used for construction
    +    ar << t->ptr;
    +    ar << *t;
    +}
    +
    +template
    +inline void load_construct_data(
    +    Archive & ar,
    +    boost::detail::sp_counted_base_impl * t, 
    +    const unsigned int file_version
    +){
    +    P ptr_;
    +    ar >> ptr_;
    +    // placement new
    +    ::new(t)boost::detail::sp_counted_base_impl(ptr_,  D());
    +    ar >>; *t;
    +}
    +
    +The statement ar >> ptr_ is key. This deserializes +the same pointer deserialzed above. Default object tracking will ensure +that no more than one instance of the object is created and that the +pointer returned by multiple deserializations are all the same. Hence, +regardless of how many instances of shared_ptr/shared_count +corresponding to a particular object are created, the will all point +to the same object. +

    +Since sp_counted_base_impl<P, D> is derived from +sp_counted_base, the following is needed: + +

    
    +template<class Archive, class P, class D>
    +inline void serialize(
    +    Archive & ar,
    +    boost::detail::sp_counted_base_impl<P, D> & t,
    +    const unsigned int file_version,
    +    int
    +){
    +    ar & boost::serialization::base_object<
    +	boost::detail::sp_counted_base
    +    >(*this);
    +}
    +
    +which will in turn require serialization of its base class: +
    
    +inline void serialize(
    +    Archive & ar,
    +    boost::detail::sp_counted & t,
    +    const unsigned int file_version,
    +    int
    +){
    +}
    +
    +It would seem we're done, running the test program, + +demo_shared_ptr.cpp +, +with this code produces the following output. +
    
    +a = 0x003017A0 use count = 2
    +a1 = 0x003017A0 use count = 2
    +unique element count = 1
    +a = 0x00000000 use count = 0
    +a1 = 0x00000000 use count = 0
    +unique element count = 0
    +a = 0x00303060 use count = 1
    +a1 = 0x00303060 use count = 1
    +unique element count = 1
    +
    +This indicates that we're not quite done. Due to default object +tracking, sp_counted_base_impl<P, D> is only +created once regardless of how many shared pointers point to the +same object. Of course, it has to be this way. The reference +count starts at 1 and is never incrememented. Code must be added +to the serialization functions to maintain the proper reference +count. +

    +The process of serialization of an empty base class - +sp_counted_base - seems like additional overhead. +Examination of code in + +base_object.hpp + +reveals that base_object.hpp provides two functions: +

      +
    • invokes serialization of the base class data +
    • as a side effect, "registers" the fact base/derived relationship +so that conversions of pointers between base and derived classes can be +made at runtime. +
    +In this case we need only the latter function so we can replace the +base object serialization with: +
    
    +// register the relationship between each derived class
    +// its polymorphic base
    +void_cast_register<
    +    boost::detail::sp_counted_base_impl<P, D>
    +    boost::detail::sp_counted_base, 
    +>();
    +
    +and we don't have to include a trival serializer for sp_counted_base +

    +Finally we need to specify name-value pair wrappers if we want to be able +to use this serialization with XML archives. +

    +Actually, even this is really just a start. Among the issues not addressed in +this implementation are: +

      +
    • weak_ptr is not addressed. I haven't even looked into this. +
    • Other smart pointers that might interact with shared_ptr + haven't been addressed at all. To be confident that the implementation is + complete and correct, all these should be addressed as well. +
    • Exception handling hasn't been exhaustively considered. +
    • Other issues yet to be discovered. +
    +One thing that has been considered is export of shared_ptr. The header which +declares shared pointer serialization includes some special macros for exporting +shared pointers: +
    +BOOST_SHARED_POINTER_EXPORT(T)
    +BOOST_SHARED_POINTER_EXPORT_GUID(T, K)
    +
    +These are specialize versions of the macros used for exporting classes serialized through raw pointers. +

    +Clearly, complete, correct and exception safe serialization of smart pointers is going to +be a challenge. I hope that this implementation provides a useful +starting point for such an effort. +


    +

    © Copyright Robert Ramey 2002-2004. +Distributed under 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) +

    + + diff --git a/deal.II/contrib/boost/libs/serialization/doc/shared_ptr2.html b/deal.II/contrib/boost/libs/serialization/doc/shared_ptr2.html new file mode 100644 index 0000000000..0e831b798e --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/doc/shared_ptr2.html @@ -0,0 +1,103 @@ + + + + + + + +Template serialization - shared_ptr + + + + + + + +
    +

    C++ Boost

    +
    +

    Serialization

    +

    shared_ptr<class T> Revisited

    +
    +
    +The previously described serialization of shared_ptr +illustrates the straightforward way of serializing a moderately complicated class structure. +Unfortunately, this way of doing it suffered from some undesirable features +
      +
    • It was dependent on the Boost implementation of shared_ptr. + The shared_ptr interface has been included + in std::tr1 and may someday be included in the standard + C++ library. An implementation which depends only on the public interface can be guaranteed to + function with any other future implementation of shared_ptr. +
    • It required extra macros for export. +
    + +
    
    +template<class Archive, class T>
    +inline void save(
    +    Archive & ar,
    +    const boost::shared_ptr<T> &t,
    +    const unsigned int /* file_version */
    +){
    +    const T * t_ptr = t.get();
    +    // just serialize the underlying raw pointer
    +    ar <<: boost::serialization::make_nvp("px", t_ptr);
    +}
    +
    +template<class Archive, class T>
    +inline void load(
    +    Archive & ar,
    +    boost::shared_ptr<T> &t,
    +    const unsigned int file_version
    +){
    +    T* r;
    +    // recover the underlying raw pointer
    +    ar >> boost::serialization::make_nvp("px", r);
    +
    +    // To Do - match up with other shared pointers which 
    +    // use this same raw pointer.
    +    ...
    +}
    +
    + +In principle, this is very much simpler than the original implementation. Completion of +this code requires: + +
      +
    1. Filling in the "To Do". This required making an extra map for + shared_ptr instances. +
    2. A method for identifying pointers to the same objects from pointers to their base classes. +
    3. Backward compatibility with pointers serialized by the previous method. This exploits + the serialization class versioning. +
    4. Proper handling of weak_ptr. +
    + +The result of this effort can be found in + +boost::serialization::shared_ptr.hpp + +

    +Note that if your code needs to read archives created under boost version 1.32, you will +have to include the following + +

    
    +#include <boost/serialization/shared_ptr_132.hpp>
    +#include <boost/serialization/shared_ptr.hpp>
    +
    +rather than just +
    
    +#include <boost/serialization/shared_ptr.hpp>
    +
    + +
    +

    © Copyright Robert Ramey 2002-2004. +Distributed under 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) +

    + + diff --git a/deal.II/contrib/boost/libs/serialization/doc/simple_log.html b/deal.II/contrib/boost/libs/serialization/doc/simple_log.html new file mode 100644 index 0000000000..1a6281edc2 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/doc/simple_log.html @@ -0,0 +1,95 @@ + + + + + + + +Serialization - Derivation from an Existing Archive + + + + + + + +
    +

    C++ Boost

    +
    +

    Serialization

    +

    A Simple Logging Archive Class

    +
    +
    +The purpose of this example help clarify the usage of the +Archive Concept +so that one can implement his own archive classes. + +simple_log_archive.hpp implements a simple but useful +archive class. This class can be used to send any serializable types +on an output text stream in a readable format. Usage of this facility +is trivially easy: + +
    
    +#include "simple_log_archive.hpp"
    +...
    +// display the complete schedule
    +simple_log_archive log(std::cout);
    +log << schedule;
    +
    + +and it produces the following output + +
    
    +schedule 
    + count 6
    + item 
    +  first 
    +   driver bob
    +   hour 6
    +   minute 24
    +  second -> 
    +   stops 
    +    count 3
    +    item -> 
    +     latitude 
    +      degrees 34
    +      minutes 135
    +      seconds 52.56
    +     longitude 
    +      degrees 134
    +      minutes 22
    +      seconds 78.3
    +...
    +
    + +The complete example is +demo_simple_log.cpp. Look at +Trivial Archive to get a +better understanding of how this works. + +Also, note the following: +
      +
    • Only 160 lines of code. +
    • Header only - linking with the serialization library not required. +
    • Displays ALL Serializable types. +
    • Lacks some features. +
        +
      • it will not display the data from the derived type given the pointer to a + polymorphic base class. That is, only displays the information of the base class. + To add that see the next example. +
      • doesn't display information serialized as binary data +
      +
    + +
    +

    © Copyright Robert Ramey 2002-2010. +Distributed under 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) +

    + + diff --git a/deal.II/contrib/boost/libs/serialization/doc/singleton.html b/deal.II/contrib/boost/libs/serialization/doc/singleton.html new file mode 100644 index 0000000000..80f71c8824 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/doc/singleton.html @@ -0,0 +1,256 @@ + + + + + + + +Serialization - singleton + + + + + + + +
    +

    C++ Boost

    +
    +

    Serialization

    +

    singleton

    +
    +
    +
    +
    Motivation +
    Features +
    Class Interface +
    Requirements +
    Examples +
    Multi-Threading +
    + +

    Motivation

    +The serialization library relies on the existence of a number +of static variables and tables to store information related +to runtime types. Examples are tables which relate exported +names to types and tables which relate base classes to derived +classes. Construction, destruction and usage of these variables +requires consideration of the following issues: +
      +
    • Some static data variables and constants entries refer to others. + The sequence of initialization cannot be arbitrary but must be in proper + sequence.
    • +
    • A number of static variables aren't referred explicitly and, without + special precautions, will be stripped by most code optimizers
    • +
    • Many of these variables are created by templates and special care must + be taken to be sure that they are instantiated
    • +
    • In a multi-threading system, its possible that these static variables + will be accessed concurrently by separate threads. This would create a + race condition with unpredictabe behavior
    • +
    +This singleton class addresses all of the above issues. + +

    Features

    +This singleton implementation has the following features: +
      +
    • + Any instance will be constructed before any attempt is made to access it.
    • +
    • + Any instance created with a template is guarenteed to be instantiated. +
    • + Regardless of whether or not an instance has been explicitly + referred to, it will not be stripped by the optimizer when the + executable is built in release mode. +
    • + All instances are constructed before + main is called + regardless of where they might be referenced within the program. + In a multi-tasking system, this guarentees that there will be no + race conditions during the construction of any instance. No + thread locking is required to guarentee this. +
    • + The above implies that any const + instances are thread-safe during the whole program. Again, no + thread locking is required. +
    • + If a mutable instance is created, and such an instance is modified + after main is called in a mult-threading system, there exists + the possibility that a race condition will occur. The serialization + library takes care that in the few places where a mutable + singleton is required, it is not altered after + main is called. + For a more general purpose usage, thread locking on this + singleton could easily be implemented. But as the serialization + library didn't require it, it wasn't implemented. +
    + +

    Class Interface

    +
    
    +namespace boost { 
    +namespace serialization {
    +
    +template 
    +class singleton : public boost::noncopyable
    +{
    +public:
    +    static const T & get_const_instance();
    +    static T & get_mutable_instance();
    +    static bool is_destroyed();
    +};
    +
    +} // namespace serialization 
    +} // namespace boost
    +
    + +
    + +

    
    +static const T & get_const_instance();
    +

    +
    +Retrieve a constant reference to the singleton for this type. +
    + +

    
    +static T & get_mutable_instance();
    +

    +
    +Retrieve a mutable reference to the singleton for this type. +
    + +

    
    +static bool is_destroyed();
    +

    +
    +Return true if the destructor on this singleton has been +called. Otherwise, return false. +
    + +
    + +

    Requirements

    +In order to be used as + + +singleton<T> + + +, the type T must be default constructable. +It doesn't require static variables - though it may have them. +Since the library guarentees that only one instance of + + +singleton<T> + + +and all accesss is through the above static interface +functions, common member functions of T become +the functional equivalent of +static functions. + +

    Examples

    +There are at least two different ways to use this class template. +Both are used in the serialization library. +

    +The first way is illustrated by and excerpt from the file +extended_type_info.cpp. +which contains the following code: + +

    
    +typedef std::set ktmap;
    +...
    +void
    +extended_type_info::key_register(const char *key) {
    +    ...
    +    result = singleton::get_mutable_instance().insert(this);
    +    ...
    +}
    +
    +Just by referring to the singleton instance anywhere in the program +will guarentee that one and only one instance for the specified +type (ktmap in this example) +will exist throughout the program. There is no need for anyother +declaration or definition. +

    +A second way is to use + + +singleton<T> + + +as one of the base classes of the type. This is illustrated by a simplified +excerpt from + + +extended_type_info_typeid.hpp + + + +

    
    +template<class T>
    +class extended_type_info_typeid : 
    +    public detail::extended_type_info_typeid_0,
    +    public singleton<extended_type_info_typeid<const T> >
    +{
    +    friend class singleton<extended_type_info_typeid<const T> >;
    +private:
    +    // private constructor to inhibit any existence other than the 
    +    // static one.  Note: not all compilers support this !!!
    +    extended_type_info_typeid() :
    +        detail::extended_type_info_typeid_0()
    +    {
    +        type_register(typeid(T));
    +    }
    +    ~extended_type_info_typeid(){}
    +    ...
    +};
    +
    + +This usage will permit a more natural syntax to be used: +
    
    +extended_type_info_typeid<T>::get_const_instance()
    +
    + +Again, including one or more of the above statements anywhere +in the program will guarentee that one and only one instance +is created and referred to. + +

    Multi-Threading

    +This singleton CAN be safely used in multi-threading applications if one +is careful follow a simple rule: +

    +Do not call get_mutable_instance when more than one thread is running! +<'> +All singletons used in the serialization library follow this rule. +In order to help detect accidental violations of this rule there +exists an singleton lock/unlock functions. +

    
    +void boost::serialization::singleton_module::lock();
    +void boost::serialization::singleton_module::unlock();
    +bool boost::serialization::singleton_module::is_locked();
    +
    +In a program compiled for debug, any invocation of +get_mutable_instance() +while the library is in a "locked" state will trap in an assertion. +The singleton module lock state is initialized as "unlocked" to permit +alteration of static variables before +main is called. +The lock() and +unlock() are "global" +in they affect ALL the singletons defined by this template. +All serialization tests invoke lock() +at the start of the progam. For programs compiled in release +mode these functions have no effect. + +
    +

    © Copyright Robert Ramey 2007. +Distributed under 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) +

    + + diff --git a/deal.II/contrib/boost/libs/serialization/doc/smart_cast.html b/deal.II/contrib/boost/libs/serialization/doc/smart_cast.html new file mode 100644 index 0000000000..1d43e8ad06 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/doc/smart_cast.html @@ -0,0 +1,155 @@ + + + + + + + +Serialization - BOOST_STATIC_WARNING + + + + + + + +
    +

    C++ Boost

    +
    +

    Serialization

    +

    smart_cast

    +
    +
    +

    Motivation

    +To cast from one type to another related type, C++ provides the following +operators: + +
    +
    static_cast<T *<>(U *)
    static_cast<T &<>(U &)
    +
    +
      +
    • required if neither T nor U are not polymorphic +
    • permitted in other cases. +
    • fails to detect erroneas casts of polymophic pointers/references at runtime. +
    • does not permit "cross casting" +
    • inline function calls can be optimized away during compile time. +
    +
    +

    +

    dynamic_cast<T *<>(U *)
    dynamic_cast<T &<>(U &)
    +
    +
      +
    • permitted if either T or U are polymorphic +
    • prohibited in other cases. +
    • throws exception on detecting erroneas casts of polymorphic pointers/references + at runtime. +
    • permits "cross casting" +
    • cannot optimise inline virtual functions at compile time. +
    +
    +
    + +These rules can make it difficult to use casting with a function template argument. +Consider the following example: + +
    
    +#include <boost/serialization/smart_cast.hpp>
    +
    +struct top {
    +};
    +
    +struct base1 : public top {
    +    bool is_storable() const {
    +        return true;
    +    }
    +    virtual ~base1();
    +};
    +
    +struct base2 {
    +    virtual ~base2();
    +};
    +
    +struct derived1 :
    +    public base1
    +{
    +    derived1();
    +};
    +
    +struct derived2 :
    +    public base1, 
    +    public base2
    +{
    +    derived2();
    +};
    +
    +template<class T>
    +bool is_storable(T &t){
    +    // what type of cast to use here?
    +
    +    // this fails at compiler time when T == base2
    +    // return static_cast<base1 &>(t).is_storable();
    +
    +    // this fails at compiler time when T == top
    +    // otherwise it works but cannot optimize inline function call
    +    // return dynamic_cast<base1 &>(t).is_storable();
    +
    +    // this always works - and is guarenteed to generate the fastest code !
    +    return (boost::smart_cast_reference<base1 &>(t)).is_storable();
    +}
    +
    +int main(){
    +    derived1 d1;
    +    top & t1 = d1;
    +    derived2 d2;
    +    base2 & b2 = d2;
    +
    +    bool result;
    +    result = is_storable(d1);   
    +    result = is_storable(d2);   
    +    result = is_storable(b2);
    +    result = is_storable(b2);
    +    result = is_storable(t1);
    +    return 0;
    +}
    +
    +The serialization library includes a mix of classes which use +both static polymorphism (CRTP) and dynamic +polymorphism via virtual functions. smart_cast +was written to address the more problematic manifestations of the +situation exmplified above. + +

    Usage

    +The following syntax is supported: +
    
    +smart_cast<Target *, Source *>(Source * s);
    +smart_cast<Target *>(Source * s);
    +smart_cast<Target &, Source &>(Source & s);
    +
    +Note that the above syntax doesn't include +
    
    +smart_cast<Target & >(Source & s)
    +
    +but the same functionality is supported the the following special syntax +
    
    +smart_cast_reference<Target &>(Source & s)
    +
    + +

    Requirements

    +smart_cast can be used only on compilers that support partial +template specialization or on types for which have be specified with the +macro +BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(<type>) +has been applied. + +
    +

    © Copyright Robert Ramey 2002-2004. +Distributed under 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) +

    + + diff --git a/deal.II/contrib/boost/libs/serialization/doc/special.html b/deal.II/contrib/boost/libs/serialization/doc/special.html new file mode 100644 index 0000000000..ea95bf6d76 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/doc/special.html @@ -0,0 +1,591 @@ + + + + + + + +Serialization - Special Considerations + + + + + + + +
    +

    C++ Boost

    +
    +

    Serialization

    +

    Special Considerations

    +
    +
    +
    +
    Object Tracking +
    Class Information +
    Archive Portability +
    +
    Numerics +
    Traits +
    +
    Binary Archives +
    XML Archives +
    Exporting Class Serialization +
    Static Libraries and Serialization +
    DLLS - Serialization and Runtime Linking +
    Plugins +
    Multi-Threading +
    Optimizations +
    Archive Exceptions +
    Exception Safety +
    + +

    Object Tracking

    +Depending on how the class is used and other factors, serialized objects +may be tracked by memory address. This prevents the same object from being +written to or read from an archive multiple times. These stored addresses +can also be used to delete objects created during a loading process +that has been interrupted by throwing of an exception. +

    +This could cause problems in +progams where the copies of different objects are saved from the same address. +

    
    +template<class Archive>
    +void save(boost::basic_oarchive  & ar, const unsigned int version) const
    +{
    +    for(int i = 0; i < 10; ++i){
    +        A x = a[i];
    +        ar << x;
    +    }
    +}
    +
    +In this case, the data to be saved exists on the stack. Each iteration +of the loop updates the value on the stack. So although the data changes +each iteration, the address of the data doesn't. If a[i] is an array of +objects being tracked by memory address, the library will skip storing +objects after the first as it will be assumed that objects at the same address +are really the same object. +

    +To help detect such cases, output archive operators expect to be passed +const reference arguments. +

    +Given this, the above code will invoke a compile time assertion. +The obvious fix in this example is to use +

    
    +template<class Archive>
    +void save(boost::basic_oarchive & ar, const unsigned int version) const
    +{
    +    for(int i = 0; i < 10; ++i){
    +        ar << a[i];
    +    }
    +}
    +
    +which will compile and run without problem. +The usage of const by the output archive operators +will ensure that the process of serialization doesn't +change the state of the objects being serialized. An attempt to do this +would constitute augmentation of the concept of saving of state with +some sort of non-obvious side effect. This would almost surely be a mistake +and a likely source of very subtle bugs. +

    +Unfortunately, implementation issues currently prevent the detection of this kind of +error when the data item is wrapped as a name-value pair. +

    +A similar problem can occur when different objects are loaded to and address +which is different from the final location: +

    
    +template<class Archive>
    +void load(boost::basic_oarchive  & ar, const unsigned int version) const
    +{
    +    for(int i = 0; i < 10; ++i){
    +        A x;
    +        ar >> x;
    +        std::m_set.insert(x);
    +    }
    +}
    +
    +In this case, the address of x is the one that is tracked rather than +the address of the new item added to the set. Left unaddressed +this will break the features that depend on tracking such as loading object through a pointer. +Subtle bugs will be introduced into the program. This can be +addressed by altering the above code thusly: + +
    
    +template<class Archive>
    +void load(boost::basic_iarchive  & ar, const unsigned int version) const
    +{
    +    for(int i = 0; i < 10; ++i){
    +        A x;
    +        ar >> x;
    +        std::pair<std::set::const_iterator, bool> result;
    +        result = std::m_set.insert(x);
    +        ar.reset_object_address(& (*result.first), &x);
    +    }
    +}
    +
    +This will adjust the tracking information to reflect the final resting place of +the moved variable and thereby rectify the above problem. +

    +If it is known a priori that no pointer +values are duplicated, overhead associated with object tracking can +be eliminated by setting the object tracking class serialization trait +appropriately. +

    +By default, data types designated primitive by +Implementation Level +class serialization trait are never tracked. If it is desired to +track a shared primitive object through a pointer (e.g. a +long used as a reference count), It should be wrapped +in a class/struct so that it is an identifiable type. +The alternative of changing the implementation level of a long +would affect all longs serialized in the whole +program - probably not what one would intend. +

    +It is possible that we may want to track addresses even though +the object is never serialized through a pointer. For example, +a virtual base class need be saved/loaded only once. By setting +this serialization trait to track_always, we can suppress +redundant save/load operations. +

    
    +BOOST_CLASS_TRACKING(my_virtual_base_class, boost::serialization::track_always)
    +
    + +

    Class Information

    +By default, for each class serialized, class information is written to the archive. +This information includes version number, implementation level and tracking +behavior. This is necessary so that the archive can be correctly +deserialized even if a subsequent version of the program changes +some of the current trait values for a class. The space overhead for +this data is minimal. There is a little bit of runtime overhead +since each class has to be checked to see if it has already had its +class information included in the archive. In some cases, even this +might be considered too much. This extra overhead can be eliminated +by setting the +implementation level +class trait to: boost::serialization::object_serializable. +

    +Turning off tracking and class information serialization will result +in pure template inline code that in principle could be optimised down +to a simple stream write/read. Elimination of all serialization overhead +in this manner comes at a cost. Once archives are released to users, the +class serialization traits cannot be changed without invalidating the old +archives. Including the class information in the archive assures us +that they will be readable in the future even if the class definition +is revised. A light weight structure such as display pixel might be +declared in a header like this: + +

    
    +#include <boost/serialization/serialization.hpp>
    +#include <boost/serialization/level.hpp>
    +#include <boost/serialization/tracking.hpp>
    +
    +// a pixel is a light weight struct which is used in great numbers.
    +struct pixel
    +{
    +    unsigned char red, green, blue;
    +    template<class Archive>
    +    void serialize(Archive & ar, const unsigned int /* version */){
    +        ar << red << green << blue;
    +    }
    +};
    +
    +// elminate serialization overhead at the cost of
    +// never being able to increase the version.
    +BOOST_CLASS_IMPLEMENTATION(pixel, boost::serialization::object_serializable);
    +
    +// eliminate object tracking (even if serialized through a pointer)
    +// at the risk of a programming error creating duplicate objects.
    +BOOST_CLASS_TRACKING(pixel, boost::serialization::track_never)
    +
    + +

    Archive Portability

    +Several archive classes create their data in the form of text or portable a binary format. +It should be possible to save such an of such a class on one platform and load it on another. +This is subject to a couple of conditions. +

    Numerics

    +The architecture of the machine reading the archive must be able hold the data +saved. For example, the gcc compiler reserves 4 bytes to store a variable of type +wchar_t while other compilers reserve only 2 bytes. +So its possible that a value could be written that couldn't be represented by the loading program. This is a +fairly obvious situation and easily handled by using the numeric types in +<boost/cstdint.hpp> +

    +A special integral type is std::size_t which is a typedef +of an integral types guaranteed to be large enough +to hold the size of any collection, but its actual size can differ depending +on the platform. The +collection_size_type +wrapper exists to enable a portable serialization of collection sizes by an archive. +Recommended choices for a portable serialization of collection sizes are to +use either 64-bit or variable length integer representation. + + +

    Traits

    +Another potential problem is illustrated by the following example: +
    
    +template<class T>
    +struct my_wrapper {
    +    template<class Archive>
    +    Archive & serialize ...
    +};
    +
    +...
    +
    +class my_class {
    +    wchar_t a;
    +    short unsigned b;
    +    template<class Archive>
    +    Archive & serialize(Archive & ar, unsigned int version){
    +        ar & my_wrapper(a);
    +        ar & my_wrapper(b);
    +    }
    +};
    +
    +If my_wrapper uses default serialization +traits there could be a problem. With the default traits, each time a new type is +added to the archive, bookkeeping information is added. So in this example, the +archive would include such bookkeeping information for +my_wrapper<wchar_t> and for +my_wrapper<short_unsigned>. +Or would it? What about compilers that treat +wchar_t as a +synonym for unsigned short? +In this case there is only one distinct type - not two. If archives are passed between +programs with compilers that differ in their treatment +of wchar_t the load operation will fail +in a catastrophic way. +

    +One remedy for this is to assign serialization traits to the template +my_template such that class +information for instantiations of this template is never serialized. This +process is described above and +has been used for Name-Value Pairs. +Wrappers would typically be assigned such traits. +

    +Another way to avoid this problem is to assign serialization traits +to all specializations of the template my_wrapper +for all primitive types so that class information is never saved. This is what has +been done for our implementation of serializations for STL collections. + +

    Binary Archives

    +Standard stream i/o on some systems will expand linefeed characters to carriage-return/linefeed +on output. This creates a problem for binary archives. The easiest way to handle this is to +open streams for binary archives in "binary mode" by using the flag +ios::binary. If this is not done, the archive generated +will be unreadable. +

    +Unfortunately, no way has been found to detect this error before loading the archive. Debug builds +will assert when this is detected so that may be helpful in catching this error. + +

    XML Archives

    +XML archives present a somewhat special case. +XML format has a nested structure that maps well to the "recursive class member visitor" pattern +used by the serialization system. However, XML differs from other formats in that it +requires a name for each data member. Our goal is to add this information to the +class serialization specification while still permiting the the serialization code to be +used with any archive. This is achived by requiring that all data serialized to an XML archive +be serialized as a name-value pair. +The first member is the name to be used as the XML tag for the +data item while the second is a reference to the data item itself. Any attempt to serialize data +not wrapped in a in a name-value pair will +be trapped at compile time. The system is implemented in such a way that for other archive classes, +just the value portion of the data is serialized. The name portion is discarded during compilation. +So by always using name-value pairs, it will +be guarenteed that all data can be serialized to all archive classes with maximum efficiency. + +

    Exporting Class Serialization

    +Elsewhere in this manual, we have described +BOOST_CLASS_EXPORT. +Export implies two things: +
      +
    • Instantiates code which is not otherwise referred to. +
    • Associates an external identifier with the class to be serialized. +The fact that the class isn't explicitly referred to implies this +requirement. +
    +In C++, usage of code not explicitly referred to is implemented via +virtual functions. Hence, the need for export is implied by the +usage of a derived class that is manipulated via a pointer or +reference to it's base class. + +

    +BOOST_CLASS_EXPORT in the same +source module that includes any of the archive class headers will +instantiate code required to serialize polymorphic pointers of +the indicated type to the all those archive classes. If no +archive class headers are included, then no code will be instantiated. + +

    +Note that the implemenation of this functionality requires +that the BOOST_CLASS_EXPORT +macro appear after and the inclusion of any archive +class headers for which code is to be instantiated. +So, code that uses BOOST_CLASS_EXPORT +will look like the following: +

    
    +#include <boost/archive/text_oarchive.hpp>
    +#include <boost/archive/text_oarchive.hpp>
    +... // other archives
    +
    +#include "a.hpp" // header declaration for class a
    +BOOST_CLASS_EXPORT(a)
    +... // other class headers and exports
    +
    +This will be true regardless of whether the is part +of a stand alone executable, a static library or +a dyanmic or shared library. +

    +Including +BOOST_CLASS_EXPORT +in the "a.hpp" header itself as one would do with +other serialization traits will make it difficult +or impossible to follow the rule above regarding +inclusion of archive headers before +BOOST_CLASS_EXPORT +is invoked. This can best be addressed by using +BOOST_CLASS_EXPORT_KEY +in the header declarations and +BOOST_CLASS_EXPORT_IMPLEMENT +in the class definition file. + +

    +This system has certain implications for placing code in static or shared +libraries. Placing BOOST_CLASS_EXPORT +in library code will have no effect unless archive class headers are +also included. So when building a library, one should include all headers +for all the archive classes which he anticipates using. Alternatively, +one can include headers for just the +Polymoprhic Archives. + +

    +Strictly speaking, export should not be necessary if all pointer serialization +occurs through the most derived class. However, in order to detect +what would be catastophic error, the library traps ALL serializations through +a pointer to a polymorphic which are not exported or otherwise registered. +So, in practice, be prepared to register or export all classes with one +or more virtual functions which are serialized through a pointer. + +

    +Note that the implementation of this functionality depends upon vendor +specific extensions to the C++ language. So, there is no guarenteed portability +of programs which use this facility. However, all C++ compilers which +are tested with boost provide the required extensions. The library +includes the extra declarations required by each of these compilers. +It's reasonable to expect that future C++ compilers will support +these extensions or something equivalent. + +

    Static Libraries and Serialization

    +Code for serialization of data types can be saved in libraries +just as it can for the rest of the type implementation. +This works well, and can save huge amount of compilation time. +
      +
    • Only compile serialization definitions in the library. +
    • Explicitly instantiate serialization code for ALL +archive classes you intend to use in the library. +
    • For exported types, only use BOOST_CLASS_EXPORT_KEY +in headers. +
    • For exported types, only use BOOST_CLASS_EXPORT_IMPLEMENT +in definitions compiled in the library. For any particular type, +there should be only one file which contains +BOOST_CLASS_EXPORT_IMPLEMENT +for that type. This ensures that only one copy +of serialization code will exist within the program. It avoids +wasted space and the possibility of having different +versions of the serialization code in the same program. +Including +BOOST_CLASS_EXPORT_IMPLEMENT +in multiple files could result in a failure +to link due to duplicated symbols or the throwing +of a runtime exception. +
    • Code for serialization should be only in the library, +
    • Familiarize yourself with the PIMPL idiom. +
    +This is illustrated by + +demo_pimpl.cpp +, + +demo_pimpl_A.cpp + +and + +demo_pimpl_A.hpp + +where implementation of serializaton is in a static library +completely separate from the main program. + +

    DLLS - Serialization and Runtime Linking

    +Serialization code can be placed in libraries to be linked at runtime. That is, +code can be placed in DLLS(Windows) Shared Libraries(*nix), or static libraries +as well as the main executable. The best technique is the +same as that described above for libraries. The serialization +library test suite includes the following programs +to illustrate how this works: +

    + + +test_dll_simple +, +and + +dll_a.cpp + +where implementation of serializaton is also completely separate +from the main program but the code is loaded at runtime. In this +example, this code is loaded automatically when the program which +uses it starts up, but it could just as well be loaded and unloaded +with an OS dependent API call. +

    +Also included are + +test_dll_exported.cpp +, +and + +polymorphic_derived2.cpp + +which are similar to the above but include tests of the export +and no_rtti facilities in the context of DLLS. +

    +For best results, write your code to conform to the following +guidelines: +

      +
    • Don't include inline code in classes used in DLLS. +This will generate duplicate code in the DLLS and mainline. This +needlessly duplicates code. Worse, it makes is possible for +different versions of the same code exist simultaneously. This +type of error turns out to be excruciatingly difficult to debug. +Finally, it opens the possibility that module being referred to +might be explictly unloaded which would (hopefully) result in +a runtime error. This is another bug that is not always +reproducible or easy to find. For class member templates use something like + +
      
      +template<class Archive>
      +void serialize(Archive & ar, const unsigned int version);
      +
      +in the header, and + +
      
      +template<class Archive>
      +void myclass::serialize(Archive & ar, const unsigned int version){
      +	...
      +}
      +
      +BOOST_EXPORT_CLASS_IMPLEMENT(my_class)
      +
      +#include <boost/archive/text_oarchive>
      +#include <boost/archive/text_iarchive<
      +template myclass::serialize(boost::archive::text_oarchive & ar, const unsigned int version);
      +template myclass::serialize(boost::archive::text_iarchive & ar, const unsigned int version);
      +... // repeat for each archive class to be used.
      +
      +in the implementation file. This will result in generation of all code +required in only one place. The library does not detect this type of error for you. +
    • If DLLS are to be loaded an unloaded explicitly (e.g. using dlopen in *nix or +LoadLibrary in Windows). Try to arrange that they are unloaded in the reverse +sequence. This should guarentee that problems are avoided even if the +above guidline hasn't been followed. + +
    + +

    Plugins

    +In order to implement the library, various facilities for runtime +manipulation of types are runtime were required. These +are extended_type_info +for associating classes with external identifying strings (GUID) +and void_cast +for casting between pointers of related types. + +To complete the functionality of +extended_type_info +the ability to construct and destroy corresponding types has been +added. In order to use this functionality, one must specify +how each type is created. This should be done at the time +a class is exported. So, a more complete example of the code above would be: + +
    
    +#include <boost/archive/text_oarchive.hpp>
    +#include <boost/archive/text_oarchive.hpp>
    +... // other archives
    +
    +#include "a.hpp" // header declaration for class a
    +
    +// this class has a default constructor
    +BOOST_SERIALIZATION_FACTORY_0(a)
    +// as well as one that takes one integer argument
    +BOOST_SERIALIZATION_FACTORY_1(a, int)
    +
    +// specify the GUID for this class
    +BOOST_CLASS_EXPORT(a)
    +... // other class headers and exports
    +
    + +With this in place, one can construct, serialize and destroy +about which only is know the GUID and a base class. + + +

    Multi-Threading

    +The fundamental purpose of serialization would conflict with multiple +thread concurrently writing/reading from/to a single open archive instance. +The library implementation presumes that the application avoids such an situtation. +

    +However, Writing/Reading different archives simultaneously +in different tasks is permitted as each archive instance is (almost) +completely independent from any other archive instance. The only shared +information are some type tables which have been implemented using a +lock-free thread-safe + +singleton + +described elsewhere in this documentation. +

    +This singleton implementation guarentees that all of this shared +information is initialized when the code module which contains +them is loaded. The serialization library takes care to +ensure that these data structures are not subsequently +modified. The only time there could be a problem would +be if code is loaded/unloaded while another task is +serializing data. This could only occur for types whose +serialization is implemented in a dynamically loaded/unload DLL +or shared library. So if the following is avoided: +

      +
    • Accessing the same archive instance from different tasks. +
    • Loading/Unloading DLLS or shared libraries while any archive + instances are open. +
    +The library should be thread safe. + +

    Optimizations

    +In performance critical applications that serialize large sets of contiguous data of homogeneous +types one wants to avoid the overhead of serializing each element individually, which is +the motivation for the array +wrapper. + +Serialization functions for data types containing contiguous arrays of homogeneous +types, such as for std::vector, std::valarray or +boost::multiarray should serialize them using an +array wrapper to make use of +these optimizations. + +Archive types that can provide optimized serialization for contiguous arrays of +homogeneous types should implement these by overloading the serialization of +the array wrapper, as is done +for the binary archives. + + +

    Archive Exceptions

    +

    Exception Safety

    + +
    +

    © Copyright Robert Ramey 2002-2004. +Distributed under 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) +

    + + diff --git a/deal.II/contrib/boost/libs/serialization/doc/state_saver.html b/deal.II/contrib/boost/libs/serialization/doc/state_saver.html new file mode 100644 index 0000000000..1fc1bd507b --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/doc/state_saver.html @@ -0,0 +1,82 @@ + + + + + + + +Serialization - <code style="white-space: normal">state_saver</code> + + + + + + + +
    +

    C++ Boost

    +
    +

    Serialization

    +

    state_saver +

    +
    +

    +Sometimes a certain value has to change only for a limited scope. +This class wrapper saves a copy of the current state of some object, +and resets the object's state at destruction time, undoing any change the object +may have gone through. Here is the interface: + +

    
    +template
    +// T requirements:
    +//  - POD or object semantic (cannot be reference, function, ...)
    +//  - copy constructor
    +//  - operator = (no-throw one preferred)
    +class state_saver : private boost::noncopyable
    +{
    +private:
    +    ... // implementation
    +
    +public:
    +    state_saver(T & object);
    +    ~state_saver();
    +};
    +
    + +The complete implementation can be found +here + +The following illustrates how this is expected to be used. + +
    
    +#include <boost/state_saver.hpp>
    +
    +void func(A & a)
    +    boost::state_saver<A> s(a);
    +    ... // alter state of a by calling non-const functions
    +    ... // call other functions
    +    // original state of a automatically restored on exit
    +}
    +
    + +

    History

    +This is a generalization of Daryle Walker's +io_state_saver library. +

    +Robert Ramey made an initial version for the serialization library. +

    +Pavel Vozenilek made several non-obvious refinements to make it more +secure and boost friendly + +


    +

    © Copyright Robert Ramey 2002-2004. +Distributed under 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) +

    + + diff --git a/deal.II/contrib/boost/libs/serialization/doc/static_warning.html b/deal.II/contrib/boost/libs/serialization/doc/static_warning.html new file mode 100644 index 0000000000..050f1542fc --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/doc/static_warning.html @@ -0,0 +1,53 @@ + + + + + + + +Serialization - BOOST_STATIC_WARNING + + + + + + + +
    +

    C++ Boost

    +
    +

    Serialization

    +

    BOOST_STATIC_WARNING

    +
    +
    + +The header <boost/serialization/static_warning.hpp> supplies a single macro +BOOST_STATIC_WARNING(x), which generates a compile time warning message if +the integral-constant-expression x is not true. +

    +Note that if the condition is true, then the macro will generate neither +code nor data - and the macro can also be used at either namespace, +class or function scope. When used in a template, the expression x +will be evaluated at the time the template is instantiated; this is +particularly useful for validating template parameters. +

    +It is intended that the functioning of BOOST_STATIC_WARNING(x) +be identical to that of BOOST_STATIC_ASSERT(x) +except that rather than resulting in a compilation error, it will result in +a compiler warning. In all other respects it should be the same. So +for more information on using BOOST_STATIC_WARNING(x) +consult the documentation for BOOST_STATIC_ASSERT(x) +here. + +


    +

    © Copyright Robert Ramey 2002-2004. +Distributed under 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) +

    + + diff --git a/deal.II/contrib/boost/libs/serialization/doc/strong_typedef.html b/deal.II/contrib/boost/libs/serialization/doc/strong_typedef.html new file mode 100644 index 0000000000..bc8f25d806 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/doc/strong_typedef.html @@ -0,0 +1,91 @@ + + + + + + + +Serialization - BOOST_STATIC_WARNING + + + + + + + +
    +

    C++ Boost

    +
    +

    Serialization

    +

    BOOST_STRONG_TYPEDEF

    +
    +
    +

    Motivation

    +typedef creates an alias for an existing type. It does not create +a new type that can be used for matching either function or template parameters. +This can be shown by trying to compile the following example. +
    
    +typedef int a;
    +void f(int x);  // (1) function to handle simple integers
    +void f(a x);    // (2) special function to handle integers of type a 
    +int main(){
    +    int x = 1;
    +    a y;
    +    y = x;      // other operations permitted as a is converted as necessary
    +    f(x);       // chooses (1)
    +    f(y);       // chooses (2)
    +}
    +
    +Since typedef doesn't create a new type, this program can't compile to code +that implements its obvious intention. +

    +Usage of BOOST_STRONG_TYPEDEF +addresses this. +

    
    +
    +#include <boost/serialization/strong_typedef.hpp>
    +
    +
    +BOOST_STRONG_TYPEDEF(int, a)
    +void f(int x);  // (1) function to handle simple integers
    +void f(a x);    // (2) special function to handle integers of type a 
    +int main(){
    +    int x = 1;
    +    a y;
    +    y = x;      // other operations permitted as a is converted as necessary
    +    f(x);       // chooses (1)
    +    f(y);       // chooses (2)
    +}
    +
    +The program will now compile and run as expected. + +

    Usage

    +Syntax of BOOST_STRONG_TYPEDEF +has been designed to be similar to the standard +typedef. So + +
    
    +BOOST_STRONG_TYPEDEF(primitive type, name)
    +
    + +will create a new type "name" which will be substitutable for the original +type but still of distinct type. + +

    Implemenation

    +BOOST_STRONG_TYPEDEF is a macro +which generates a class named "name" wraps and instance of its +primitive type and provides appropriate conversion operators in order +to make the new type substitutable for the one that it wraps. + +
    +

    © Copyright Robert Ramey 2002-2004. +Distributed under 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) +

    + + diff --git a/deal.II/contrib/boost/libs/serialization/doc/style.css b/deal.II/contrib/boost/libs/serialization/doc/style.css new file mode 100644 index 0000000000..de95898abd --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/doc/style.css @@ -0,0 +1,15 @@ +pre{ + BORDER-RIGHT: gray 1pt solid; + BORDER-TOP: gray 1pt solid; + BORDER-LEFT: gray 1pt solid; + BORDER-BOTTOM: gray 1pt solid; + MARGIN-LEFT: 0pt; + background-color: #EEEEEE; +} + +/* +(C) Copyright 2008 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) +*/ \ No newline at end of file diff --git a/deal.II/contrib/boost/libs/serialization/doc/todo.html b/deal.II/contrib/boost/libs/serialization/doc/todo.html new file mode 100644 index 0000000000..873feb45d0 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/doc/todo.html @@ -0,0 +1,113 @@ + + + + + + + +Serialization - To Do + + + + + + + +
    +

    C++ Boost

    +
    +

    Serialization

    +

    To Do

    +
    +
    +
    +
    Portable Binary Archives
    +
    Performance Testing and Profiling
    +
    Back Versioning
    +
    Testing for Environments with No RTTI
    +
    Additional Case Studies
    +
    + +These are enhancements that the serialization library needs but have not been done. +Some of these projects, though tricky, are not huge and would be suitable +for someone who has a limited time to spend on them. In particular, they +might be of interest as student projects such as the Google Summer of Code. + +

    Portable Binary Archives

    +Currently there is a portable binary archive in the examples directory. +It is not regularly submitted to the exhaustive boost testing regimen +but it is tested occasionally and has been used in production code. +

    +Its missing the following: +

      +
    • Addition of portable floating point types. This is not trivial. In addition to + handling floating point types of varying sizes, It requires + handling invalid floating point numbers (NaNs) in a portable manner. +
    • Some way to test archive portability within the Boost testing regimen. +
    • Integration into the Boost testing similar to the other archive classes. +
    + +

    Performance Testing and Profiling

    + +I've managed to setup performance profiling using the following: +
      +
    • current (as I write this) Boost.Build tools. +
    • the gcc compiler. +
    • and a shell script - profile.sh +
    • library_status program from the tools/regression/src directory +
    +Invoking profile script produces a +table +which shows the results of each test and links to the actual +profile. +

    +The first thing I did was include some of the serialization library tests. +It became immediatly apparent that these tests were totally unsuitable +for performance testing and that new tests needed to be written for this +purpose. These tests would highlight the location of any performance +bottlenecks in the serialization library. Whenever I've subjected my +code in the past to this type of analysis, I've always been suprised +to find bottlenecks in totally unanticipated places and fixing those +has always lead to large improvements in performance. I expect that +this project would have a huge impact on the utility of the serialization +library. + +

    Back Versioning

    + +It has been suggested that a useful feature of the library would be +the ability to create "older versions" of archives. Currently, +the library permits one make programs that are guarenteed +the ability to load archives with classes of a previous version. +But there is not way to save classes in accordance with a +previous version. At first I dismissed this a a huge project +with small demand. A cursory examination of the code revealed +that this would not be very difficult. It would require some +small changes in code and some additional tests. Also it +would require special treatment in the documentation - perhaps +a case study. + + +

    Environments without RTTI

    + +I note that some have commented that this library requires RTTI. +This is not strictly true. The examples and almost all the +tests presume the existence of RTTI. But it should be possible +to use the library without it. The example used for testing is an +extended_typeinfo +implemenation which presumes that all classes names have been exported. +So, to make this library compatible for platforms without RTTI, +a set of tests, examples and new manual section would have to be created + +
    +

    Revised 1 November, 2008 +

    © Copyright Robert Ramey 2002-2008. +Distributed under 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) +

    + + diff --git a/deal.II/contrib/boost/libs/serialization/doc/traits.html b/deal.II/contrib/boost/libs/serialization/doc/traits.html new file mode 100644 index 0000000000..64d6c53e2c --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/doc/traits.html @@ -0,0 +1,807 @@ + + + + + + + +Serialization - Class Serialization Traits + + + + + + + +
    +

    C++ Boost

    +
    +

    Serialization

    +

    Class Serialization Traits

    +
    +
    +
    +
    Version +
    Implementation Level +
    Object Tracking +
    Export Key +
    Abstract +
    Type Information Implementation +
    Wrappers +
    Bitwise Serialization +
    Template Serialization Traits +
    Compile Time Warnings and Errors +
    +Serialization of data depends on the type of the data. For example, for +primitive types such as an int, it wouldn't make sense to save +a version number in the archive. Likewise, for a data type that is never +serialized through a pointer, it would (almost) never make sense to track +the address of objects saved to/loaded from the archive as it will never +be saved/loaded more than once in any case. Details of +serialization for a particular data type will vary depending on the +type, the way it is used and specifications of the programmer. +

    +One can alter the manner in which a particular data type is serialized +by specifying one or more class serialization traits. +It is not generally necessary for the programmer to explictly assign +traits to his classes as there are default values for all traits. +If the default values are not appropriate they can be assigned by the programmer. +A template is used to associate a typename with a constant. For example +see +version.hpp. +

    Version

    +This header file includes the following code: + +
    
    +namespace boost { 
    +namespace serialization {
    +template<class T>
    +struct version
    +{
    +    BOOST_STATIC_CONSTANT(unsigned int, value = 0);
    +};
    +} // namespace serialization
    +} // namespace boost
    +
    + +For any class T, The default definition +of boost::serialization::version<T>::value is 0. +If we want to assign a value of 2 as the version for class my_class +we specialize the version template: +
    
    +namespace boost { 
    +namespace serialization {
    +struct version<my_class>
    +{
    +    BOOST_STATIC_CONSTANT(unsigned int, value = 2);
    +};
    +} // namespace serialization
    +} // namespace boost
    +
    +Now whenever the version number for class my_class is required, +the value 2 will be returned rather than the default value of 0. +

    +To diminish typing and enhance readability, a macro is defined +so that instead of the above, we could write: +

    
    +BOOST_CLASS_VERSION(my_class, 2)
    +
    +which expands to the code above. + +

    Implementation Level

    +In the same manner as the above, the "level" of implementation of serialization is +specified. The header file level.hpp defines the following. +
    
    +// names for each level
    +enum level_type
    +{
    +    // Don't serialize this type. An attempt to do so should
    +    // invoke a compile time assertion.
    +    not_serializable = 0,
    +    // write/read this type directly to the archive. In this case
    +    // serialization code won't be called.  This is the default
    +    // case for fundamental types.  It presumes a member function or
    +    // template in the archive class that can handle this type.
    +    // there is no runtime overhead associated reading/writing
    +    // instances of this level
    +    primitive_type = 1,
    +    // Serialize the objects of this type using the objects "serialize"
    +    // function or template. This permits values to be written/read
    +    // to/from archives but includes no class or version information. 
    +    object_serializable = 2,
    +    ///////////////////////////////////////////////////////////////////
    +    // once an object is serialized at one of the above levels, the
    +    // corresponding archives cannot be read if the implementation level
    +    // for the archive object is changed.  
    +    ///////////////////////////////////////////////////////////////////
    +    // Add class information to the archive.  Class information includes
    +    // implementation level, class version and class name if available.
    +    object_class_info = 3,
    +};
    +
    +Using a macro defined in level.hpp we can specify +that my_class should be serialized along with its version number: +
    
    +BOOST_CLASS_IMPLEMENTATION(my_class, boost::serialization::object_class_info)
    +
    +If implementation level is not explicitly assigned, the system uses +a default according to the following rules. +
      +
    • if the data type is volatile +assign not_serializable +
    • else if it's an enum or fundamental type assign primitive_type +
    • else assign object_class_info +
    +That is, for most user defined types, objects will be serialized along with +class version information. This will permit one to maintain backward +compatibility with archives which contain previous versions. However, with this +ability comes a small runtime cost. For types whose definition will "never" +change, efficiency can be gained by specifying object_serializable +to override the default setting of object_class_info. +For example, +this has been done for the + +binary_object wrapper + +

    Object Tracking

    +Depending on the way a type is used, it may be necessary or convenient to +track the address of objects saved and loaded. For example, this is generally +necessary while serializing objects through a pointer in order to be sure +that multiple identical objects are not created when an archive is loaded. +This "tracking behavior" is controlled by the type trait defined in the header +file tracking.hpp +which defines the following: +
    
    +// names for each tracking level
    +enum tracking_type
    +{
    +    // never track this type
    +    track_never = 0,
    +    // track objects of this type if the object is serialized through a 
    +    // pointer.
    +    track_selectively = 1,
    +    // always track this type
    +    track_always = 2
    +};
    +
    +A corresponding macro is defined so that we can use: +
    
    +BOOST_CLASS_TRACKING(my_class, boost::serialization::track_never)
    +
    +Default tracking traits are: +
      +
    • For primitive, track_never. +
    • For pointers, track_never. + That is, addresses of addresses are not tracked by default. +
    • All current serialization wrappers such as boost::serialization::nvp, + track_never. +
    • For all other types, track_selectively. + That is addresses of serialized objects are tracked if and only if + one or more of the following is true: +
        +
      • an object of this type is anywhere in the program serialized + through a pointer. +
      • the class is explicitly "exported" - see below. +
      • the class is explicitly "registered" in the archive +
      +
    + +

    +The default behavior is almost always the most convenient one. However, +there a few cases where it would be desirable to override the +default. One case is that of a virtual base class. In a diamond +heritance structure with a virtual base class, object tracking +will prevent redundant save/load invocations. So here is one +case where it might be convenient to override the default tracking +trait. (Note: in a future version the default will be reimplemented +to automatically track classes used as virtual bases). This +situation is demonstrated by +test_diamond.cpp +included with the library. + +

    Export Key

    + +When serializing a derived class through a virtual base class pointer, +two issues may arise. +
      +
    • The code in the derived class might never be explicitly +referred to. Such code will never be instantiated. +

      +This is addressed by invoking +BOOST_CLASS_EXPORT_IMPLEMENT(T) +in the file which defines (implements) the class T. +This ensures that code for the derived class T will +be explicity instantiated. +

    • There needs to be some sort of identifier which can +be used to select the code to be invoked when the object +is loaded. +Standard C++ does implement typeid() which can be +used to return a unique string for the class. This is not entirely +statisfactory for our purposes for the following reasons: +
        +
      • There is no guarantee that the string is the same across platforms. + This would then fail to support portable archives. +
      • In using code modules from various sources, classes may have + to be wrapped in different namespaces in different programs. +
      • There might be classes locally defined in different code modules + that have the same name. +
      • There might be classes with different names that we want to + consider equivalent for purposes of of serialization. +
      +

      +So in the serialization library, this is addressed by invoking +BOOST_CLASS_EXPORT_KEY2(my_class, "my_class_external_identifier") +in the header file which declares he class. +In a large majority of applications, the class name works just fine +for the external identifier string so the following short cut is +defined - +BOOST_CLASS_EXPORT_KEY(my_class). +

    +For programs which consist of only one module - that is +programs which do not use DLLS, one can specify +BOOST_CLASS_EXPORT(my_class) +or +BOOST_CLASS_EXPORT_GUID(my_class, "my_class_external_identifier") +in either he declaration header or definition. These macros +expand to invocation of the of both of the macros described above. +(GUID stands for Globally Unique IDentfier.) +

    +(Elsewhere +in this manual, the serialization of derived classes is addressed in detail.) +

    +The header file +export.hpp +contains all macro definitions described here. +The library will throw a runtime exception if +

      +
    • A type not explicitly referred to is not exported. +
    • Serialization code for the same type is instantiated +in more than one module (or DLL). +
    + +

    Abstract

    +When serializing an object through a pointer to its base class, +the library needs to determine whether or not the bas is abstract +(i.e. has at least one virtual function). The library uses the +type trait macro BOOST_IS_ABSTRACT(T) +to do this. Not all compilers support this type trait and corresponding +macro. To address this, the macro +BOOST_SERIALIZATION_ASSUME_ABSTRACT(T) has been +implemented to permit one to explicitly indicate that a specified +type is in fact abstract. This will guarentee that +BOOST_IS_ABSTRACT +will return the correct value for all compilers. + +

    Type Information Implementation

    +This last trait is also related to the serialization of objects +through a base class pointer. The implementation of this facility +requires the ability to determine at run time the true type of the +object that a base class pointer points to. Different serialization +systems do this in different ways. In our system, the default method +is to use the function typeid(...) which is available +in systems which support RTTI (Run Time +Type Information). +This will be satisfactory in almost all cases and most users of this +library will lose nothing in skipping this section of the manual. +

    +However, there are some cases where the default type determination +system is not convenient. Some platforms might not support +RTTI or it may have been disabled in order to speed execution +or for some other reason. Some applications, E.G. runtime linking +of plug-in modules, can't depend on C++ RTTI to determine the +true derived class. RTTI only returns the correct type for polymorphic +classes - classes with at least one virtual function. If any of these +situations applies, one may substitute his own implementation of +extended_type_info +

    +The interface to facilities required to implement serialization is defined in +extended_type_info.hpp. + +Default implementation of these facilities based on typeid(...) +is defined in + +extended_type_info_typeid.hpp. + +An alternative implementation based on exported class identifiers +is defined in +extended_type_info_no_rtti.hpp. +

    +By invoking the macro: +

    
    +BOOST_CLASS_TYPE_INFO(
    +    my_class, 
    +    extended_type_info_no_rtti<my_class>
    +)
    +
    +we can assign the type information implementation to each class on a case by +case basis. There is no requirement that all classes in a program use the same +implementation of extended_type_info. This supports the concept +that serialization of each class is specified "once and for all" in a header +file that can be included in any project without change. +

    +This is illustrated by the test program +test_no_rtti.cpp. +Other implementations are possible and might be necessary for +certain special cases. + +version.hpp. +

    Wrappers

    +Archives need to treat wrappers diffently from other types since, for example, +they usually are non-const object while output archives require that any +serialized object (with the exception of a wrapper) be const. + +This header file wrapper.hpp +includes the following code: + +
    
    +namespace boost { 
    +namespace serialization {
    +template<class T>
    +struct is_wrapper
    + : public mpl::false_
    +{};
    +} // namespace serialization
    +} // namespace boost
    +
    + +For any class T, The default definition +of boost::serialization::is_wrapper<T>::value is thus false. + +If we want to declare that a class my_class +is a wrapper we specialize the version template: +
    
    +namespace boost { 
    +namespace serialization {
    +struct is_wrapper<my_class>
    + : mpl::true_
    +{};
    +} // namespace serialization
    +} // namespace boost
    +
    +

    +To diminish typing and enhance readability, a macro is defined +so that instead of the above, we could write: +

    
    +BOOST_CLASS_IS_WRAPPER(my_class)
    +
    +which expands to the code above. + +

    Bitwise Serialization

    +Some simple classes could be serialized just by directly copying all bits +of the class. This is, in particular, the case for POD data types containing +no pointer members, and which are neither versioned nor tracked. Some archives, +such as non-portable binary archives can make us of this information to +substantially speed up serialization. + +To indicate the possibility of bitwise serialization the type trait defined +in the header +file is_bitwise_serializable.hpp +is used: +
    
    +namespace boost { namespace serialization {
    +    template
    +    struct is_bitwise_serializable
    +     : public is_arithmetic
    +    {};
    +} }
    +
    +is used, and can be specialized for other classes. The specialization +is made easy by the corresponding macro: +
    
    +BOOST_IS_BITWISE_SERIALIZABLE(my_class)
    +
    + +

    Template Serialization Traits

    +In some instances it might be convenient to assign serialization traits +to a whole group of classes at once. Consider, the name-value pair +wrapper +
    
    +template<class T>
    +struct nvp : public std::pair<const char *, T *>
    +{
    +    ...
    +};
    +
    +used by XML archives to associate a name with a data variable of type T. +These data types are never tracked and never versioned. So one might +want to specify: +
    
    +BOOST_CLASS_IMPLEMENTATION(nvp<T>, boost::serialization::level_type::object_serializable)
    +BOOST_CLASS_TRACKING(nvp<T>, boost::serialization::track_never)
    +
    +Examination of the definition of these macros reveals that they won't expand +to sensible code when used with a template argument. So rather than using the +convenience macros, use the original definitions +
    
    +template<class T>
    +struct implementation_level<nvp<T> >
    +{
    +    typedef mpl::integral_c_tag tag;
    +    typedef mpl::int_<object_serializable> type;
    +    BOOST_STATIC_CONSTANT(
    +        int,
    +        value = implementation_level::type::value
    +    );
    +};
    +
    +// nvp objects are generally created on the stack and are never tracked
    +template<class T>
    +struct tracking_level<nvp<T> >
    +{
    +    typedef mpl::integral_c_tag tag;
    +    typedef mpl::int_<track_never> type;
    +    BOOST_STATIC_CONSTANT(
    +        int, 
    +        value = tracking_level::type::value
    +    );
    +};
    +
    +to assign serialization traits to all classes generated by the template +nvp<T> +

    + +Note that it is only possible to use the above method to assign traits to +templates when using compilers which correctly support Partial Template Specialization. + +One's first impulse might be to do something like: + +

    
    +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
    +template<class T>
    +struct implementation_level<nvp<T> >
    +{
    +   ... // see above
    +};
    +
    +// nvp objects are generally created on the stack and are never tracked
    +template<class T>
    +struct tracking_level<nvp<T> >
    +{
    +   ... // see above
    +};
    +#endif
    +
    +This can be problematic when one wants to make his code and archives +portable to other platforms. It means the she objects will be serialized differently +depending on the platform used. This implies that objects saved from one platform +won't be loaded properly on another. In other words, archives won't be portable. +

    +This problem is addressed by creating another method of assigning serialization traits +to user classes. This is illustrated by the serialization for a +name-value pair. +

    +Specifically, this entails deriving the template from a special class + +boost::serialization::traits which is specialized for a specific +combination of serialization traits. +When looking up the serialization traits, the library first checks to see if this class has been +used as a base class. If so, the corresponding traits are used. Otherwise, the standard defaults +are used. By deriving from a serialization traits class rather than relying upon Partial Template +Specializaton, one can a apply serialization traits to a template and those traits will be +the same across all known platforms. +

    +The signature for the traits template is: +

    
    +template<
    +    class T,       
    +    int Level, 
    +    int Tracking,
    +    unsigned int Version = 0,
    +    class ETII = BOOST_SERIALIZATION_DEFAULT_TYPE_INFO(T),
    +    class IsWrapper = mpl::false_
    +>
    +struct traits
    +
    +and template parameters should be assigned according to the following table: +

    + + + + + + + + +
    parameterdescriptionpermitted valuesdefault value
    Ttarget classclass namenone
    Levelimplementation levelnot_serializable
    primitive_type
    object_serializable
    object_class_info
    none
    Trackingtracking leveltrack_never
    track_selectivly
    track_always
    none
    Versionclass versionunsigned integer0
    ETTItype_info implementationextended_type_info_typeid
    extended_type_info_no_rtti
    default type_info implementation
    IsWrapperis the type a wrapper?mpl::false_
    mpl::true_
    mpl::false_
    + +

    Compile Time Warnings and Errors

    +Some serialization traits can conflict with other ones. Sometimes these conflicts +will result in erroneous behavior (E.G. creating of archives which could not be read) +and other times they represent a probable misconception on the part of the +library user which could result in suprising behavior. The extent possible, +these conflicts are detected at compile time and errors (BOOST_STATIC_ASSERT) +or warnings (BOOST_STATIC_WARNING) are generated. The are generated in a +compiler dependent way manner which should show an chain of instantiation +to the point where the error/warning is detected. Without this capability, +it would be very hard to track down errors or unexpected behavior in library +usage. Here is list of the conflicts trapped: + +
    +

    object_level - error

    +
    +This error traps attempts to serialize types whose +implentation level is set to non_serializable. +
    +

    object_versioning - error

    +
    +It's possible that for efficiency reasons, a type can be +assigned a serialization level which doesn't include type information +in the archive. This would preclude the assignment +of a new version number to the type. This error +traps attempts to assign a version number in this case. +This has to be a user error. +
    + +

    object_tracking - warning

    +
    +The following code will display a message when compiled: + +
    +T t;
    +ar << t;
    +
    + +unless the tracking_level serialization trait is set to "track_never". The following +will compile without problem: + +
    +const T t
    +ar << t;
    +
    + +Likewise, the following code will trap at compile time: + +
    +T * t;
    +ar >> t;
    +
    + +if the tracking_level serialization trait is set to "track_never". +

    + +The following case illustrates the function of this message. +It was originally used as an example in the +mailing list by Peter Dimov. + +

    +class construct_from 
    +{ 
    +    ... 
    +}; 
    +
    +void main(){ 
    +    ... 
    +    Y y; 
    +    construct_from x(y); 
    +    ar << x; 
    +} 
    +
    + +Suppose that the above message is not displayed and the code is used as is. +
      +
    1. this example compiles and executes fine. No tracking is done because + construct_from has never been serialized through a pointer. Now some time + later, the next programmer(2) comes along and makes an enhancement. He + wants the archive to be sort of a log. + +
      +void main(){ 
      +    ... 
      +    Y y; 
      +    construct_from x(y); 
      +    ar << x; 
      +    ... 
      +    x.f(); // change x in some way 
      +   ... 
      +    ar << x 
      +} 
      +
      +

      + Again no problem. He gets two different of copies in the archive, each one is different. + That is he gets exactly what he expects and is naturally delighted. +

      +

    2. Now sometime later, a third programmer(3) sees construct_from and says - + oh cool, just what I need. He writes a function in a totally disjoint + module. (The project is so big, he doesn't even realize the existence of + the original usage) and writes something like: + +
      +class K { 
      +    shared_ptr <construct_from> z; 
      +    template <class Archive> 
      +    void serialize(Archive & ar, const unsigned version){ 
      +        ar << z; 
      +    } 
      +}; 
      +
      + +

      + He builds and runs the program and tests his new functionality. It works + great and he's delighted. +

      +

    3. Things continue smoothly as before. A month goes by and it's + discovered that when loading the archives made in the last month (reading the + log). Things don't work. The second log entry is always the same as the + first. After a series of very long and increasingly acrimonius email exchanges, +its discovered + that programmer (3) accidently broke programmer(2)'s code .This is because by + serializing via a pointer, the "log" object now being tracked. This is because + the default tracking behavior is "track_selectively". This means that class + instances are tracked only if they are serialized through pointers anywhere in + the program. Now multiple saves from the same address result in only the first one + being written to the archive. Subsequent saves only add the address - even though the + data might have been changed. When it comes time to load the data, all instances of the log record show the same data. + In this way, the behavior of a functioning piece of code is changed due the side + effect of a change in an otherwise disjoint module. + Worse yet, the data has been lost and cannot not be now recovered from the archives. + People are really upset and disappointed with boost (at least the serialization system). +

      +

    4. + After a lot of investigation, it's discovered what the source of the problem + and class construct_from is marked "track_never" by including: +
      +BOOST_CLASS_TRACKING(construct_from, track_never) 
      +
      +
    5. Now everything works again. Or - so it seems. +

      +

    6. shared_ptr<construct_from> +is not going to have a single raw pointer shared amongst the instances. Each loaded +shared_ptr<construct_from> is going to +have its own distinct raw pointer. This will break +shared_ptr and cause a memory leak. Again, +The cause of this problem is very far removed from the point of discovery. It could +well be that the problem is not even discovered until after the archives are loaded. +Now we not only have difficult to find and fix program bug, but we have a bunch of +invalid archives and lost data. +
    + +

    Now consider what happens when the message is displayed: + +

      +

      +

    1. Right away, the program traps at +
      +ar << x; 
      +
      +

      +

    2. The programmer curses (another %^&*&* hoop to jump through). If he's in a + hurry (and who isn't) and would prefer not to const_cast + - because it looks bad. So he'll just make the following change an move on. +
      +Y y; 
      +const construct_from x(y); 
      +ar << x; 
      +
      +

      + Things work fine and he moves on. +

      +

    3. Now programer (2) wants to make his change - and again another + annoying const issue; +
      +Y y; 
      +const construct_from x(y); 
      +... 
      +x.f(); // change x in some way ; compile error f() is not const 
      +... 
      +ar << x 
      +
      +

      + He's mildly annoyed now he tries the following: +

        +
      • He considers making f() a const - but presumable that shifts the const + error to somewhere else. And his doesn't want to fiddle with "his" code to + work around a quirk in the serializaition system +

        +

      • He removes the const + from const construct_from above - damn now he + gets the trap. If he looks at the comment code where the + BOOST_STATIC_ASSERT + occurs, he'll do one of two things +
          +

          +

        1. This is just crazy. Its making my life needlessly difficult and flagging + code that is just fine. So I'll fix this with a const_cast + and fire off a complaint to the list and mabe they will fix it. + In this case, the story branches off to the previous scenario. +

          +

        2. Oh, this trap is suggesting that the default serialization isn't really + what I want. Of course in this particular program it doesn't matter. But + then the code in the trap can't really evaluate code in other modules (which + might not even be written yet). OK, I'll add the following to my + construct_from.hpp to solve the problem. +
          +BOOST_CLASS_TRACKING(construct_from, track_never) 
          +
          +
        +
      +

      +

    4. Now programmer (3) comes along and make his change. The behavior of the + original (and distant module) remains unchanged because the + construct_from trait has been set to + "track_never" so he should always get copies and the log should be what we expect. +

      +

    5. But now he gets another trap - trying to save an object of a + class marked "track_never" through a pointer. So he goes back to + construct_from.hpp and comments out the + BOOST_CLASS_TRACKING that + was inserted. Now the second trap is avoided, But damn - the first trap is + popping up again. Eventually, after some code restructuring, the differing + requirements of serializating construct_from + are reconciled. +
    +Note that in this second scenario +
      +
    • all errors are trapped at compile time. +
    • no invalid archives are created. +
    • no data is lost. +
    • no runtime errors occur. +
    + +It's true that these messages may sometimes flag code that is currently correct and +that this may be annoying to some programmers. However, this example illustrates +my view that these messages are useful and that any such annoyance is small price to +pay to avoid particularly vexing programming errors. + +
    + +

    pointer_level - warning

    +
    +This trap addresses the following situaion when serializing +a pointer: +
      +
    • A type doesn't save class information in the +archive. That is, the serialization trait implementation +level <= object_serializable. +
    • Tracking for this type is set to "track selectively" +in this case, indication that an object is tracked is +not stored in the archive itself - see level == object_serializable. +Since class information is not saved in the archive, the existence +or absense of the operation ar << T * anywhere else in the +program is used to infer that an object of this type should be tracked. +

      +A problem arises when a program which reads an archive +includes the operation ar >> T * so that tracking information +will be included in the archive. When a program which +creates the archive doesn't include ar << T it is presumed +that the archive doesn't include tracking information and +the archive will fail to load. Also the reverse situation could +trigger a similar problem. +

      +Though this situation is unlikely for several reasones, +it is possible - hence this warning. +

    +So if your program traps here, consider changing the +tracking or implementation level traits - or not +serializing via a pointer. +
    + +

    pointer_tracking - warning

    +
    +Serializing an object of a type marked "track_never" through a pointer +could result in creating more objects than were saved! There are cases +in which a user might really want to do this so we leave it as a warning. +
    + +

    const_loading - error

    +
    +One cannot load data into a "const" object unless it's a +wrapper around some other non-const object. +
    +
    + +
    +

    © Copyright Robert Ramey 2002-2004 and Matthias Troyer 2006. +Distributed under 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) +

    + + diff --git a/deal.II/contrib/boost/libs/serialization/doc/tutorial.html b/deal.II/contrib/boost/libs/serialization/doc/tutorial.html new file mode 100644 index 0000000000..8154611fea --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/doc/tutorial.html @@ -0,0 +1,584 @@ + + + + + + + +Serialization - Tutorial + + + + + + + +
    +

    C++ Boost

    +
    +

    Serialization

    +

    Tutorial

    +
    +
    +
    +
    A Very Simple Case +
    Non Intrusive Version +
    Serializable Members +
    Derived Classes +
    Pointers +
    Arrays +
    STL Collections +
    Class Versioning +
    Splitting serialize into save/load +
    Archives +
    List of examples +
    +An output archive is similar to an output data stream. Data can be saved to the archive +with either the << or the & operator: +
    
    +ar << data;
    +ar & data;
    +
    +An input archive is similar to an input datastream. Data can be loaded from the archive +with either the >> or the & operator. +
    
    +ar >> data;
    +ar & data;
    +
    +

    +When these operators are invoked for primitive data types, the data is simply saved/loaded +to/from the archive. When invoked for class data types, the class +serialize function is invoked. Each +serialize function is uses the above operators +to save/load its data members. This process will continue in a recursive manner until +all the data contained in the class is saved/loaded. + +

    A Very Simple Case

    +These operators are used inside the serialize +function to save and load class data members. +

    +Included in this library is a program called +demo.cpp which illustrates how +to use this system. Below we excerpt code from this program to +illustrate with the simplest possible case how this library is +intended to be used. +

    +
    +#include <fstream>
    +
    +// include headers that implement a archive in simple text format
    +#include <boost/archive/text_oarchive.hpp>
    +#include <boost/archive/text_iarchive.hpp>
    +
    +/////////////////////////////////////////////////////////////
    +// gps coordinate
    +//
    +// illustrates serialization for a simple type
    +//
    +class gps_position
    +{
    +private:
    +    friend class boost::serialization::access;
    +    // When the class Archive corresponds to an output archive, the
    +    // & operator is defined similar to <<.  Likewise, when the class Archive
    +    // is a type of input archive the & operator is defined similar to >>.
    +    template<class Archive>
    +    void serialize(Archive & ar, const unsigned int version)
    +    {
    +        ar & degrees;
    +        ar & minutes;
    +        ar & seconds;
    +    }
    +    int degrees;
    +    int minutes;
    +    float seconds;
    +public:
    +    gps_position(){};
    +    gps_position(int d, int m, float s) :
    +        degrees(d), minutes(m), seconds(s)
    +    {}
    +};
    +
    +int main() {
    +    // create and open a character archive for output
    +    std::ofstream ofs("filename");
    +
    +    // create class instance
    +    const gps_position g(35, 59, 24.567f);
    +
    +    // save data to archive
    +    {
    +        boost::archive::text_oarchive oa(ofs);
    +        // write class instance to archive
    +        oa << g;
    +    	// archive and stream closed when destructors are called
    +    }
    +
    +    // ... some time later restore the class instance to its orginal state
    +    gps_position newg;
    +    {
    +        // create and open an archive for input
    +        std::ifstream ifs("filename");
    +        boost::archive::text_iarchive ia(ifs);
    +        // read class state from archive
    +        ia >> newg;
    +        // archive and stream closed when destructors are called
    +    }
    +    return 0;
    +}
    +
    +
    +

    For each class to be saved via serialization, there must exist a function to +save all the class members which define the state of the class. +For each class to be loaded via serialization, there must exist a function to +load theese class members in the same sequence as they were saved. +In the above example, these functions are generated by the +template member function serialize. + +

    Non Intrusive Version

    +

    The above formulation is intrusive. That is, it requires +that classes whose instances are to be serialized be +altered. This can be inconvenient in some cases. +An equivalent alternative formulation permitted by the +system would be: +

    
    +#include <boost/archive/text_oarchive.hpp>
    +#include <boost/archive/text_iarchive.hpp>
    +
    +class gps_position
    +{
    +public:
    +    int degrees;
    +    int minutes;
    +    float seconds;
    +    gps_position(){};
    +    gps_position(int d, int m, float s) :
    +        degrees(d), minutes(m), seconds(s)
    +    {}
    +};
    +
    +namespace boost {
    +namespace serialization {
    +
    +template<class Archive>
    +void serialize(Archive & ar, gps_position & g, const unsigned int version)
    +{
    +    ar & g.degrees;
    +    ar & g.minutes;
    +    ar & g.seconds;
    +}
    +
    +} // namespace serialization
    +} // namespace boost
    +
    +

    +In this case the generated serialize functions are not members of the +gps_position class. The two formulations function +in exactly the same way. +

    +The main application of non-intrusive serialization is to permit serialization +to be implemented for classes without changing the class definition. +In order for this to be possible, the class must expose enough information +to reconstruct the class state. In this example, we presumed that the +class had public members - not a common occurence. Only +classes which expose enough information to save and restore the class +state will be serializable without changing the class definition. +

    Serializable Members

    +

    +A serializable class with serializable members would look like this: +

    
    +class bus_stop
    +{
    +    friend class boost::serialization::access;
    +    template<class Archive>
    +    void serialize(Archive & ar, const unsigned int version)
    +    {
    +        ar & latitude;
    +        ar & longitude;
    +    }
    +    gps_position latitude;
    +    gps_position longitude;
    +protected:
    +    bus_stop(const gps_position & lat_, const gps_position & long_) :
    +    latitude(lat_), longitude(long_)
    +    {}
    +public:
    +    bus_stop(){}
    +    // See item # 14 in Effective C++ by Scott Meyers.
    +    // re non-virtual destructors in base classes.
    +    virtual ~bus_stop(){}
    +};
    +
    +

    That is, members of class type are serialized just as +members of primitive types are. +

    +Note that saving an instance of the class bus_stop +with one of the archive operators will invoke the +serialize function which saves +latitude and +longitude. Each of these in turn will be saved by invoking +serialize in the definition of +gps_position. In this manner the whole +data structure is saved by the application of an archive operator to +just its root item. + + +

    Derived Classes

    +

    Derived classes should include serializations of their base classes. +

    
    +#include <boost/serialization/base_object.hpp>
    +
    +class bus_stop_corner : public bus_stop
    +{
    +    friend class boost::serialization::access;
    +    template<class Archive>
    +    void serialize(Archive & ar, const unsigned int version)
    +    {
    +        // serialize base class information
    +        ar & boost::serialization::base_object<bus_stop>(*this);
    +        ar & street1;
    +        ar & street2;
    +    }
    +    std::string street1;
    +    std::string street2;
    +    virtual std::string description() const
    +    {
    +        return street1 + " and " + street2;
    +    }
    +public:
    +    bus_stop_corner(){}
    +    bus_stop_corner(const gps_position & lat_, const gps_position & long_,
    +        const std::string & s1_, const std::string & s2_
    +    ) :
    +        bus_stop(lat_, long_), street1(s1_), street2(s2_)
    +    {}
    +};
    +
    +
    +

    +Note the serialization of the base classes from the derived +class. Do NOT directly call the base class serialize +functions. Doing so might seem to work but will bypass the code +that tracks instances written to storage to eliminate redundancies. +It will also bypass the writing of class version information into +the archive. For this reason, it is advisable to always make member +serialize functions private. The declaration +friend boost::serialization::access will grant to the +serialization library access to private member variables and functions. +

    +

    Pointers

    +Suppose we define a bus route as an array of bus stops. Given that +
      +
    1. we might have several types of bus stops (remember bus_stop is +a base class) +
    2. a given bus_stop might appear in more than one route. +
    +it's convenient to represent a bus route with an array of pointers +to bus_stop. +
    +
    +class bus_route
    +{
    +    friend class boost::serialization::access;
    +    bus_stop * stops[10];
    +    template<class Archive>
    +    void serialize(Archive & ar, const unsigned int version)
    +    {
    +        int i;
    +        for(i = 0; i < 10; ++i)
    +            ar & stops[i];
    +    }
    +public:
    +    bus_route(){}
    +};
    +
    +
    +Each member of the array stops will be serialized. +But remember each member is a pointer - so what can this really +mean? The whole object of this serialization is to permit +reconstruction of the original data structures at another place +and time. In order to accomplish this with a pointer, it is +not sufficient to save the value of the pointer, rather the +object it points to must be saved. When the member is later +loaded, a new object has to be created and a new pointer has +to be loaded into the class member. +

    +If the same pointer is serialized more than once, only one instance +is be added to the archive. When read back, no data is read back in. +The only operation that occurs is for the second pointer is set equal to the first +

    +Note that, in this example, the array consists of polymorphic pointers. +That is, each array element point to one of several possible +kinds of bus stops. So when the pointer is saved, some sort of class +identifier must be saved. When the pointer is loaded, the class +identifier must be read and and instance of the corresponding class +must be constructed. Finally the data can be loaded to newly created +instance of the correct type. + +As can be seen in +demo.cpp, +serialization of pointers to derived classes through a base +clas pointer may require explicit enumeration of the derived +classes to be serialized. This is referred to as "registration" or "export" +of derived classes. This requirement and the methods of +satisfying it are explained in detail +here +

    +All this is accomplished automatically by the serialization +library. The above code is all that is necessary to accomplish +the saving and loading of objects accessed through pointers. +

    +

    Arrays

    +The above formulation is in fact more complex than necessary. +The serialization library detects when the object being +serialized is an array and emits code equivalent to the above. +So the above can be shortened to: +
    +
    +class bus_route
    +{
    +    friend class boost::serialization::access;
    +    bus_stop * stops[10];
    +    template<class Archive>
    +    void serialize(Archive & ar, const unsigned int version)
    +    {
    +        ar & stops;
    +    }
    +public:
    +    bus_route(){}
    +};
    +
    +
    +

    STL Collections

    +The above example uses an array of members. More likely such +an application would use an STL collection for such a purpose. +The serialization library contains code for serialization +of all STL classes. Hence, the reformulation below will +also work as one would expect. +
    +
    +#include <boost/serialization/list.hpp>
    +
    +class bus_route
    +{
    +    friend class boost::serialization::access;
    +    std::list<bus_stop *> stops;
    +    template<class Archive>
    +    void serialize(Archive & ar, const unsigned int version)
    +    {
    +        ar & stops;
    +    }
    +public:
    +    bus_route(){}
    +};
    +
    +
    +

    Class Versioning

    +

    +Suppose we're satisfied with our bus_route class, build a program +that uses it and ship the product. Some time later, it's decided +that the program needs enhancement and the bus_route class is +altered to include the name of the driver of the route. So the +new version looks like: +

    +
    +#include <boost/serialization/list.hpp>
    +#include <boost/serialization/string.hpp>
    +
    +class bus_route
    +{
    +    friend class boost::serialization::access;
    +    std::list<bus_stop *> stops;
    +    std::string driver_name;
    +    template<class Archive>
    +    void serialize(Archive & ar, const unsigned int version)
    +    {
    +        ar & driver_name;
    +        ar & stops;
    +    }
    +public:
    +    bus_route(){}
    +};
    +
    +
    +Great, we're all done. Except... what about people using our application +who now have a bunch of files created under the previous program. +How can these be used with our new program version? +

    +In general, the serialization library stores a version number in the +archive for each class serialized. By default this version number is 0. +When the archive is loaded, the version number under which it was saved +is read. The above code can be altered to exploit this +

    +
    +#include <boost/serialization/list.hpp>
    +#include <boost/serialization/string.hpp>
    +#include <boost/serialization/version.hpp>
    +
    +class bus_route
    +{
    +    friend class boost::serialization::access;
    +    std::list<bus_stop *> stops;
    +    std::string driver_name;
    +    template<class Archive>
    +    void serialize(Archive & ar, const unsigned int version)
    +    {
    +        // only save/load driver_name for newer archives
    +        if(version > 0)
    +            ar & driver_name;
    +        ar & stops;
    +    }
    +public:
    +    bus_route(){}
    +};
    +
    +BOOST_CLASS_VERSION(bus_route, 1)
    +
    +
    +By application of versioning to each class, there is no need to +try to maintain a versioning of files. That is, a file version +is the combination of the versions of all its constituent classes. + +This system permits programs to be always compatible with archives +created by all previous versions of a program with no more +effort than required by this example. + +

    Splitting serialize +into save/load

    +The serialize function is simple, concise, and guarantees +that class members are saved and loaded in the same sequence +- the key to the serialization system. However, there are cases +where the load and save operations are not as similar as the examples +used here. For example, this could occur with a class that has evolved through +multiple versions. The above class can be reformulated as: +
    +
    +#include <boost/serialization/list.hpp>
    +#include <boost/serialization/string.hpp>
    +#include <boost/serialization/version.hpp>
    +#include <boost/serialization/split_member.hpp>
    +
    +class bus_route
    +{
    +    friend class boost::serialization::access;
    +    std::list<bus_stop *> stops;
    +    std::string driver_name;
    +    template<class Archive>
    +    void save(Archive & ar, const unsigned int version) const
    +    {
    +        // note, version is always the latest when saving
    +        ar  & driver_name;
    +        ar  & stops;
    +    }
    +    template<class Archive>
    +    void load(Archive & ar, const unsigned int version)
    +    {
    +        if(version > 0)
    +            ar & driver_name;
    +        ar  & stops;
    +    }
    +    BOOST_SERIALIZATION_SPLIT_MEMBER()
    +public:
    +    bus_route(){}
    +};
    +
    +BOOST_CLASS_VERSION(bus_route, 1)
    +
    +
    +The macro BOOST_SERIALIZATION_SPLIT_MEMBER() generates +code which invokes the save +or load +depending on whether the archive is used for saving or loading. +

    Archives

    +Our discussion here has focused on adding serialization +capability to classes. The actual rendering of the data to be serialized +is implemented in the archive class. Thus the stream of serialized +data is a product of the serialization of the class and the +archive selected. It is a key design decision that these two +components be independent. This permits any serialization specification +to be usable with any archive. +

    +In this tutorial, we have used a particular +archive class - text_oarchive for saving and +text_iarchive for loading. +text archives render data as text and are portable across platforms. In addition +to text archives, the library includes archive class for native binary data +and xml formatted data. Interfaces to all archive classes are all identical. +Once serialization has been defined for a class, that class can be serialized to +any type of archive. +

    +If the current set of archive classes doesn't provide the +attributes, format, or behavior needed for a particular application, +one can either make a new archive class or derive from an existing one. +This is described later in the manual. + +

    List of Examples

    +
    +
    demo.cpp +
    This is the completed example used in this tutorial. + It does the following: +
      +
    1. Creates a structure of differing kinds of stops, routes and schedules +
    2. Displays it +
    3. Serializes it to a file named "testfile.txt" with one + statement +
    4. Restores to another structure +
    5. Displays the restored structure +
    + Output of + this program is sufficient to verify that all the + originally stated requirements for a serialization system + are met with this system. The contents of the archive file can + also be displayed as serialization files are ASCII text. + +
    demo_xml.cpp +
    This is a variation the original demo which supports xml archives in addition + to the others. The extra wrapping macro, BOOST_SERIALIZATION_NVP(name), is + needed to associate a data item name with the corresponding xml + tag. It is importanted that 'name' be a valid xml tag, else it + will be impossible to restore the archive. + For more information see + Name-Value Pairs. + Here + is what an xml archive looks like. + +
    demo_xml_save.cpp + and demo_xml_load.cpp +
    Note also that though our examples save and load the program data + to an archive within the same program, this merely a convenience + for purposes of illustration. In general, the archive may or may + not be loaded by the same program that created it. +
    +

    +The astute reader might notice that these examples contain a subtle but important flaw. +They leak memory. The bus stops are created in the +main function. The bus schedules may refer to these bus stops +any number of times. At the end of the main function after the bus schedules are destroyed, +the bus stops are destroyed. This seems fine. But what about the structure +new_schedule data item created by the +process of loading from an archive? This contains its own separate set of bus stops +that are not referenced outside of the bus schedule. These won't be destroyed +anywhere in the program - a memory leak. +

    +There are couple of ways of fixing this. One way is to explicitly manage the bus stops. +However, a more robust and transparent is to use +shared_ptr rather than raw pointers. Along +with serialization implemenations for the Standard Library, the serialization library +includes implementation of serialization for +boost::shared ptr. Given this, it should be +easy to alter any of these examples to eliminate the memory leak. This is left +as an excercise for the reader. + +


    +

    © Copyright Robert Ramey 2002-2004. +Distributed under 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) +

    + + diff --git a/deal.II/contrib/boost/libs/serialization/doc/void_cast.html b/deal.II/contrib/boost/libs/serialization/doc/void_cast.html new file mode 100644 index 0000000000..51c0bae309 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/doc/void_cast.html @@ -0,0 +1,104 @@ + + + + + + + +Serialization - BOOST_STATIC_WARNING + + + + + + + +
    +

    C++ Boost

    +
    +

    Serialization

    +

    void_cast

    +
    +
    +

    Motivation

    +C++ includes the operator dynamic_cast<T>(U * u) +for casting a pointer at runtime between two related types. However, this can only be +used for polymorphic classes. That is, it can only be used with related classes which have at least one virtual function. +Limiting the serializaton of pointers to only such class would diminish the applicability +of the library. + +

    Usage

    + +The following functions are defined in the header +void_cast.hpp. +They are declared in the namespace +boost::serialization. + +
    +

    
    +template<class Derived, class Base>
    +const void_cast_detail::void_caster &
    +void_cast_register(
    +    Derived const * derived = NULL, 
    +    Base * const base = NULL
    +)
    +

    +
    +This function "registers" a pair of related types. It stores the fact that +Derived is immediately derived from +Base in a global table. +
      +
    • This "registration" can be invoked anywhere in the program. The table is built at + pre-runtime and is available anywhere else in the program. +
    • only adjacent base/derived pairs need be registered. That is, +
      
      +  void_cast_register<A, B>();
      +  void_cast_register<B, C>();
      +  
      + automatically derives the fact that A can be upcast to C and vice-versa. +
    +
    + +

    
    +void *
    +void_upcast(
    +    extended_type_info const & derived_type,
    +    extended_type_info const & base_type,
    +    void * const t 
    +);
    +

    + +

    
    +void *
    +void_downcast(
    +    extended_type_info const & derived_type,
    +    extended_type_info const & base_type,
    +    void * const t 
    +);
    +

    +
    +These functions cast a void pointer from one type to another. The source and +definition types are specified by passing references to the corresponding + +extended_type_info +records. An attempt to cast between types not "registered" with +void_cast_register +will throw a +boost::archive::archive_exception +with value equal to +unregistered_cast +
    +
    + +
    +

    © Copyright Robert Ramey 2002-2004. +Distributed under 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) +

    + + diff --git a/deal.II/contrib/boost/libs/serialization/doc/wrappers.html b/deal.II/contrib/boost/libs/serialization/doc/wrappers.html new file mode 100644 index 0000000000..79107ac4a4 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/doc/wrappers.html @@ -0,0 +1,213 @@ + + + + + + + +Serialization - Serialization Wrappers + + + + + + + +
    +

    C++ Boost

    +
    +

    Serialization

    +

    Serialization Wrappers

    +
    +
    +
    +
    Binary Objects +
    Arrays +
    BOOST_STRONG_TYPEDEF +
    Collection Sizes +
    Name-Value Pairs +
    Composition +
    +Sometimes it convenient to create a temporary object just to support serialization +of some underlying data. This permits an archive class to define special +handling of this type. The library includes several such types for varying +purposes. +

    +Wrappers need to be treated in a special way by some archives, and hence +the is_wrapper trait for +these wrapper classes is set to true. + +

    Binary Objects

    +A binary object is just an sequence of bytes stored as raw +binary data. This would most likely be used for a large amount +of "light weight" data such as a pixel map or embedded binary file. +The header file + +binary_object.hpp + +includes the constructors: +
    
    +boost::serialization::binary_object(void * t, size_t size);
    +boost::serialization::make_binary_object(void * t, size_t size);
    +
    +which will construct a temporary binary object that can be serialized just like any other object. +Its default serialization is to use archive class primitives +save_binary and load_binary. +Note that it doesn't allocated any storage or create any objects. +Its sole purpose is to pass the data size and address as pair to the archive class. + + +

    Arrays

    +An array is a contiguous sequence of homogeneous data types, such as a builtin +C-array, a boost::array<T> or a std::vector<T>. +The purpose of this wrapper is to support archive types (such as binary +archives) that provide optimized serialization for contiguous sequences of +objects of the same type. + +The header file + +array.hpp + +includes the function +
    
    +template <T>
    +boost::serialization::make_array(T* t, std::size_t size);
    +
    +which will construct a temporary array object +
    
    +template
    +class array
    +{
    +public:    
    +    typedef T value_type;
    +    array(value_type* t, std::size_t s);
    +    value_type* address() const;
    +    std::size_t count() const;
    +};
    +
    +that can be serialized just like any other object. +Its default serialization is to use serialize each array element. +Note that it doesn't allocated any storage or create any objects. +Its sole purpose is to pass the data type, size and address to the archive class. + +Archive types that can provide optimized implementations for contiguous +arrays of homogeneous data types should overload the serialization of +array. + + +

    BOOST_STRONG_TYPEDEF

    +Another example of a serialization wrapper is the +BOOST_STRONG_TYPEDEF template. +The serialization libraries uses these to pass particular kinds of integers such +as object_id, version, etc. to an archive class. Given that these integers +are now distinguishable according to their type, XML archives can apply +special handling to these types. For example, a version number is rendered +as an XML attribute in the form "version=12". In the absence of any specific override, +these types are automatically converted to the underlying integer type so the +special overrides used for XML archives aren't needed for other archives. + + + +

    Collection Sizes

    +An example of a strong typedef is the collection_size_type in the +header file + +collection_size_type.hpp +. This type should be used for serializaing the size of a C++ collection, so +that the archive can pick the best integral representation for the serialization +of collection sizes. This is necessary since, although std::size_t +is guaranteed to be an integral type large enough to represent the size of +a collection on a specific platform, the archive might want to serialize +the size differently than this type. For example, the collection_size_type +might be serialized as a variable length integer in a portable binary archive. + + + + + + +

    Name-Value Pairs

    +XML archives present a somewhat special case. XML format has a nested +structure that maps well to the "recursive class member visitor" pattern used +by the serialization system. However, XML differs from other formats +in that it requires a name for each class data member. Our goal is to +add this information to the class serialization specification while +still permiting the the serialization code to be used with any archive. +

    +Our solution is to wrap class members to be serialized in a +name-value-pair. This structure is defined in +nvp.hpp. +It is just a reference to the data member coupled with a pointer to +to a const char * which +corresponds to the XML name. It implements the default +serialization functions for a name-value pair. This default +action is to just ignore the item name and serialize the +data value in the normal manner. For archive classes that +don't make any special provision for name-value pairs, this +is the action which will be invoked when the name-value pair +is serialized. Hence, wrapping a data value into a name-value +pair will have no effect when used with archives which +make no special provision for this wrapper. +

    +The xml archive classes contain code similar to: +

    
    +// special treatment for name-value pairs.
    +template<class T>
    +xml_oarchive & operator&(const boost::serialization::nvp & t)
    +{
    +    // write an xml start tag
    +    start_tag(t.name());
    +
    +    // serialize the data as usual
    +    *this & t.value();
    +
    +    // write an xml end tag
    +    end_tag(t.name());
    +}
    +
    +The most obvious and convient name to assign to as the XML data item name +is - surpise! - the name of the C++ class data member. So our serialization +code will look like: +
    
    +ar & make_nvp("my_variable", my_variable);
    +
    +To simplify typing and enhance readability a macro is defined so we can write: +
    
    +ar & BOOST_SERIALIZATION_NVP(my_variable);
    +
    +Similarly there exists a macro definition that permits us to write: +
    
    +BOOST_SERIALIZATION_BASE_OBJECT_NVP(my_base_class)
    +
    + +Note that these macros must be used in the namespace of the class, +and without qualifying the namespace in the argument. + +

    +demo_gps.hpp +includes NVP wrappers or all data members. +demo_xml.cpp +saves and loads data to an XML archive. +Here +is example of the XML Archive corresponding to our tutorial example. + +

    Composition

    +Wrappers should be designed so that they can be composed as necessary. +For example, to pass binary data as a name value pair use: +
    
    +ar & make_nvp("named_binary_object", make_binary_object(address, size));
    +
    + +
    +

    © Copyright Robert Ramey 2002-2004. +Distributed under 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) +

    + + + diff --git a/deal.II/contrib/boost/libs/serialization/example/Jamfile.v2 b/deal.II/contrib/boost/libs/serialization/example/Jamfile.v2 new file mode 100644 index 0000000000..ab4d258d40 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/example/Jamfile.v2 @@ -0,0 +1,57 @@ +# Boost serialization Library Build Jamfile +# (C) Copyright Robert Ramey 2002-2004. +# Use, modification, and distribution are 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/libs/serialization for the library home page. + +project libs/serialization/example + : id serialization_example + : requirements ../build//boost_serialization + ; + +rule demo_bsl_run ( demo-name : othersources * : requirements * ) +{ + return [ run + # sources + $(demo-name).cpp + $(othersources).cpp + : # command + : # input files + : # requirements + # toolset suppress-warnings + gcc:"-Wno-non-virtual-dtor -Wno-ctor-dtor-privacy" + msvc-8.0:"-wd4996" + borland:"-w-8080 -w-8071 -w-8057 -w-8062 -w-8008 -w-0018 -w-8066" + # toolset optimizations + gcc:"-ftemplate-depth-255" + msvc:"-Gy" + # toolset shared library support + como,shared:no + msvc,stlport,shared:no + cw,static:no + $(requirements) + : # test name + $(demo-name) + ] + ; +} + +test-suite "demo-suite" : + # demos + [ demo_bsl_run demo ] + [ demo_bsl_run demo_auto_ptr ] + [ demo_bsl_run demo_exception ] + [ demo_bsl_run demo_log : log_archive ] + [ demo_bsl_run demo_pimpl : demo_pimpl_A ] + [ demo_bsl_run demo_polymorphic : demo_polymorphic_A ] + [ demo_bsl_run demo_portable_archive : portable_binary_iarchive portable_binary_oarchive ] + [ demo_bsl_run demo_shared_ptr ] + [ demo_bsl_run demo_simple_log ] + [ demo_bsl_run demo_trivial_archive ] + [ demo_bsl_run demo_xml ] + [ demo_bsl_run demo_xml_save ] + [ demo_bsl_run demo_xml_load : : demo_xml_save ] +; + diff --git a/deal.II/contrib/boost/libs/serialization/example/demo.cpp b/deal.II/contrib/boost/libs/serialization/example/demo.cpp new file mode 100644 index 0000000000..98e987fda9 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/example/demo.cpp @@ -0,0 +1,377 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// demo.cpp +// +// (C) Copyright 2002-4 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) + + +#include // NULL +#include +#include +#include +#include + +#include + +#include +#include + +#include +#include +#include +#include + +///////////////////////////////////////////////////////////// +// The intent of this program is to serve as a tutorial for +// users of the serialization package. An attempt has been made +// to illustrate most of the facilities of the package. +// +// The intent is to create an example suffciently complete to +// illustrate the usage and utility of the package while +// including a minimum of other code. +// +// This illustration models the bus system of a small city. +// This includes, multiple bus stops, bus routes and schedules. +// There are different kinds of stops. Bus stops in general will +// will appear on multiple routes. A schedule will include +// muliple trips on the same route. + +///////////////////////////////////////////////////////////// +// gps coordinate +// +// llustrates serialization for a simple type +// +class gps_position +{ + friend std::ostream & operator<<(std::ostream &os, const gps_position &gp); + friend class boost::serialization::access; + int degrees; + int minutes; + float seconds; + template + void serialize(Archive & ar, const unsigned int /* file_version */){ + ar & degrees & minutes & seconds; + } +public: + // every serializable class needs a constructor + gps_position(){}; + gps_position(int _d, int _m, float _s) : + degrees(_d), minutes(_m), seconds(_s) + {} +}; +std::ostream & operator<<(std::ostream &os, const gps_position &gp) +{ + return os << ' ' << gp.degrees << (unsigned char)186 << gp.minutes << '\'' << gp.seconds << '"'; +} + +///////////////////////////////////////////////////////////// +// One bus stop +// +// illustrates serialization of serializable members +// + +class bus_stop +{ + friend class boost::serialization::access; + friend std::ostream & operator<<(std::ostream &os, const bus_stop &gp); + virtual std::string description() const = 0; + gps_position latitude; + gps_position longitude; + template + void serialize(Archive &ar, const unsigned int version) + { + ar & latitude; + ar & longitude; + } +protected: + bus_stop(const gps_position & _lat, const gps_position & _long) : + latitude(_lat), longitude(_long) + {} +public: + bus_stop(){} + virtual ~bus_stop(){} +}; + +BOOST_SERIALIZATION_ASSUME_ABSTRACT(bus_stop) + +std::ostream & operator<<(std::ostream &os, const bus_stop &bs) +{ + return os << bs.latitude << bs.longitude << ' ' << bs.description(); +} + +///////////////////////////////////////////////////////////// +// Several kinds of bus stops +// +// illustrates serialization of derived types +// +class bus_stop_corner : public bus_stop +{ + friend class boost::serialization::access; + std::string street1; + std::string street2; + virtual std::string description() const + { + return street1 + " and " + street2; + } + template + void serialize(Archive &ar, const unsigned int version) + { + // save/load base class information + ar & boost::serialization::base_object(*this); + ar & street1 & street2; + } + +public: + bus_stop_corner(){} + bus_stop_corner(const gps_position & _lat, const gps_position & _long, + const std::string & _s1, const std::string & _s2 + ) : + bus_stop(_lat, _long), street1(_s1), street2(_s2) + { + } +}; + +class bus_stop_destination : public bus_stop +{ + friend class boost::serialization::access; + std::string name; + virtual std::string description() const + { + return name; + } + template + void serialize(Archive &ar, const unsigned int version) + { + ar & boost::serialization::base_object(*this) & name; + } +public: + + bus_stop_destination(){} + bus_stop_destination( + const gps_position & _lat, const gps_position & _long, const std::string & _name + ) : + bus_stop(_lat, _long), name(_name) + { + } +}; + +///////////////////////////////////////////////////////////// +// a bus route is a collection of bus stops +// +// illustrates serialization of STL collection templates. +// +// illustrates serialzation of polymorphic pointer (bus stop *); +// +// illustrates storage and recovery of shared pointers is correct +// and efficient. That is objects pointed to by more than one +// pointer are stored only once. In such cases only one such +// object is restored and pointers are restored to point to it +// +class bus_route +{ + friend class boost::serialization::access; + friend std::ostream & operator<<(std::ostream &os, const bus_route &br); + typedef bus_stop * bus_stop_pointer; + std::list stops; + template + void serialize(Archive &ar, const unsigned int version) + { + // in this program, these classes are never serialized directly but rather + // through a pointer to the base class bus_stop. So we need a way to be + // sure that the archive contains information about these derived classes. + //ar.template register_type(); + ar.register_type(static_cast(NULL)); + //ar.template register_type(); + ar.register_type(static_cast(NULL)); + // serialization of stl collections is already defined + // in the header + ar & stops; + } +public: + bus_route(){} + void append(bus_stop *_bs) + { + stops.insert(stops.end(), _bs); + } +}; +std::ostream & operator<<(std::ostream &os, const bus_route &br) +{ + std::list::const_iterator it; + // note: we're displaying the pointer to permit verification + // that duplicated pointers are properly restored. + for(it = br.stops.begin(); it != br.stops.end(); it++){ + os << '\n' << std::hex << "0x" << *it << std::dec << ' ' << **it; + } + return os; +} + +///////////////////////////////////////////////////////////// +// a bus schedule is a collection of routes each with a starting time +// +// Illustrates serialization of STL objects(pair) in a non-intrusive way. +// See definition of operator<< >(ar, pair) and others in +// serialization.hpp +// +// illustrates nesting of serializable classes +// +// illustrates use of version number to automatically grandfather older +// versions of the same class. + +class bus_schedule +{ +public: + // note: this structure was made public. because the friend declarations + // didn't seem to work as expected. + struct trip_info + { + template + void serialize(Archive &ar, const unsigned int file_version) + { + // in versions 2 or later + if(file_version >= 2) + // read the drivers name + ar & driver; + // all versions have the follwing info + ar & hour & minute; + } + + // starting time + int hour; + int minute; + // only after system shipped was the driver's name added to the class + std::string driver; + + trip_info(){} + trip_info(int _h, int _m, const std::string &_d) : + hour(_h), minute(_m), driver(_d) + {} + }; +private: + friend class boost::serialization::access; + friend std::ostream & operator<<(std::ostream &os, const bus_schedule &bs); + friend std::ostream & operator<<(std::ostream &os, const bus_schedule::trip_info &ti); + std::list > schedule; + template + void serialize(Archive &ar, const unsigned int version) + { + ar & schedule; + } +public: + void append(const std::string &_d, int _h, int _m, bus_route *_br) + { + schedule.insert(schedule.end(), std::make_pair(trip_info(_h, _m, _d), _br)); + } + bus_schedule(){} +}; +BOOST_CLASS_VERSION(bus_schedule::trip_info, 2) + +std::ostream & operator<<(std::ostream &os, const bus_schedule::trip_info &ti) +{ + return os << '\n' << ti.hour << ':' << ti.minute << ' ' << ti.driver << ' '; +} +std::ostream & operator<<(std::ostream &os, const bus_schedule &bs) +{ + std::list >::const_iterator it; + for(it = bs.schedule.begin(); it != bs.schedule.end(); it++){ + os << it->first << *(it->second); + } + return os; +} + +void save_schedule(const bus_schedule &s, const char * filename){ + // make an archive + std::ofstream ofs(filename); + boost::archive::text_oarchive oa(ofs); + oa << s; +} + +void +restore_schedule(bus_schedule &s, const char * filename) +{ + // open the archive + std::ifstream ifs(filename); + boost::archive::text_iarchive ia(ifs); + + // restore the schedule from the archive + ia >> s; +} + +int main(int argc, char *argv[]) +{ + // make the schedule + bus_schedule original_schedule; + + // fill in the data + // make a few stops + bus_stop *bs0 = new bus_stop_corner( + gps_position(34, 135, 52.560f), + gps_position(134, 22, 78.30f), + "24th Street", "10th Avenue" + ); + bus_stop *bs1 = new bus_stop_corner( + gps_position(35, 137, 23.456f), + gps_position(133, 35, 54.12f), + "State street", "Cathedral Vista Lane" + ); + bus_stop *bs2 = new bus_stop_destination( + gps_position(35, 136, 15.456f), + gps_position(133, 32, 15.300f), + "White House" + ); + bus_stop *bs3 = new bus_stop_destination( + gps_position(35, 134, 48.789f), + gps_position(133, 32, 16.230f), + "Lincoln Memorial" + ); + + // make a routes + bus_route route0; + route0.append(bs0); + route0.append(bs1); + route0.append(bs2); + + // add trips to schedule + original_schedule.append("bob", 6, 24, &route0); + original_schedule.append("bob", 9, 57, &route0); + original_schedule.append("alice", 11, 02, &route0); + + // make aother routes + bus_route route1; + route1.append(bs3); + route1.append(bs2); + route1.append(bs1); + + // add trips to schedule + original_schedule.append("ted", 7, 17, &route1); + original_schedule.append("ted", 9, 38, &route1); + original_schedule.append("alice", 11, 47, &route1); + + // display the complete schedule + std::cout << "original schedule"; + std::cout << original_schedule; + + std::string filename(boost::archive::tmpdir()); + filename += "/demofile.txt"; + + // save the schedule + save_schedule(original_schedule, filename.c_str()); + + // ... some time later + // make a new schedule + bus_schedule new_schedule; + + restore_schedule(new_schedule, filename.c_str()); + + // and display + std::cout << "\nrestored schedule"; + std::cout << new_schedule; + // should be the same as the old one. (except for the pointer values) + + delete bs0; + delete bs1; + delete bs2; + delete bs3; + return 0; +} diff --git a/deal.II/contrib/boost/libs/serialization/example/demo_auto_ptr.cpp b/deal.II/contrib/boost/libs/serialization/example/demo_auto_ptr.cpp new file mode 100644 index 0000000000..c430b813c0 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/example/demo_auto_ptr.cpp @@ -0,0 +1,135 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// demo_auto_ptr.cpp + +// (C) Copyright 2002-4 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) + +#include +#include +#include +#include + +#include // remove, std::autoptr inteface wrong in dinkumware +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::remove; +} +#endif + +#include +#include +#include + +#include + +namespace boost { +namespace serialization { + +///////////////////////////////////////////////////////////// +// implement serialization for auto_ptr +// note: this must be added to the boost namespace in order to +// be called by the library +template +inline void save( + Archive & ar, + const std::auto_ptr &t, + const unsigned int file_version +){ + // only the raw pointer has to be saved + // the ref count is rebuilt automatically on load + const T * const tx = t.get(); + ar << tx; +} + +template +inline void load( + Archive & ar, + std::auto_ptr &t, + const unsigned int file_version +){ + T *pTarget; + ar >> pTarget; + // note that the reset automagically maintains the reference count + #if BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1) + t.release(); + t = std::auto_ptr(pTarget); + #else + t.reset(pTarget); + #endif +} + +// split non-intrusive serialization function member into separate +// non intrusive save/load member functions +template +inline void serialize( + Archive & ar, + std::auto_ptr &t, + const unsigned int file_version +){ + boost::serialization::split_free(ar, t, file_version); +} + +} // namespace serialization +} // namespace boost + +///////////////////////////////////////////////////////////// +// test auto_ptr serialization +class A +{ +private: + friend class boost::serialization::access; + int x; + template + void serialize(Archive &ar, const unsigned int /* file_version */){ + ar & x; + } +public: + A(){} // default constructor + ~A(){} // default destructor +}; + +void save(const std::auto_ptr & spa, const char *filename) +{ + std::ofstream ofs(filename); + boost::archive::text_oarchive oa(ofs); + oa << spa; +} + +void load(std::auto_ptr & spa, const char *filename) +{ + // open the archive + std::ifstream ifs(filename); + boost::archive::text_iarchive ia(ifs); + + // restore the schedule from the archive + ia >> spa; +} + +int main(int argc, char *argv[]) +{ + std::string filename = boost::archive::tmpdir(); + filename += "/testfile"; + + // create a new auto pointer to ta new object of type A + std::auto_ptr spa(new A); + // serialize it + save(spa, filename.c_str()); + // reset the auto pointer to NULL + // thereby destroying the object of type A + // note that the reset automagically maintains the reference count + #if BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1) + spa.release(); + #else + spa.reset(); + #endif + // restore state to one equivalent to the original + // creating a new type A object + load(spa, filename.c_str()); + // obj of type A gets destroyed + // as auto_ptr goes out of scope + std::remove(filename.c_str()); + return 0; +} diff --git a/deal.II/contrib/boost/libs/serialization/example/demo_dll.cpp b/deal.II/contrib/boost/libs/serialization/example/demo_dll.cpp new file mode 100644 index 0000000000..31556e7cdb --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/example/demo_dll.cpp @@ -0,0 +1,50 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_derived_class.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) + +// should pass compilation and execution + +#include // NULL +#include + +#include // remove +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::remove; +} +#endif + +#include "test_tools.hpp" + +#include "B.hpp" +#include "A.ipp" + +int test_main( int argc, char* argv[] ) +{ + const char * testfile = boost::archive::tmpnam(NULL); + + BOOST_REQUIRE(NULL != testfile); + + B b, b1; + + { + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + oa << boost::serialization::make_nvp("b", b); + } + { + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + ia >> boost::serialization::make_nvp("b1", b1); + } + BOOST_CHECK(b == b1); + std::remove(testfile); + return EXIT_SUCCESS; +} + +// EOF diff --git a/deal.II/contrib/boost/libs/serialization/example/demo_dll_a.hpp b/deal.II/contrib/boost/libs/serialization/example/demo_dll_a.hpp new file mode 100644 index 0000000000..222f0b2169 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/example/demo_dll_a.hpp @@ -0,0 +1,321 @@ +#ifndef BOOST_SERIALIZATION_TEST_A_HPP +#define BOOST_SERIALIZATION_TEST_A_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 +// A.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 +#include // for rand() +#include // for fabs() +#include // size_t + +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::rand; + using ::fabs; + using ::size_t; +} +#endif + +//#include +#include +#include + +#include +#if BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1) +#include +#endif + +#include +#include +#include + +class A +{ +private: + friend class boost::serialization::access; + // note: from an aesthetic perspective, I would much prefer to have this + // defined out of line. Unfortunately, this trips a bug in the VC 6.0 + // compiler. So hold our nose and put it her to permit running of tests. + template + void serialize( + Archive &ar, + const unsigned int /* file_version */ + ){ + ar & BOOST_SERIALIZATION_NVP(b); + #ifndef BOOST_NO_INT64_T + ar & BOOST_SERIALIZATION_NVP(f); + ar & BOOST_SERIALIZATION_NVP(g); + #endif + #if BOOST_WORKAROUND(__BORLANDC__, <= 0x551 ) + int i; + if(BOOST_DEDUCED_TYPENAME Archive::is_saving::value){ + i = l; + ar & BOOST_SERIALIZATION_NVP(i); + } + else{ + ar & BOOST_SERIALIZATION_NVP(i); + l = i; + } + #else + ar & BOOST_SERIALIZATION_NVP(l); + #endif + ar & BOOST_SERIALIZATION_NVP(m); + ar & BOOST_SERIALIZATION_NVP(n); + ar & BOOST_SERIALIZATION_NVP(o); + ar & BOOST_SERIALIZATION_NVP(p); + ar & BOOST_SERIALIZATION_NVP(q); + #ifndef BOOST_NO_CWCHAR + ar & BOOST_SERIALIZATION_NVP(r); + #endif + ar & BOOST_SERIALIZATION_NVP(c); + ar & BOOST_SERIALIZATION_NVP(s); + ar & BOOST_SERIALIZATION_NVP(t); + ar & BOOST_SERIALIZATION_NVP(u); + ar & BOOST_SERIALIZATION_NVP(v); + ar & BOOST_SERIALIZATION_NVP(w); + ar & BOOST_SERIALIZATION_NVP(x); + ar & BOOST_SERIALIZATION_NVP(y); + #ifndef BOOST_NO_STD_WSTRING + ar & BOOST_SERIALIZATION_NVP(z); + #endif + } + bool b; + #ifndef BOOST_NO_INT64_T + boost::int64_t f; + boost::uint64_t g; + #endif + enum h { + i = 0, + j, + k + } l; + std::size_t m; + signed long n; + unsigned long o; + signed short p; + unsigned short q; + #ifndef BOOST_NO_CWCHAR + wchar_t r; + #endif + char c; + signed char s; + unsigned char t; + signed int u; + unsigned int v; + float w; + double x; + std::string y; + #ifndef BOOST_NO_STD_WSTRING + std::wstring z; + #endif +public: + A(); + bool operator==(const A &rhs) const; + bool operator!=(const A &rhs) const; + bool operator<(const A &rhs) const; // used by less + // hash function for class A + operator std::size_t () const; + friend std::ostream & operator<<(std::ostream & os, A const & a); + friend std::istream & operator>>(std::istream & is, A & a); +}; + +//BOOST_TEST_DONT_PRINT_LOG_VALUE(A); + +template +void randomize(S &x) +{ + assert(0 == x.size()); + for(;;){ + unsigned int i = std::rand() % 27; + if(0 == i) + break; + x += static_cast('a' - 1 + i); + } +} + +template +void accumulate(std::size_t & s, const T & t){ + const char * tptr = (const char *)(& t); + unsigned int count = sizeof(t); + while(count-- > 0){ + s += *tptr++; + } +} + +A::operator std::size_t () const { + std::size_t retval = 0; + accumulate(retval, b); + #ifndef BOOST_NO_INT64_T + accumulate(retval, f); + accumulate(retval, g); + #endif + accumulate(retval, l); + accumulate(retval, m); + accumulate(retval, n); + accumulate(retval, o); + accumulate(retval, p); + accumulate(retval, q); + #ifndef BOOST_NO_CWCHAR + accumulate(retval, r); + #endif + accumulate(retval, c); + accumulate(retval, s); + accumulate(retval, t); + accumulate(retval, u); + accumulate(retval, v); + return retval; +} + +inline A::A() : + b(true), + #ifndef BOOST_NO_INT64_T + f(std::rand() * std::rand()), + g(std::rand() * std::rand()), + #endif + l(static_cast(std::rand() % 3)), + m(std::rand()), + n(std::rand()), + o(std::rand()), + p(std::rand()), + q(std::rand()), + #ifndef BOOST_NO_CWCHAR + r(std::rand()), + #endif + c(std::rand()), + s(std::rand()), + t(std::rand()), + u(std::rand()), + v(std::rand()), + w((float)std::rand()), + x((double)std::rand()) +{ + randomize(y); + #ifndef BOOST_NO_STD_WSTRING + randomize(z); + #endif +} + +inline bool A::operator==(const A &rhs) const +{ + if(b != rhs.b) + return false; + if(l != rhs.l) + return false; + #ifndef BOOST_NO_INT64_T + if(f != rhs.f) + return false; + if(g != rhs.g) + return false; + #endif + if(m != rhs.m) + return false; + if(n != rhs.n) + return false; + if(o != rhs.o) + return false; + if(p != rhs.p) + return false; + if(q != rhs.q) + return false; + #ifndef BOOST_NO_CWCHAR + if(r != rhs.r) + return false; + #endif + if(c != rhs.c) + return false; + if(s != rhs.s) + return false; + if(t != rhs.t) + return false; + if(u != rhs.u) + return false; + if(v != rhs.v) + return false; + if(w == 0 && std::fabs(rhs.w) > std::numeric_limits::epsilon()) + return false; + if(std::fabs(rhs.w/w - 1.0) > std::numeric_limits::epsilon()) + return false; + if(x == 0 && std::fabs(rhs.x - x) > std::numeric_limits::epsilon()) + return false; + if(std::fabs(rhs.x/x - 1.0) > std::numeric_limits::epsilon()) + return false; + if(0 != y.compare(rhs.y)) + return false; + #ifndef BOOST_NO_STD_WSTRING + if(0 != z.compare(rhs.z)) + return false; + #endif + return true; +} + +inline bool A::operator!=(const A &rhs) const +{ + return ! (*this == rhs); +} + +inline bool A::operator<(const A &rhs) const +{ + if(b != rhs.b) + return b < rhs.b; + #ifndef BOOST_NO_INT64_T + if(f != rhs.f) + return f < rhs.f; + if(g != rhs.g) + return g < rhs.g; + #endif + if(l != rhs.l ) + return l < rhs.l; + if(m != rhs.m ) + return m < rhs.m; + if(n != rhs.n ) + return n < rhs.n; + if(o != rhs.o ) + return o < rhs.o; + if(p != rhs.p ) + return p < rhs.p; + if(q != rhs.q ) + return q < rhs.q; + #ifndef BOOST_NO_CWCHAR + if(r != rhs.r ) + return r < rhs.r; + #endif + if(c != rhs.c ) + return c < rhs.c; + if(s != rhs.s ) + return s < rhs.s; + if(t != rhs.t ) + return t < rhs.t; + if(u != rhs.u ) + return u < rhs.u; + if(v != rhs.v ) + return v < rhs.v; + if(w != rhs.w ) + return w < rhs.w; + if(x != rhs.x ) + return x < rhs.x; + int i = y.compare(rhs.y); + if(i != 0 ) + return i < 0; + #ifndef BOOST_NO_STD_WSTRING + int j = z.compare(rhs.z); + if(j != 0 ) + return j < 0; + #endif + return false; +} + +#endif // BOOST_SERIALIZATION_TEST_A_HPP diff --git a/deal.II/contrib/boost/libs/serialization/example/demo_dll_a.ipp b/deal.II/contrib/boost/libs/serialization/example/demo_dll_a.ipp new file mode 100644 index 0000000000..222f0b2169 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/example/demo_dll_a.ipp @@ -0,0 +1,321 @@ +#ifndef BOOST_SERIALIZATION_TEST_A_HPP +#define BOOST_SERIALIZATION_TEST_A_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 +// A.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 +#include // for rand() +#include // for fabs() +#include // size_t + +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::rand; + using ::fabs; + using ::size_t; +} +#endif + +//#include +#include +#include + +#include +#if BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1) +#include +#endif + +#include +#include +#include + +class A +{ +private: + friend class boost::serialization::access; + // note: from an aesthetic perspective, I would much prefer to have this + // defined out of line. Unfortunately, this trips a bug in the VC 6.0 + // compiler. So hold our nose and put it her to permit running of tests. + template + void serialize( + Archive &ar, + const unsigned int /* file_version */ + ){ + ar & BOOST_SERIALIZATION_NVP(b); + #ifndef BOOST_NO_INT64_T + ar & BOOST_SERIALIZATION_NVP(f); + ar & BOOST_SERIALIZATION_NVP(g); + #endif + #if BOOST_WORKAROUND(__BORLANDC__, <= 0x551 ) + int i; + if(BOOST_DEDUCED_TYPENAME Archive::is_saving::value){ + i = l; + ar & BOOST_SERIALIZATION_NVP(i); + } + else{ + ar & BOOST_SERIALIZATION_NVP(i); + l = i; + } + #else + ar & BOOST_SERIALIZATION_NVP(l); + #endif + ar & BOOST_SERIALIZATION_NVP(m); + ar & BOOST_SERIALIZATION_NVP(n); + ar & BOOST_SERIALIZATION_NVP(o); + ar & BOOST_SERIALIZATION_NVP(p); + ar & BOOST_SERIALIZATION_NVP(q); + #ifndef BOOST_NO_CWCHAR + ar & BOOST_SERIALIZATION_NVP(r); + #endif + ar & BOOST_SERIALIZATION_NVP(c); + ar & BOOST_SERIALIZATION_NVP(s); + ar & BOOST_SERIALIZATION_NVP(t); + ar & BOOST_SERIALIZATION_NVP(u); + ar & BOOST_SERIALIZATION_NVP(v); + ar & BOOST_SERIALIZATION_NVP(w); + ar & BOOST_SERIALIZATION_NVP(x); + ar & BOOST_SERIALIZATION_NVP(y); + #ifndef BOOST_NO_STD_WSTRING + ar & BOOST_SERIALIZATION_NVP(z); + #endif + } + bool b; + #ifndef BOOST_NO_INT64_T + boost::int64_t f; + boost::uint64_t g; + #endif + enum h { + i = 0, + j, + k + } l; + std::size_t m; + signed long n; + unsigned long o; + signed short p; + unsigned short q; + #ifndef BOOST_NO_CWCHAR + wchar_t r; + #endif + char c; + signed char s; + unsigned char t; + signed int u; + unsigned int v; + float w; + double x; + std::string y; + #ifndef BOOST_NO_STD_WSTRING + std::wstring z; + #endif +public: + A(); + bool operator==(const A &rhs) const; + bool operator!=(const A &rhs) const; + bool operator<(const A &rhs) const; // used by less + // hash function for class A + operator std::size_t () const; + friend std::ostream & operator<<(std::ostream & os, A const & a); + friend std::istream & operator>>(std::istream & is, A & a); +}; + +//BOOST_TEST_DONT_PRINT_LOG_VALUE(A); + +template +void randomize(S &x) +{ + assert(0 == x.size()); + for(;;){ + unsigned int i = std::rand() % 27; + if(0 == i) + break; + x += static_cast('a' - 1 + i); + } +} + +template +void accumulate(std::size_t & s, const T & t){ + const char * tptr = (const char *)(& t); + unsigned int count = sizeof(t); + while(count-- > 0){ + s += *tptr++; + } +} + +A::operator std::size_t () const { + std::size_t retval = 0; + accumulate(retval, b); + #ifndef BOOST_NO_INT64_T + accumulate(retval, f); + accumulate(retval, g); + #endif + accumulate(retval, l); + accumulate(retval, m); + accumulate(retval, n); + accumulate(retval, o); + accumulate(retval, p); + accumulate(retval, q); + #ifndef BOOST_NO_CWCHAR + accumulate(retval, r); + #endif + accumulate(retval, c); + accumulate(retval, s); + accumulate(retval, t); + accumulate(retval, u); + accumulate(retval, v); + return retval; +} + +inline A::A() : + b(true), + #ifndef BOOST_NO_INT64_T + f(std::rand() * std::rand()), + g(std::rand() * std::rand()), + #endif + l(static_cast(std::rand() % 3)), + m(std::rand()), + n(std::rand()), + o(std::rand()), + p(std::rand()), + q(std::rand()), + #ifndef BOOST_NO_CWCHAR + r(std::rand()), + #endif + c(std::rand()), + s(std::rand()), + t(std::rand()), + u(std::rand()), + v(std::rand()), + w((float)std::rand()), + x((double)std::rand()) +{ + randomize(y); + #ifndef BOOST_NO_STD_WSTRING + randomize(z); + #endif +} + +inline bool A::operator==(const A &rhs) const +{ + if(b != rhs.b) + return false; + if(l != rhs.l) + return false; + #ifndef BOOST_NO_INT64_T + if(f != rhs.f) + return false; + if(g != rhs.g) + return false; + #endif + if(m != rhs.m) + return false; + if(n != rhs.n) + return false; + if(o != rhs.o) + return false; + if(p != rhs.p) + return false; + if(q != rhs.q) + return false; + #ifndef BOOST_NO_CWCHAR + if(r != rhs.r) + return false; + #endif + if(c != rhs.c) + return false; + if(s != rhs.s) + return false; + if(t != rhs.t) + return false; + if(u != rhs.u) + return false; + if(v != rhs.v) + return false; + if(w == 0 && std::fabs(rhs.w) > std::numeric_limits::epsilon()) + return false; + if(std::fabs(rhs.w/w - 1.0) > std::numeric_limits::epsilon()) + return false; + if(x == 0 && std::fabs(rhs.x - x) > std::numeric_limits::epsilon()) + return false; + if(std::fabs(rhs.x/x - 1.0) > std::numeric_limits::epsilon()) + return false; + if(0 != y.compare(rhs.y)) + return false; + #ifndef BOOST_NO_STD_WSTRING + if(0 != z.compare(rhs.z)) + return false; + #endif + return true; +} + +inline bool A::operator!=(const A &rhs) const +{ + return ! (*this == rhs); +} + +inline bool A::operator<(const A &rhs) const +{ + if(b != rhs.b) + return b < rhs.b; + #ifndef BOOST_NO_INT64_T + if(f != rhs.f) + return f < rhs.f; + if(g != rhs.g) + return g < rhs.g; + #endif + if(l != rhs.l ) + return l < rhs.l; + if(m != rhs.m ) + return m < rhs.m; + if(n != rhs.n ) + return n < rhs.n; + if(o != rhs.o ) + return o < rhs.o; + if(p != rhs.p ) + return p < rhs.p; + if(q != rhs.q ) + return q < rhs.q; + #ifndef BOOST_NO_CWCHAR + if(r != rhs.r ) + return r < rhs.r; + #endif + if(c != rhs.c ) + return c < rhs.c; + if(s != rhs.s ) + return s < rhs.s; + if(t != rhs.t ) + return t < rhs.t; + if(u != rhs.u ) + return u < rhs.u; + if(v != rhs.v ) + return v < rhs.v; + if(w != rhs.w ) + return w < rhs.w; + if(x != rhs.x ) + return x < rhs.x; + int i = y.compare(rhs.y); + if(i != 0 ) + return i < 0; + #ifndef BOOST_NO_STD_WSTRING + int j = z.compare(rhs.z); + if(j != 0 ) + return j < 0; + #endif + return false; +} + +#endif // BOOST_SERIALIZATION_TEST_A_HPP diff --git a/deal.II/contrib/boost/libs/serialization/example/demo_dll_b.hpp b/deal.II/contrib/boost/libs/serialization/example/demo_dll_b.hpp new file mode 100644 index 0000000000..245ce37133 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/example/demo_dll_b.hpp @@ -0,0 +1,112 @@ +#ifndef BOOST_SERIALIZATION_TEST_B_HPP +#define BOOST_SERIALIZATION_TEST_B_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 +// B.hpp + +// (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 // for rand() + +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::rand; +} +#endif + +#include +#include +#include + +#include "A.hpp" + +/////////////////////////////////////////////////////// +// Derived class test +class B : public A +{ +private: + friend class boost::serialization::access; + template + void save(Archive &ar, const unsigned int /* file_version */) const + { + // write any base class info to the archive + ar << BOOST_SERIALIZATION_BASE_OBJECT_NVP(A); + + // write out members + ar << BOOST_SERIALIZATION_NVP(s); + ar << BOOST_SERIALIZATION_NVP(t); + ar << BOOST_SERIALIZATION_NVP(u); + ar << BOOST_SERIALIZATION_NVP(v); + ar << BOOST_SERIALIZATION_NVP(w); + ar << BOOST_SERIALIZATION_NVP(x); + } + + template + void load(Archive & ar, const unsigned int file_version) + { + // read any base class info to the archive + ar >> BOOST_SERIALIZATION_BASE_OBJECT_NVP(A); + switch(file_version){ + case 1: + case 2: + ar >> BOOST_SERIALIZATION_NVP(s); + ar >> BOOST_SERIALIZATION_NVP(t); + ar >> BOOST_SERIALIZATION_NVP(u); + ar >> BOOST_SERIALIZATION_NVP(v); + ar >> BOOST_SERIALIZATION_NVP(w); + ar >> BOOST_SERIALIZATION_NVP(x); + default: + break; + } + } + + BOOST_SERIALIZATION_SPLIT_MEMBER() + signed char s; + unsigned char t; + signed int u; + unsigned int v; + float w; + double x; +public: + B(); + virtual ~B(){}; + bool operator==(const B &rhs) const; +}; + +B::B() : + s(std::rand()), + t(std::rand()), + u(std::rand()), + v(std::rand()), + w((float)std::rand() / std::rand()), + x((double)std::rand() / std::rand()) +{ +} + +BOOST_CLASS_VERSION(B, 2) + +inline bool B::operator==(const B &rhs) const +{ + return + A::operator==(rhs) + && s == rhs.s + && t == rhs.t + && u == rhs.u + && v == rhs.v + && std::fabs(w - rhs.w) <= std::numeric_limits::round_error() + && std::fabs(x - rhs.x) <= std::numeric_limits::round_error() + ; +} + +#endif // BOOST_SERIALIZATION_TEST_B_HPP diff --git a/deal.II/contrib/boost/libs/serialization/example/demo_dll_b.ipp b/deal.II/contrib/boost/libs/serialization/example/demo_dll_b.ipp new file mode 100644 index 0000000000..245ce37133 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/example/demo_dll_b.ipp @@ -0,0 +1,112 @@ +#ifndef BOOST_SERIALIZATION_TEST_B_HPP +#define BOOST_SERIALIZATION_TEST_B_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 +// B.hpp + +// (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 // for rand() + +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::rand; +} +#endif + +#include +#include +#include + +#include "A.hpp" + +/////////////////////////////////////////////////////// +// Derived class test +class B : public A +{ +private: + friend class boost::serialization::access; + template + void save(Archive &ar, const unsigned int /* file_version */) const + { + // write any base class info to the archive + ar << BOOST_SERIALIZATION_BASE_OBJECT_NVP(A); + + // write out members + ar << BOOST_SERIALIZATION_NVP(s); + ar << BOOST_SERIALIZATION_NVP(t); + ar << BOOST_SERIALIZATION_NVP(u); + ar << BOOST_SERIALIZATION_NVP(v); + ar << BOOST_SERIALIZATION_NVP(w); + ar << BOOST_SERIALIZATION_NVP(x); + } + + template + void load(Archive & ar, const unsigned int file_version) + { + // read any base class info to the archive + ar >> BOOST_SERIALIZATION_BASE_OBJECT_NVP(A); + switch(file_version){ + case 1: + case 2: + ar >> BOOST_SERIALIZATION_NVP(s); + ar >> BOOST_SERIALIZATION_NVP(t); + ar >> BOOST_SERIALIZATION_NVP(u); + ar >> BOOST_SERIALIZATION_NVP(v); + ar >> BOOST_SERIALIZATION_NVP(w); + ar >> BOOST_SERIALIZATION_NVP(x); + default: + break; + } + } + + BOOST_SERIALIZATION_SPLIT_MEMBER() + signed char s; + unsigned char t; + signed int u; + unsigned int v; + float w; + double x; +public: + B(); + virtual ~B(){}; + bool operator==(const B &rhs) const; +}; + +B::B() : + s(std::rand()), + t(std::rand()), + u(std::rand()), + v(std::rand()), + w((float)std::rand() / std::rand()), + x((double)std::rand() / std::rand()) +{ +} + +BOOST_CLASS_VERSION(B, 2) + +inline bool B::operator==(const B &rhs) const +{ + return + A::operator==(rhs) + && s == rhs.s + && t == rhs.t + && u == rhs.u + && v == rhs.v + && std::fabs(w - rhs.w) <= std::numeric_limits::round_error() + && std::fabs(x - rhs.x) <= std::numeric_limits::round_error() + ; +} + +#endif // BOOST_SERIALIZATION_TEST_B_HPP diff --git a/deal.II/contrib/boost/libs/serialization/example/demo_exception.cpp b/deal.II/contrib/boost/libs/serialization/example/demo_exception.cpp new file mode 100644 index 0000000000..122a05a0bc --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/example/demo_exception.cpp @@ -0,0 +1,258 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// demo_exception.cpp + +// (C) Copyright 2002-4 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) + +// Example of safe exception handling for pointer de-serialization +// +// This example was prepared by Robert Ramey to demonstrate and test +// safe exception handling during the de-serialization of pointers in +// a non-trivial example. +// +// Hopefully, this addresses exception issues raised by +// Vahan Margaryan who spent considerable time and effort +// in the analysis and testing of issues of exception safety +// of the serialization library. + +#include +#include +#include // NULL +#include +#include + +#include // remove +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::remove; +} +#endif + +#include + +#ifndef BOOST_NO_EXCEPTIONS +#include +#endif + +#include +#include + +#include +#include + +template +struct deleter +{ + void operator()(TPTR t){ + delete t; + } +}; + +class Course; +class Student; + +class Student +{ +public: + static int count; + Student(){ + count++; + } + ~Student(){ + some_courses.clear(); + count--; + } + std::list some_courses; +private: + friend class boost::serialization::access; + template + void serialize(Archive & ar, const unsigned int /* file_version */){ + ar & some_courses; + } +}; + +int Student::count = 0; + +class Course +{ +public: + static int count; + Course(){ + count++; + } + ~Course(){ + // doesnt delete pointers in list + // since it doesn't "own" them + some_students.clear(); + count--; + } + std::list some_students; +private: + friend class boost::serialization::access; + template + void serialize(Archive & ar, const unsigned int /* file_version */){ + ar & some_students; + } +}; + +int Course::count = 0; + +class School +{ +public: + ~School(){ + // must delete all the students because + // it "owns" them + std::for_each(all_students.begin(), all_students.end(), deleter()); + all_students.clear(); + // as well as courses + std::for_each(all_courses.begin(), all_courses.end(), deleter()); + all_courses.clear(); + } + std::list all_students; + std::list all_courses; +private: + friend class boost::serialization::access; + BOOST_SERIALIZATION_SPLIT_MEMBER() + template + void save(Archive & ar, const unsigned int file_version) const; + template + void load(Archive & ar, const unsigned int file_version); +}; + +#if 0 +// case 1: +template +void School::serialize(Archive & ar, const unsigned int /* file_version */){ + // if an exeception occurs while loading courses + // the structure courses may have some courses each + // with students + ar & all_courses; + // while all_students will have no members. + ar & all_students; // create students that have no courses + // so ~School() will delete all members of courses + // but this will NOT delete any students - see above + // a memory leak will be the result. +} + +// switching the order of serialization doesn't help in this case +// case 2: +template +void School::serialize(Archive & ar, const unsigned int /* file_version */){ + ar & all_students; + ar >> all_courses; // create any courses that have no students +} +#endif + +template +void School::save(Archive & ar, const unsigned int /* file_version */) const { + ar << all_students; + ar << all_courses; +} + +template +void School::load(Archive & ar, const unsigned int /* file_version */){ + // if an exeception occurs while loading courses + // the structure courses may have some courses each + // with students + try{ + // deserialization of a Course * will in general provoke the + // deserialization of Student * which are added to the list of + // students for a class. That is, this process will result + // in the copying of a pointer. + ar >> all_courses; + ar >> all_students; // create students that have no courses + } + catch(std::exception){ + // elminate any dangling references + all_courses.clear(); + all_students.clear(); + throw; + } +} + +void init(School *school){ + Student *bob = new Student(); + Student *ted = new Student(); + Student *carol = new Student(); + Student *alice = new Student(); + + school->all_students.push_back(bob); + school->all_students.push_back(ted); + school->all_students.push_back(carol); + school->all_students.push_back(alice); + + Course *math = new Course(); + Course *history = new Course(); + Course *literature = new Course(); + Course *gym = new Course(); + + school->all_courses.push_back(math); + school->all_courses.push_back(history); + school->all_courses.push_back(literature); + school->all_courses.push_back(gym); + + bob->some_courses.push_back(math); + math->some_students.push_back(bob); + bob->some_courses.push_back(literature); + literature->some_students.push_back(bob); + + ted->some_courses.push_back(math); + math->some_students.push_back(ted); + ted->some_courses.push_back(history); + history->some_students.push_back(ted); + + alice->some_courses.push_back(literature); + literature->some_students.push_back(alice); + alice->some_courses.push_back(history); + history->some_students.push_back(alice); + + // no students signed up for gym + // carol has no courses +} + +void save(const School * const school, const char *filename){ + std::ofstream ofile(filename); + boost::archive::text_oarchive ar(ofile); + ar << school; +} + +void load(School * & school, const char *filename){ + std::ifstream ifile(filename); + boost::archive::text_iarchive ar(ifile); + try{ + ar >> school; + } + catch(std::exception){ + // eliminate dangling reference + school = NULL; + } +} + +int main(int argc, char *argv[]){ + std::string filename(boost::archive::tmpdir()); + filename += "/demofile.txt"; + + School *school = new School(); + std::cout << "1. student count = " << Student::count << std::endl; + std::cout << "2. class count = " << Course::count << std::endl; + init(school); + std::cout << "3. student count = " << Student::count << std::endl; + std::cout << "4. class count = " << Course::count << std::endl; + save(school, filename.c_str()); + delete school; + school = NULL; + std::cout << "5. student count = " << Student::count << std::endl; + std::cout << "6. class count = " << Course::count << std::endl; + load(school, filename.c_str()); + std::cout << "7. student count = " << Student::count << std::endl; + std::cout << "8. class count = " << Course::count << std::endl; + delete school; + std::cout << "9. student count = " << Student::count << std::endl; + std::cout << "10. class count = " << Course::count << std::endl; + std::remove(filename.c_str()); + return Student::count + Course::count; +} diff --git a/deal.II/contrib/boost/libs/serialization/example/demo_fast_archive.cpp b/deal.II/contrib/boost/libs/serialization/example/demo_fast_archive.cpp new file mode 100644 index 0000000000..0f28ef7baa --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/example/demo_fast_archive.cpp @@ -0,0 +1,181 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// demo_fast_binary_archive.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) + +// should pass compilation and execution +#include + +#include +#include +#include + +#define BOOST_ARCHIVE_SOURCE +#include +#include +#include + +// include template definitions for base classes used. Otherwise +// you'll get link failure with undefined symbols +#include +#include +#include +#include + +using namespace boost::archive; + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// "Fast" output binary archive. This is a variation of the native binary +class fast_binary_oarchive : + // don't derive from binary_oarchive !!! + public binary_oarchive_impl< + fast_binary_oarchive, + std::ostream::char_type, + std::ostream::traits_type + > +{ + typedef fast_binary_oarchive derived_t; + typedef binary_oarchive_impl< + fast_binary_oarchive, + std::ostream::char_type, + std::ostream::traits_type + > base_t; +#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS +public: +#else + friend class boost::archive::detail::interface_oarchive; + friend class basic_binary_oarchive; + friend class basic_binary_oprimitive< + derived_t, + std::ostream::char_type, + std::ostream::traits_type + >; + friend class boost::archive::save_access; +#endif + // add base class to the places considered when matching + // save function to a specific set of arguments. Note, this didn't + // work on my MSVC 7.0 system using + // binary_oarchive_impl::load_override; + // so we use the sure-fire method below. This failed to work as well + template + void save_override(T & t, BOOST_PFTO int){ + base_t::save_override(t, 0); + // verify that this program is in fact working by making sure + // that arrays are getting passed here + BOOST_STATIC_ASSERT(! (boost::is_array::value) ); + } + template + void save_override(const int (& t)[N] , int){ + save_binary(t, sizeof(t)); + } + template + void save_override(const unsigned int (& t)[N], int){ + save_binary(t, sizeof(t)); + } + template + void save_override(const long (& t)[N], int){ + save_binary(t, sizeof(t)); + } + template + void save_override(const unsigned long (& t)[N], int){ + save_binary(t, sizeof(t)); + } +public: + fast_binary_oarchive(std::ostream & os, unsigned flags = 0) : + base_t(os, flags) + {} + fast_binary_oarchive(std::streambuf & bsb, unsigned int flags = 0) : + base_t(bsb, flags) + {} +}; + +// required by export +BOOST_SERIALIZATION_REGISTER_ARCHIVE(fast_binary_oarchive) + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// "Fast" input binary archive. This is a variation of the native binary +class fast_binary_iarchive : + // don't derive from binary_oarchive !!! + public binary_iarchive_impl< + fast_binary_iarchive, + std::istream::char_type, + std::istream::traits_type + > +{ + typedef fast_binary_iarchive derived_t; + typedef binary_iarchive_impl< + fast_binary_iarchive, + std::istream::char_type, + std::istream::traits_type + > base_t; +#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS +public: +#else + friend class boost::archive::detail::interface_iarchive; + friend class basic_binary_iarchive; + friend class basic_binary_iprimitive< + derived_t, + std::ostream::char_type, + std::ostream::traits_type + >; + friend class boost::archive::load_access; +#endif + // add base class to the places considered when matching + // save function to a specific set of arguments. Note, this didn't + // work on my MSVC 7.0 system using + // binary_oarchive_impl::load_override; + // so we use the sure-fire method below. This failed to work as well + template + void load_override(T & t, BOOST_PFTO int){ + base_t::load_override(t, 0); + BOOST_STATIC_ASSERT(! (boost::is_array::value) ); + } + template + void load_override(int (& t)[N], int){ + load_binary(t, sizeof(t)); + } + template + void load_override(unsigned int (& t)[N], int){ + load_binary(t, sizeof(t)); + } + template + void load_override(long (& t)[N], int){ + load_binary(t, sizeof(t)); + } + template + void load_override(unsigned long (& t)[N], int){ + load_binary(t, sizeof(t)); + } +public: + fast_binary_iarchive(std::istream & is, unsigned int flags = 0) : + base_t(is, flags) + {} + fast_binary_iarchive(std::streambuf & bsb, unsigned int flags = 0) : + base_t(bsb, flags) + {} +}; + +// required by export +BOOST_SERIALIZATION_REGISTER_ARCHIVE(fast_binary_iarchive) + +int main( int argc, char* argv[] ) +{ + const int a[3] = {1, 2, 3}; + int a1[3] = {4, 5, 6}; + + std::stringstream ss; + { + fast_binary_oarchive pboa(ss); + pboa << a; + } + { + fast_binary_iarchive pbia(ss); + pbia >> a1; + } + return (a[0] != a1[0]) || (a[1] != a1[1]) || (a[2] != a1[2]); +} + + diff --git a/deal.II/contrib/boost/libs/serialization/example/demo_gps.hpp b/deal.II/contrib/boost/libs/serialization/example/demo_gps.hpp new file mode 100644 index 0000000000..1830db3b8b --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/example/demo_gps.hpp @@ -0,0 +1,284 @@ +#ifndef BOOST_SERIALIZATION_EXAMPLE_DEMO_GPS_HPP +#define BOOST_SERIALIZATION_EXAMPLE_DEMO_GPS_HPP + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// +// demo_gps.hpp +// +// (C) Copyright 2002-4 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) + +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +// This illustration models the bus system of a small city. +// This includes, multiple bus stops, bus routes and schedules. +// There are different kinds of stops. Bus stops in general will +// will appear on multiple routes. A schedule will include +// muliple trips on the same route. + +///////////////////////////////////////////////////////////// +// gps coordinate +// +// llustrates serialization for a simple type +// +class gps_position +{ + friend class boost::serialization::access; + friend std::ostream & operator<<(std::ostream &os, const gps_position &gp); + + int degrees; + int minutes; + float seconds; + + template + void serialize(Archive & ar, const unsigned int /* file_version */){ + ar & BOOST_SERIALIZATION_NVP(degrees) + & BOOST_SERIALIZATION_NVP(minutes) + & BOOST_SERIALIZATION_NVP(seconds); + } + +public: + // every serializable class needs a constructor + gps_position(){}; + gps_position(int _d, int _m, float _s) : + degrees(_d), minutes(_m), seconds(_s) + {} +}; + +std::ostream & operator<<(std::ostream &os, const gps_position &gp) +{ + return os << ' ' << gp.degrees << (unsigned char)186 << gp.minutes << '\'' << gp.seconds << '"'; +} + +///////////////////////////////////////////////////////////// +// One bus stop +// +// illustrates serialization of serializable members +// + +class bus_stop +{ + friend class boost::serialization::access; + virtual std::string description() const = 0; + gps_position latitude; + gps_position longitude; + + template + void serialize(Archive &ar, const unsigned int version) + { + ar & BOOST_SERIALIZATION_NVP(latitude); + ar & BOOST_SERIALIZATION_NVP(longitude); + } + +protected: + bus_stop(const gps_position & _lat, const gps_position & _long) : + latitude(_lat), longitude(_long) + {} +public: + bus_stop(){} + friend std::ostream & operator<<(std::ostream &os, const bus_stop &gp); + virtual ~bus_stop(){} +}; + +BOOST_SERIALIZATION_ASSUME_ABSTRACT(bus_stop) + +std::ostream & operator<<(std::ostream &os, const bus_stop &bs) +{ + return os << bs.latitude << bs.longitude << ' ' << bs.description(); +} + +///////////////////////////////////////////////////////////// +// Several kinds of bus stops +// +// illustrates serialization of derived types +// +class bus_stop_corner : public bus_stop +{ + friend class boost::serialization::access; + std::string street1; + std::string street2; + virtual std::string description() const + { + return street1 + " and " + street2; + } + template + void serialize(Archive &ar, const unsigned int version) + { + // save/load base class information + ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(bus_stop); + ar & BOOST_SERIALIZATION_NVP(street1); + ar & BOOST_SERIALIZATION_NVP(street2); + } +public: + bus_stop_corner(){} + bus_stop_corner(const gps_position & _lat, const gps_position & _long, + const std::string & _s1, const std::string & _s2 + ) : + bus_stop(_lat, _long), street1(_s1), street2(_s2) + { + } +}; + +class bus_stop_destination : public bus_stop +{ + friend class boost::serialization::access; + std::string name; + virtual std::string description() const + { + return name; + } + template + void serialize(Archive &ar, const unsigned int version) + { + ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(bus_stop) + & BOOST_SERIALIZATION_NVP(name); + } +public: + bus_stop_destination(){} + bus_stop_destination( + const gps_position & _lat, const gps_position & _long, const std::string & _name + ) : + bus_stop(_lat, _long), name(_name) + { + } +}; + +///////////////////////////////////////////////////////////// +// a bus route is a collection of bus stops +// +// illustrates serialization of STL collection templates. +// +// illustrates serialzation of polymorphic pointer (bus stop *); +// +// illustrates storage and recovery of shared pointers is correct +// and efficient. That is objects pointed to by more than one +// pointer are stored only once. In such cases only one such +// object is restored and pointers are restored to point to it +// +class bus_route +{ + friend class boost::serialization::access; + friend std::ostream & operator<<(std::ostream &os, const bus_route &br); + typedef bus_stop * bus_stop_pointer; + std::list stops; + template + void serialize(Archive &ar, const unsigned int version) + { + // in this program, these classes are never serialized directly but rather + // through a pointer to the base class bus_stop. So we need a way to be + // sure that the archive contains information about these derived classes. + //ar.template register_type(); + ar.register_type(static_cast(NULL)); + //ar.template register_type(); + ar.register_type(static_cast(NULL)); + // serialization of stl collections is already defined + // in the header + ar & BOOST_SERIALIZATION_NVP(stops); + } +public: + bus_route(){} + void append(bus_stop *_bs) + { + stops.insert(stops.end(), _bs); + } +}; +std::ostream & operator<<(std::ostream &os, const bus_route &br) +{ + std::list::const_iterator it; + // note: we're displaying the pointer to permit verification + // that duplicated pointers are properly restored. + for(it = br.stops.begin(); it != br.stops.end(); it++){ + os << '\n' << std::hex << "0x" << *it << std::dec << ' ' << **it; + } + return os; +} + +///////////////////////////////////////////////////////////// +// a bus schedule is a collection of routes each with a starting time +// +// Illustrates serialization of STL objects(pair) in a non-intrusive way. +// See definition of operator<< >(ar, pair) +// +// illustrates nesting of serializable classes +// +// illustrates use of version number to automatically grandfather older +// versions of the same class. + +class bus_schedule +{ + friend class boost::serialization::access; + friend std::ostream & operator<<(std::ostream &os, const bus_schedule &bs); + template + void serialize(Archive &ar, const unsigned int version) + { + ar & BOOST_SERIALIZATION_NVP(schedule); + } + // note: this structure was made public. because the friend declarations + // didn't seem to work as expected. +public: + struct trip_info + { + template + void serialize(Archive &ar, const unsigned int file_version) + { + // in versions 2 or later + if(file_version >= 2) + // read the drivers name + ar & BOOST_SERIALIZATION_NVP(driver); + // all versions have the follwing info + ar & BOOST_SERIALIZATION_NVP(hour) + & BOOST_SERIALIZATION_NVP(minute); + } + + // starting time + int hour; + int minute; + // only after system shipped was the driver's name added to the class + std::string driver; + + trip_info(){} + trip_info(int _h, int _m, const std::string &_d) : + hour(_h), minute(_m), driver(_d) + {} + ~trip_info(){ + } + }; +// friend std::ostream & operator<<(std::ostream &os, const trip_info &ti); +private: + std::list > schedule; +public: + void append(const std::string &_d, int _h, int _m, bus_route *_br) + { + schedule.insert(schedule.end(), std::make_pair(trip_info(_h, _m, _d), _br)); + } + bus_schedule(){} +}; + +BOOST_CLASS_VERSION(bus_schedule::trip_info, 3) +BOOST_CLASS_VERSION(bus_schedule, 2) + +std::ostream & operator<<(std::ostream &os, const bus_schedule::trip_info &ti) +{ + return os << '\n' << ti.hour << ':' << ti.minute << ' ' << ti.driver << ' '; +} +std::ostream & operator<<(std::ostream &os, const bus_schedule &bs) +{ + std::list >::const_iterator it; + for(it = bs.schedule.begin(); it != bs.schedule.end(); it++){ + os << it->first << *(it->second); + } + return os; +} + +#endif // BOOST_SERIALIZATION_EXAMPLE_DEMO_GPS_HPP diff --git a/deal.II/contrib/boost/libs/serialization/example/demo_log.cpp b/deal.II/contrib/boost/libs/serialization/example/demo_log.cpp new file mode 100644 index 0000000000..55fc53513e --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/example/demo_log.cpp @@ -0,0 +1,76 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// +// demo_log.cpp +// +// (C) Copyright 2009 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) + +#include +#include + +#include "demo_gps.hpp" +#include "log_archive.hpp" + +int main(int argc, char *argv[]) +{ + // make the schedule + bus_schedule schedule; + + // fill in the data + // make a few stops + bus_stop *bs0 = new bus_stop_corner( + gps_position(34, 135, 52.560f), + gps_position(134, 22, 78.30f), + "24th Street", "10th Avenue" + ); + bus_stop *bs1 = new bus_stop_corner( + gps_position(35, 137, 23.456f), + gps_position(133, 35, 54.12f), + "State street", "Cathedral Vista Lane" + ); + bus_stop *bs2 = new bus_stop_destination( + gps_position(35, 136, 15.456f), + gps_position(133, 32, 15.300f), + "White House" + ); + bus_stop *bs3 = new bus_stop_destination( + gps_position(35, 134, 48.789f), + gps_position(133, 32, 16.230f), + "Lincoln Memorial" + ); + + // make a routes + bus_route route0; + route0.append(bs0); + route0.append(bs1); + route0.append(bs2); + + // add trips to schedule + schedule.append("bob", 6, 24, &route0); + schedule.append("bob", 9, 57, &route0); + schedule.append("alice", 11, 02, &route0); + + // make aother routes + bus_route route1; + route1.append(bs3); + route1.append(bs2); + route1.append(bs1); + + // add trips to schedule + schedule.append("ted", 7, 17, &route1); + schedule.append("ted", 9, 38, &route1); + schedule.append("alice", 11, 47, &route1); + + // display the complete schedule + log_archive oa(std::cout); + //oa << BOOST_SERIALIZATION_NVP(schedule); + oa << schedule; + + delete bs0; + delete bs1; + delete bs2; + delete bs3; + return 0; +} diff --git a/deal.II/contrib/boost/libs/serialization/example/demo_output.txt b/deal.II/contrib/boost/libs/serialization/example/demo_output.txt new file mode 100644 index 0000000000..306bdbdc2a --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/example/demo_output.txt @@ -0,0 +1,51 @@ +original schedule +6:24 bob +0x003265C8 34º135'52.56" 134º22'78.3" 24th Street and 10th Avenue +0x00326648 35º137'23.456" 133º35'54.12" State street and Cathedral Vista Lane +0x00326768 35º136'15.456" 133º32'15.3" White House +9:57 bob +0x003265C8 34º135'52.56" 134º22'78.3" 24th Street and 10th Avenue +0x00326648 35º137'23.456" 133º35'54.12" State street and Cathedral Vista Lane +0x00326768 35º136'15.456" 133º32'15.3" White House +11:2 alice +0x003265C8 34º135'52.56" 134º22'78.3" 24th Street and 10th Avenue +0x00326648 35º137'23.456" 133º35'54.12" State street and Cathedral Vista Lane +0x00326768 35º136'15.456" 133º32'15.3" White House +7:17 ted +0x003267D0 35º134'48.789" 133º32'16.23" Lincoln Memorial +0x00326768 35º136'15.456" 133º32'15.3" White House +0x00326648 35º137'23.456" 133º35'54.12" State street and Cathedral Vista Lane +9:38 ted +0x003267D0 35º134'48.789" 133º32'16.23" Lincoln Memorial +0x00326768 35º136'15.456" 133º32'15.3" White House +0x00326648 35º137'23.456" 133º35'54.12" State street and Cathedral Vista Lane +11:47 alice +0x003267D0 35º134'48.789" 133º32'16.23" Lincoln Memorial +0x00326768 35º136'15.456" 133º32'15.3" White House +0x00326648 35º137'23.456" 133º35'54.12" State street and Cathedral Vista Lane +restored schedule +6:24 +0x0032A2F8 34º135'52.56" 134º22'78.3" 24th Street and 10th Avenue +0x0032A508 35º137'23.456" 133º35'54.12" State street and Cathedral Vista Lane +0x0032A628 35º136'15.456" 133º32'15.3" White House +9:57 +0x0032A2F8 34º135'52.56" 134º22'78.3" 24th Street and 10th Avenue +0x0032A508 35º137'23.456" 133º35'54.12" State street and Cathedral Vista Lane +0x0032A628 35º136'15.456" 133º32'15.3" White House +11:2 +0x0032A2F8 34º135'52.56" 134º22'78.3" 24th Street and 10th Avenue +0x0032A508 35º137'23.456" 133º35'54.12" State street and Cathedral Vista Lane +0x0032A628 35º136'15.456" 133º32'15.3" White House +7:17 +0x0032A8C0 35º134'48.789" 133º32'16.23" Lincoln Memorial +0x0032A628 35º136'15.456" 133º32'15.3" White House +0x0032A508 35º137'23.456" 133º35'54.12" State street and Cathedral Vista Lane +9:38 +0x0032A8C0 35º134'48.789" 133º32'16.23" Lincoln Memorial +0x0032A628 35º136'15.456" 133º32'15.3" White House +0x0032A508 35º137'23.456" 133º35'54.12" State street and Cathedral Vista Lane +11:47 +0x0032A8C0 35º134'48.789" 133º32'16.23" Lincoln Memorial +0x0032A628 35º136'15.456" 133º32'15.3" White House +0x0032A508 35º137'23.456" 133º35'54.12" State street and Cathedral Vista Lane +*** No errors detected diff --git a/deal.II/contrib/boost/libs/serialization/example/demo_pimpl.cpp b/deal.II/contrib/boost/libs/serialization/example/demo_pimpl.cpp new file mode 100644 index 0000000000..2d5446d3ae --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/example/demo_pimpl.cpp @@ -0,0 +1,34 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// demo_pimpl.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) + +// should pass compilation and execution + +#include + +#include +#include + +#include "demo_pimpl_A.hpp" + +int main(int argc, char* argv[]) +{ + std::stringstream ss; + + const A a; + { + boost::archive::text_oarchive oa(ss); + oa << a; + } + A a1; + { + boost::archive::text_iarchive ia(ss); + ia >> a1; + } + return 0; +} + diff --git a/deal.II/contrib/boost/libs/serialization/example/demo_pimpl_A.cpp b/deal.II/contrib/boost/libs/serialization/example/demo_pimpl_A.cpp new file mode 100644 index 0000000000..455b71ece3 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/example/demo_pimpl_A.cpp @@ -0,0 +1,45 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// demo_pimpl_A.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) + +#include +#include + +#include "demo_pimpl_A.hpp" + +// "hidden" definition of class B +struct B { + int b; + template + void serialize(Archive & ar, const unsigned int /* file_version */){ + ar & b; + } +}; + +A::A() : + pimpl(new B) +{} +A::~A(){ + delete pimpl; +} +// now we can define the serialization for class A +template +void A::serialize(Archive & ar, const unsigned int /* file_version */){ + ar & pimpl; +} + +// without the explicit instantiations below, the program will +// fail to link for lack of instantiantiation of the above function +// note: the following failed to fix link errors for vc 7.0 ! +template void A::serialize( + boost::archive::text_iarchive & ar, + const unsigned int file_version +); +template void A::serialize( + boost::archive::text_oarchive & ar, + const unsigned int file_version +); diff --git a/deal.II/contrib/boost/libs/serialization/example/demo_pimpl_A.hpp b/deal.II/contrib/boost/libs/serialization/example/demo_pimpl_A.hpp new file mode 100644 index 0000000000..8697de8d1d --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/example/demo_pimpl_A.hpp @@ -0,0 +1,24 @@ +#ifndef BOOST_SERIALIZATION_EXAMPLE_DEMO_PIMPL_A_HPP +#define BOOST_SERIALIZATION_EXAMPLE_DEMO_PIMPL_A_HPP + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// demo_pimpl_A.hpp + +// (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) + +// class whose declaration is hidden by a pointer +struct B; + +struct A { + // class a contains a pointer to a "hidden" declaration + B *pimpl; + template + void serialize(Archive & ar, const unsigned int file_version); + A(); + ~A(); +}; + +#endif // BOOST_SERIALIZATION_EXAMPLE_DEMO_PIMPL_A_HPP diff --git a/deal.II/contrib/boost/libs/serialization/example/demo_polymorphic.cpp b/deal.II/contrib/boost/libs/serialization/example/demo_polymorphic.cpp new file mode 100644 index 0000000000..3c91745a8d --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/example/demo_polymorphic.cpp @@ -0,0 +1,65 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// demo_polymorphic.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) + +// should pass compilation and execution + +#include + +#include +#include + +#include +#include + +#include "demo_polymorphic_A.hpp" + +int main(int argc, char* argv[]) +{ + const A a; + A a1; + { + // test with a text archive + std::stringstream ss; + { + // instantiate archive which inhertis polymorphic interface + // and the normal text archive implementation + boost::archive::polymorphic_text_oarchive oa(ss); + boost::archive::polymorphic_oarchive & oa_interface = oa; + // we can just just the interface for saving + oa_interface << a; + } + { + // or we can use the implementation directly + boost::archive::polymorphic_text_iarchive ia(ss); + ia >> a1; + } + } + if(! (a == a1)) + return 1; + { + //test with a binary archive + std::stringstream ss; + { + // instantiate archive which inhertis polymorphic interface + // and the normal binary archive implementation + boost::archive::polymorphic_binary_oarchive oa(ss); + oa << a; + } + { + // see above + boost::archive::polymorphic_binary_iarchive ia(ss); + boost::archive::polymorphic_iarchive & ia_interface = ia; + // use just the polymorphic interface for loading. + ia_interface >> a1; + } + } + if(! (a == a1)) + return 1; + return 0; +} + diff --git a/deal.II/contrib/boost/libs/serialization/example/demo_polymorphic_A.cpp b/deal.II/contrib/boost/libs/serialization/example/demo_polymorphic_A.cpp new file mode 100644 index 0000000000..c32d4a13f2 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/example/demo_polymorphic_A.cpp @@ -0,0 +1,26 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// demo_polymorphic_A.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) + + +#include +#include + +#include "demo_polymorphic_A.hpp" + +// explicitly instantiate templates for polymorphic archives +// used by this demo. +template +void A::serialize( + boost::archive::polymorphic_iarchive &, + const unsigned int +); +template +void A::serialize( + boost::archive::polymorphic_oarchive &, + const unsigned int +); diff --git a/deal.II/contrib/boost/libs/serialization/example/demo_polymorphic_A.hpp b/deal.II/contrib/boost/libs/serialization/example/demo_polymorphic_A.hpp new file mode 100644 index 0000000000..17f9758fb7 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/example/demo_polymorphic_A.hpp @@ -0,0 +1,39 @@ +#ifndef BOOST_SERIALIZATION_EXAMPLE_DEMO_POLYMORPHIC_A_HPP +#define BOOST_SERIALIZATION_EXAMPLE_DEMO_POLYMORPHIC_A_HPP + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// demo_polymorphic_A.hpp + +// (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) + +namespace boost { +namespace archive { + +class polymorphic_iarchive; +class polymorphic_oarchive; + +} // namespace archive +} // namespace boost + +struct A { + // class a contains a pointer to a "hidden" declaration + template + void serialize( + Archive & ar, + const unsigned int file_version + ){ + ar & data; + } + int data; + bool operator==(const A & rhs) const { + return data == rhs.data; + } + A() : + data(0) + {} +}; + +#endif // BOOST_SERIALIZATION_EXAMPLE_DEMO_POLYMORPHIC_A_HPP diff --git a/deal.II/contrib/boost/libs/serialization/example/demo_portable_archive.cpp b/deal.II/contrib/boost/libs/serialization/example/demo_portable_archive.cpp new file mode 100644 index 0000000000..2149585db0 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/example/demo_portable_archive.cpp @@ -0,0 +1,102 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// +// demo_portable_archive.cpp +// +// (C) Copyright 2002-4 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) + +// should pass compilation and execution + +// note:: this example can only be built with the static library +// (at least with MSVC - due to conflicts related to import of library +// code and instantiation of templates. +#include + +#include "portable_binary_oarchive.hpp" +#include "portable_binary_iarchive.hpp" + +#include +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ using ::rand; } +#endif + +class A +{ + friend class boost::serialization::access; + char c; + int i; + int i2; // special tricky case to check sign extension + unsigned int ui; + long l; + unsigned long ul; + template + void serialize(Archive & ar, const unsigned int /* version */){ + ar & c & i & i2 & ui & l & ul ; + } +public: + bool operator==(const A & rhs) const { + return + c == rhs.c + && i == rhs.i + && i2 == rhs.i2 + && ui == rhs.ui + && l == rhs.l + && ul == rhs.ul + ; + } + A() : + c(0xFF & std::rand()), + i(std::rand()), + i2(0x80), + ui(std::rand()), + l(std::rand() * std::rand()), + ul(std::rand()) + {} +}; + +int main( int /* argc */, char* /* argv */[] ) +{ + const A a; + A a1; + + std::stringstream ss; + { + portable_binary_oarchive pboa(ss); + pboa << a; + } + { + portable_binary_iarchive pbia(ss); + pbia >> a1; + } + if(! (a == a1)) + return 1; + + ss.clear(); + { + portable_binary_oarchive pboa(ss, endian_big); + pboa << a; + } + { + portable_binary_iarchive pbia(ss, endian_big); + pbia >> a1; + } + if(! (a == a1)) + return 1; + + ss.clear(); + { + portable_binary_oarchive pboa(ss, endian_big); + pboa << a; + } + { + portable_binary_iarchive pbia(ss, endian_big); + pbia >> a1; + } + + return !(a == a1); +} + + diff --git a/deal.II/contrib/boost/libs/serialization/example/demo_save.xml b/deal.II/contrib/boost/libs/serialization/example/demo_save.xml new file mode 100644 index 0000000000..c5a28c8eb2 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/example/demo_save.xml @@ -0,0 +1,129 @@ + + + + + + 6 + + + bob + 6 + 24 + + + + 3 + + + + 34 + 135 + 52.560001 + + + 134 + 22 + 78.300003 + + + 24th Street + 10th Avenue + + + + + 35 + 137 + 23.455999 + + + 133 + 35 + 54.119999 + + + State street + Cathedral Vista Lane + + + + + 35 + 136 + 15.456 + + + 133 + 32 + 15.3 + + + White House + + + + + + + bob + 9 + 57 + + + + + + alice + 11 + 2 + + + + + + ted + 7 + 17 + + + + 3 + + + + 35 + 134 + 48.789001 + + + 133 + 32 + 16.23 + + + Lincoln Memorial + + + + + + + + + ted + 9 + 38 + + + + + + alice + 11 + 47 + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/example/demo_shared_ptr.cpp b/deal.II/contrib/boost/libs/serialization/example/demo_shared_ptr.cpp new file mode 100644 index 0000000000..c464516990 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/example/demo_shared_ptr.cpp @@ -0,0 +1,164 @@ +// demo_shared_ptr.cpp : demonstrates adding serialization to a template + +// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . Polymorphic +// derived pointer example by David Tonge. + +// 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 +#include +#include // NULL +#include +#include + +#include // remove +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::remove; +} +#endif + +#include +#include +#include + +#include + +/////////////////////////// +// test shared_ptr serialization +class A +{ +private: + friend class boost::serialization::access; + int x; + template + void serialize(Archive & ar, const unsigned int /* file_version */){ + ar & x; + } +public: + static int count; + A(){++count;} // default constructor + virtual ~A(){--count;} // default destructor +}; + +BOOST_SERIALIZATION_SHARED_PTR(A) + +///////////////// +// ADDITION BY DT +class B : public A +{ +private: + friend class boost::serialization::access; + int x; + template + void serialize(Archive & ar, const unsigned int /* file_version */){ + ar & boost::serialization::base_object(*this); + } +public: + static int count; + B() : A() {}; + virtual ~B() {}; +}; + +BOOST_SERIALIZATION_SHARED_PTR(B) + +///////////////// + +int A::count = 0; + +void display(boost::shared_ptr &spa, boost::shared_ptr &spa1) +{ + std::cout << "a = 0x" << std::hex << spa.get() << " "; + if (spa.get()) std::cout << "is a " << typeid(*(spa.get())).name() << "* "; + std::cout << "use count = " << std::dec << spa.use_count() << std::endl; + std::cout << "a1 = 0x" << std::hex << spa1.get() << " "; + if (spa1.get()) std::cout << "is a " << typeid(*(spa1.get())).name() << "* "; + std::cout << "use count = " << std::dec << spa1.use_count() << std::endl; + std::cout << "unique element count = " << A::count << std::endl; +} + +int main(int /* argc */, char /* *argv[] */) +{ + std::string filename(boost::archive::tmpdir()); + filename += "/testfile"; + + // create a new shared pointer to ta new object of type A + boost::shared_ptr spa(new A); + boost::shared_ptr spa1; + spa1 = spa; + display(spa, spa1); + // serialize it + { + std::ofstream ofs(filename.c_str()); + boost::archive::text_oarchive oa(ofs); + oa << spa; + oa << spa1; + } + // reset the shared pointer to NULL + // thereby destroying the object of type A + spa.reset(); + spa1.reset(); + display(spa, spa1); + // restore state to one equivalent to the original + // creating a new type A object + { + // open the archive + std::ifstream ifs(filename.c_str()); + boost::archive::text_iarchive ia(ifs); + + // restore the schedule from the archive + ia >> spa; + ia >> spa1; + } + display(spa, spa1); + spa.reset(); + spa1.reset(); + + std::cout << std::endl; + std::cout << std::endl; + std::cout << "New tests" << std::endl; + + ///////////////// + // ADDITION BY DT + // create a new shared pointer to ta new object of type A + spa = boost::shared_ptr(new B); + spa1 = spa; + display(spa, spa1); + // serialize it + { + std::ofstream ofs(filename.c_str()); + boost::archive::text_oarchive oa(ofs); + oa.register_type(static_cast(NULL)); + oa << spa; + oa << spa1; + } + // reset the shared pointer to NULL + // thereby destroying the object of type B + spa.reset(); + spa1.reset(); + display(spa, spa1); + // restore state to one equivalent to the original + // creating a new type B object + { + // open the archive + std::ifstream ifs(filename.c_str()); + boost::archive::text_iarchive ia(ifs); + + // restore the schedule from the archive + ia.register_type(static_cast(NULL)); + ia >> spa; + ia >> spa1; + } + display(spa, spa1); + /////////////// + std::remove(filename.c_str()); + + // obj of type A gets destroyed + // as smart_ptr goes out of scope + return 0; +} diff --git a/deal.II/contrib/boost/libs/serialization/example/demo_simple_log.cpp b/deal.II/contrib/boost/libs/serialization/example/demo_simple_log.cpp new file mode 100644 index 0000000000..da80b5a5a6 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/example/demo_simple_log.cpp @@ -0,0 +1,75 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// +// demo_log.cpp +// +// (C) Copyright 2009 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) + +#include +#include + +#include "demo_gps.hpp" +#include "simple_log_archive.hpp" + +int main(int argc, char *argv[]) +{ + // make the schedule + bus_schedule schedule; + + // fill in the data + // make a few stops + bus_stop *bs0 = new bus_stop_corner( + gps_position(34, 135, 52.560f), + gps_position(134, 22, 78.30f), + "24th Street", "10th Avenue" + ); + bus_stop *bs1 = new bus_stop_corner( + gps_position(35, 137, 23.456f), + gps_position(133, 35, 54.12f), + "State street", "Cathedral Vista Lane" + ); + bus_stop *bs2 = new bus_stop_destination( + gps_position(35, 136, 15.456f), + gps_position(133, 32, 15.300f), + "White House" + ); + bus_stop *bs3 = new bus_stop_destination( + gps_position(35, 134, 48.789f), + gps_position(133, 32, 16.230f), + "Lincoln Memorial" + ); + + // make a routes + bus_route route0; + route0.append(bs0); + route0.append(bs1); + route0.append(bs2); + + // add trips to schedule + schedule.append("bob", 6, 24, &route0); + schedule.append("bob", 9, 57, &route0); + schedule.append("alice", 11, 02, &route0); + + // make aother routes + bus_route route1; + route1.append(bs3); + route1.append(bs2); + route1.append(bs1); + + // add trips to schedule + schedule.append("ted", 7, 17, &route1); + schedule.append("ted", 9, 38, &route1); + schedule.append("alice", 11, 47, &route1); + + // display the complete schedule + simple_log_archive log(std::cout); + log << schedule; + + delete bs0; + delete bs1; + delete bs2; + delete bs3; + return 0; +} diff --git a/deal.II/contrib/boost/libs/serialization/example/demo_trivial_archive.cpp b/deal.II/contrib/boost/libs/serialization/example/demo_trivial_archive.cpp new file mode 100644 index 0000000000..a71383213b --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/example/demo_trivial_archive.cpp @@ -0,0 +1,94 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// +// demo_trivial_archive.cpp +// +// (C) Copyright 2009 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) + +#include // std::size_t +#include + +///////////////////////////////////////////////////////////////////////// +// class trivial_oarchive +class trivial_oarchive { + +public: + ////////////////////////////////////////////////////////// + // public interface used by programs that use the + // serialization library + typedef boost::mpl::bool_ is_saving; + typedef boost::mpl::bool_ is_loading; + template register_type(){} + template trivial_oarchive & operator<<(const T & t){ + return *this; + } + template trivial_oarchive & operator&(const T & t){ + return *this << t; + } + void save_binary(void *address, std::size_t count){}; +}; + +#include "demo_gps.hpp" + +int main(int argc, char *argv[]) +{ + // make the schedule + bus_schedule schedule; + + // fill in the data + // make a few stops + bus_stop *bs0 = new bus_stop_corner( + gps_position(34, 135, 52.560f), + gps_position(134, 22, 78.30f), + "24th Street", "10th Avenue" + ); + bus_stop *bs1 = new bus_stop_corner( + gps_position(35, 137, 23.456f), + gps_position(133, 35, 54.12f), + "State street", "Cathedral Vista Lane" + ); + bus_stop *bs2 = new bus_stop_destination( + gps_position(35, 136, 15.456f), + gps_position(133, 32, 15.300f), + "White House" + ); + bus_stop *bs3 = new bus_stop_destination( + gps_position(35, 134, 48.789f), + gps_position(133, 32, 16.230f), + "Lincoln Memorial" + ); + + // make a routes + bus_route route0; + route0.append(bs0); + route0.append(bs1); + route0.append(bs2); + + // add trips to schedule + schedule.append("bob", 6, 24, &route0); + schedule.append("bob", 9, 57, &route0); + schedule.append("alice", 11, 02, &route0); + + // make aother routes + bus_route route1; + route1.append(bs3); + route1.append(bs2); + route1.append(bs1); + + // add trips to schedule + schedule.append("ted", 7, 17, &route1); + schedule.append("ted", 9, 38, &route1); + schedule.append("alice", 11, 47, &route1); + + // display the complete schedule + trivial_oarchive ta; + ta << schedule; + + delete bs0; + delete bs1; + delete bs2; + delete bs3; + return 0; +} diff --git a/deal.II/contrib/boost/libs/serialization/example/demo_xml.cpp b/deal.II/contrib/boost/libs/serialization/example/demo_xml.cpp new file mode 100644 index 0000000000..c9524aefa0 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/example/demo_xml.cpp @@ -0,0 +1,127 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// +// demo_xml.cpp +// +// (C) Copyright 2002-4 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) + +#include +#include +#include +#include + +#include // remove +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::remove; +} +#endif + +#include +#include +#include + +#include "demo_gps.hpp" + +void save_schedule(const bus_schedule &s, const char * filename){ + // make an archive + std::ofstream ofs(filename); + assert(ofs.good()); + boost::archive::xml_oarchive oa(ofs); + oa << BOOST_SERIALIZATION_NVP(s); +} + +void +restore_schedule(bus_schedule &s, const char * filename) +{ + // open the archive + std::ifstream ifs(filename); + assert(ifs.good()); + boost::archive::xml_iarchive ia(ifs); + + // restore the schedule from the archive + ia >> BOOST_SERIALIZATION_NVP(s); +} + +int main(int argc, char *argv[]) +{ + // make the schedule + bus_schedule original_schedule; + + // fill in the data + // make a few stops + bus_stop *bs0 = new bus_stop_corner( + gps_position(34, 135, 52.560f), + gps_position(134, 22, 78.30f), + "24th Street", "10th Avenue" + ); + bus_stop *bs1 = new bus_stop_corner( + gps_position(35, 137, 23.456f), + gps_position(133, 35, 54.12f), + "State street", "Cathedral Vista Lane" + ); + bus_stop *bs2 = new bus_stop_destination( + gps_position(35, 136, 15.456f), + gps_position(133, 32, 15.300f), + "White House" + ); + bus_stop *bs3 = new bus_stop_destination( + gps_position(35, 134, 48.789f), + gps_position(133, 32, 16.230f), + "Lincoln Memorial" + ); + + // make a routes + bus_route route0; + route0.append(bs0); + route0.append(bs1); + route0.append(bs2); + + // add trips to schedule + original_schedule.append("bob", 6, 24, &route0); + original_schedule.append("bob", 9, 57, &route0); + original_schedule.append("alice", 11, 02, &route0); + + // make aother routes + bus_route route1; + route1.append(bs3); + route1.append(bs2); + route1.append(bs1); + + // add trips to schedule + original_schedule.append("ted", 7, 17, &route1); + original_schedule.append("ted", 9, 38, &route1); + original_schedule.append("alice", 11, 47, &route1); + + // display the complete schedule + std::cout << "original schedule"; + std::cout << original_schedule; + + std::string filename(boost::archive::tmpdir()); + filename += "/demo.xml"; + + // save the schedule + save_schedule(original_schedule, filename.c_str()); + + // ... some time later + // make a new schedule + bus_schedule new_schedule; + + restore_schedule(new_schedule, filename.c_str()); + + // and display + std::cout << "\nrestored schedule"; + std::cout << new_schedule; + // should be the same as the old one. (except for the pointer values) + + std::remove(filename.c_str()); + + delete bs0; + delete bs1; + delete bs2; + delete bs3; + return 0; +} diff --git a/deal.II/contrib/boost/libs/serialization/example/demo_xml.hpp b/deal.II/contrib/boost/libs/serialization/example/demo_xml.hpp new file mode 100644 index 0000000000..408412a1ea --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/example/demo_xml.hpp @@ -0,0 +1,284 @@ +#ifndef BOOST_SERIALIZATION_EXAMPLE_DEMO_XML_HPP +#define BOOST_SERIALIZATION_EXAMPLE_DEMO_XML_HPP + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// +// demo_xml.hpp +// +// (C) Copyright 2002-4 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) + + +#include +#include +#include +#include + +#include +#include +#include +#include + +// This illustration models the bus system of a small city. +// This includes, multiple bus stops, bus routes and schedules. +// There are different kinds of stops. Bus stops in general will +// will appear on multiple routes. A schedule will include +// muliple trips on the same route. + +///////////////////////////////////////////////////////////// +// gps coordinate +// +// llustrates serialization for a simple type +// +class gps_position +{ + friend class boost::serialization::access; + friend std::ostream & operator<<(std::ostream &os, const gps_position &gp); + + int degrees; + int minutes; + float seconds; + + template + void serialize(Archive & ar, const unsigned int /* file_version */){ + ar & BOOST_SERIALIZATION_NVP(degrees) + & BOOST_SERIALIZATION_NVP(minutes) + & BOOST_SERIALIZATION_NVP(seconds); + } + +public: + // every serializable class needs a constructor + gps_position(){}; + gps_position(int _d, int _m, float _s) : + degrees(_d), minutes(_m), seconds(_s) + {} +}; + +std::ostream & operator<<(std::ostream &os, const gps_position &gp) +{ + return os << ' ' << gp.degrees << (unsigned char)186 << gp.minutes << '\'' << gp.seconds << '"'; +} + +///////////////////////////////////////////////////////////// +// One bus stop +// +// illustrates serialization of serializable members +// + +class bus_stop +{ + friend class boost::serialization::access; + virtual std::string description() const = 0; + gps_position latitude; + gps_position longitude; + + template + void serialize(Archive &ar, const unsigned int version) + { + ar & BOOST_SERIALIZATION_NVP(latitude); + ar & BOOST_SERIALIZATION_NVP(longitude); + } + +protected: + bus_stop(const gps_position & _lat, const gps_position & _long) : + latitude(_lat), longitude(_long) + {} +public: + bus_stop(){} + friend std::ostream & operator<<(std::ostream &os, const bus_stop &gp); + virtual ~bus_stop(){} +}; + +BOOST_IS_ABSTRACT(bus_stop) + +std::ostream & operator<<(std::ostream &os, const bus_stop &bs) +{ + return os << bs.latitude << bs.longitude << ' ' << bs.description(); +} + +///////////////////////////////////////////////////////////// +// Several kinds of bus stops +// +// illustrates serialization of derived types +// +class bus_stop_corner : public bus_stop +{ + friend class boost::serialization::access; + std::string street1; + std::string street2; + virtual std::string description() const + { + return street1 + " and " + street2; + } + template + void serialize(Archive &ar, const unsigned int version) + { + // save/load base class information + ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(bus_stop); + ar & BOOST_SERIALIZATION_NVP(street1); + ar & BOOST_SERIALIZATION_NVP(street2); + } +public: + bus_stop_corner(){} + bus_stop_corner(const gps_position & _lat, const gps_position & _long, + const std::string & _s1, const std::string & _s2 + ) : + bus_stop(_lat, _long), street1(_s1), street2(_s2) + { + } +}; + +class bus_stop_destination : public bus_stop +{ + friend class boost::serialization::access; + std::string name; + virtual std::string description() const + { + return name; + } + template + void serialize(Archive &ar, const unsigned int version) + { + ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(bus_stop) + & BOOST_SERIALIZATION_NVP(name); + } +public: + bus_stop_destination(){} + bus_stop_destination( + const gps_position & _lat, const gps_position & _long, const std::string & _name + ) : + bus_stop(_lat, _long), name(_name) + { + } +}; + +///////////////////////////////////////////////////////////// +// a bus route is a collection of bus stops +// +// illustrates serialization of STL collection templates. +// +// illustrates serialzation of polymorphic pointer (bus stop *); +// +// illustrates storage and recovery of shared pointers is correct +// and efficient. That is objects pointed to by more than one +// pointer are stored only once. In such cases only one such +// object is restored and pointers are restored to point to it +// +class bus_route +{ + friend class boost::serialization::access; + friend std::ostream & operator<<(std::ostream &os, const bus_route &br); + typedef bus_stop * bus_stop_pointer; + std::list stops; + template + void serialize(Archive &ar, const unsigned int version) + { + // in this program, these classes are never serialized directly but rather + // through a pointer to the base class bus_stop. So we need a way to be + // sure that the archive contains information about these derived classes. + //ar.template register_type(); + ar.register_type(static_cast(NULL)); + //ar.template register_type(); + ar.register_type(static_cast(NULL)); + // serialization of stl collections is already defined + // in the header + ar & BOOST_SERIALIZATION_NVP(stops); + } +public: + bus_route(){} + void append(bus_stop *_bs) + { + stops.insert(stops.end(), _bs); + } +}; +std::ostream & operator<<(std::ostream &os, const bus_route &br) +{ + std::list::const_iterator it; + // note: we're displaying the pointer to permit verification + // that duplicated pointers are properly restored. + for(it = br.stops.begin(); it != br.stops.end(); it++){ + os << '\n' << std::hex << "0x" << *it << std::dec << ' ' << **it; + } + return os; +} + +///////////////////////////////////////////////////////////// +// a bus schedule is a collection of routes each with a starting time +// +// Illustrates serialization of STL objects(pair) in a non-intrusive way. +// See definition of operator<< >(ar, pair) +// +// illustrates nesting of serializable classes +// +// illustrates use of version number to automatically grandfather older +// versions of the same class. + +class bus_schedule +{ + friend class boost::serialization::access; + friend std::ostream & operator<<(std::ostream &os, const bus_schedule &bs); + template + void serialize(Archive &ar, const unsigned int version) + { + ar & BOOST_SERIALIZATION_NVP(schedule); + } + // note: this structure was made public. because the friend declarations + // didn't seem to work as expected. +public: + struct trip_info + { + template + void serialize(Archive &ar, const unsigned int file_version) + { + // in versions 2 or later + if(file_version >= 2) + // read the drivers name + ar & BOOST_SERIALIZATION_NVP(driver); + // all versions have the follwing info + ar & BOOST_SERIALIZATION_NVP(hour) + & BOOST_SERIALIZATION_NVP(minute); + } + + // starting time + int hour; + int minute; + // only after system shipped was the driver's name added to the class + std::string driver; + + trip_info(){} + trip_info(int _h, int _m, const std::string &_d) : + hour(_h), minute(_m), driver(_d) + {} + ~trip_info(){ + } + }; +// friend std::ostream & operator<<(std::ostream &os, const trip_info &ti); +private: + std::list > schedule; +public: + void append(const std::string &_d, int _h, int _m, bus_route *_br) + { + schedule.insert(schedule.end(), std::make_pair(trip_info(_h, _m, _d), _br)); + } + bus_schedule(){} +}; + +BOOST_CLASS_VERSION(bus_schedule::trip_info, 3) +BOOST_CLASS_VERSION(bus_schedule, 2) + +std::ostream & operator<<(std::ostream &os, const bus_schedule::trip_info &ti) +{ + return os << '\n' << ti.hour << ':' << ti.minute << ' ' << ti.driver << ' '; +} +std::ostream & operator<<(std::ostream &os, const bus_schedule &bs) +{ + std::list >::const_iterator it; + for(it = bs.schedule.begin(); it != bs.schedule.end(); it++){ + os << it->first << *(it->second); + } + return os; +} + +#endif // BOOST_SERIALIZATION_EXAMPLE_DEMO_XML_HPP diff --git a/deal.II/contrib/boost/libs/serialization/example/demo_xml_load.cpp b/deal.II/contrib/boost/libs/serialization/example/demo_xml_load.cpp new file mode 100644 index 0000000000..cd8e03c119 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/example/demo_xml_load.cpp @@ -0,0 +1,45 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// +// demo_xml_load.cpp +// +// (C) Copyright 2002-4 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) + +#include +#include +#include + +#include + +#include "demo_gps.hpp" + +void +restore_schedule(bus_schedule &s, const char * filename) +{ + // open the archive + std::ifstream ifs(filename); + assert(ifs.good()); + boost::archive::xml_iarchive ia(ifs); + + // restore the schedule from the archive + ia >> BOOST_SERIALIZATION_NVP(s); +} + +int main(int argc, char *argv[]) +{ + // make a new schedule + bus_schedule new_schedule; + + std::string filename(boost::archive::tmpdir()); + filename += "/demo_save.xml"; + + restore_schedule(new_schedule, filename.c_str()); + + // and display + std::cout << "\nrestored schedule"; + std::cout << new_schedule; + + return 0; +} diff --git a/deal.II/contrib/boost/libs/serialization/example/demo_xml_save.cpp b/deal.II/contrib/boost/libs/serialization/example/demo_xml_save.cpp new file mode 100644 index 0000000000..ff03d54ae2 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/example/demo_xml_save.cpp @@ -0,0 +1,91 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// +// demo_xml_save.cpp +// +// (C) Copyright 2002-4 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) + +#include +#include +#include + +#include + +#include "demo_gps.hpp" + +void save_schedule(const bus_schedule &s, const char * filename){ + // make an archive + std::ofstream ofs(filename); + assert(ofs.good()); + boost::archive::xml_oarchive oa(ofs); + oa << BOOST_SERIALIZATION_NVP(s); +} + +int main(int argc, char *argv[]) +{ + // make the schedule + bus_schedule original_schedule; + + // fill in the data + // make a few stops + bus_stop *bs0 = new bus_stop_corner( + gps_position(34, 135, 52.560f), + gps_position(134, 22, 78.30f), + "24th Street", "10th Avenue" + ); + bus_stop *bs1 = new bus_stop_corner( + gps_position(35, 137, 23.456f), + gps_position(133, 35, 54.12f), + "State street", "Cathedral Vista Lane" + ); + bus_stop *bs2 = new bus_stop_destination( + gps_position(35, 136, 15.456f), + gps_position(133, 32, 15.300f), + "White House" + ); + bus_stop *bs3 = new bus_stop_destination( + gps_position(35, 134, 48.789f), + gps_position(133, 32, 16.230f), + "Lincoln Memorial" + ); + + // make a routes + bus_route route0; + route0.append(bs0); + route0.append(bs1); + route0.append(bs2); + + // add trips to schedule + original_schedule.append("bob", 6, 24, &route0); + original_schedule.append("bob", 9, 57, &route0); + original_schedule.append("alice", 11, 02, &route0); + + // make aother routes + bus_route route1; + route1.append(bs3); + route1.append(bs2); + route1.append(bs1); + + // add trips to schedule + original_schedule.append("ted", 7, 17, &route1); + original_schedule.append("ted", 9, 38, &route1); + original_schedule.append("alice", 11, 47, &route1); + + // display the complete schedule + std::cout << "original schedule"; + std::cout << original_schedule; + + std::string filename(boost::archive::tmpdir()); + filename += "/demo_save.xml"; + + // save the schedule + save_schedule(original_schedule, filename.c_str()); + + delete bs0; + delete bs1; + delete bs2; + delete bs3; + return 0; +} diff --git a/deal.II/contrib/boost/libs/serialization/example/demofile.txt b/deal.II/contrib/boost/libs/serialization/example/demofile.txt new file mode 100644 index 0000000000..59ae12f63c --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/example/demofile.txt @@ -0,0 +1,13 @@ +22 serialization::archive 3 0 2 0 0 6 0 0 0 0 6 24 4 1 0 +0 0 0 3 5 1 0 +1 0 0 0 0 34 135 52.560001 134 22 78.300003 11 24th Street 11 10th Avenue 5 +2 35 137 23.455999 133 35 54.119999 12 State street 20 Cathedral Vista Lane 6 1 0 +3 35 136 15.456 133 32 15.3 11 White House 9 57 4 +0 11 2 4 +0 7 17 4 +4 3 6 +5 35 134 48.789001 133 32 16.23 16 Lincoln Memorial 6 +3 5 +2 9 38 4 +4 11 47 4 +4 \ No newline at end of file diff --git a/deal.II/contrib/boost/libs/serialization/example/log_archive.cpp b/deal.II/contrib/boost/libs/serialization/example/log_archive.cpp new file mode 100644 index 0000000000..86c3631e5e --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/example/log_archive.cpp @@ -0,0 +1,32 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// log_archive.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. + +#if (defined _MSC_VER) && (_MSC_VER == 1200) +# pragma warning (disable : 4786) // too long name, harmless warning +#endif + +//#define BOOST_ARCHIVE_SOURCE +#include "log_archive.hpp" +#include + +// explicitly instantiate for this type of xml stream +#include +#include +#include + +namespace boost { +namespace archive { + +template class detail::archive_serializer_map; +template class basic_xml_oarchive ; +template class xml_oarchive_impl ; + +} // namespace archive +} // namespace boost diff --git a/deal.II/contrib/boost/libs/serialization/example/log_archive.hpp b/deal.II/contrib/boost/libs/serialization/example/log_archive.hpp new file mode 100644 index 0000000000..67d848feb6 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/example/log_archive.hpp @@ -0,0 +1,76 @@ +#ifndef LOG_ARCHIVE_HPP +#define LOG_ARCHIVE_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 +// log_archive.hpp + +// (C) Copyright 2010 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 + +///////////////////////////////////////////////////////////////////////// +// log data to an output stream. This illustrates a simpler implemenation +// of text output which is useful for getting a formatted display of +// any serializable class. Intended to be useful as a debugging aid. +class log_archive : + /* protected ? */ + public boost::archive::xml_oarchive_impl +{ + typedef boost::archive::xml_oarchive_impl base; + // give serialization implementation access to this clas + friend class boost::archive::detail::interface_oarchive; + friend class boost::archive::basic_xml_oarchive; + friend boost::archive::save_access; + + ///////////////////////////////////////////////////////////////////// + // Override functions defined in basic_xml_oarchive + + // Anything not an attribute and not a name-value pair is an + // error and should be trapped here. Note the usage of + // function argument matching (BOOST_PFTO) to permit usage + // with compilers which fail to properly support + // function template ordering + template + void save_override(T & t, BOOST_PFTO int){ + // make it a name-value pair and pass it on. + // this permits this to be used even with data types which + // are not wrapped with the name + base::save_override(boost::serialization::make_nvp(NULL, t), 0); + } + template + void save_override(const boost::serialization::nvp & t, int){ + // this is here to remove the "const" requirement. Since + // this class is to be used only for output, it's not required. + base::save_override(t, 0); + } + // specific overrides for attributes - not name value pairs so we + // want to trap them before the above "fall through" + // since we don't want to see these in the output - make them no-ops. + void save_override(const boost::archive::object_id_type & t, int){} + void save_override(const boost::archive::object_reference_type & t, int){} + void save_override(const boost::archive::version_type & t, int){} + void save_override(const boost::archive::class_id_type & t, int){} + void save_override(const boost::archive::class_id_optional_type & t, int){} + void save_override(const boost::archive::class_id_reference_type & t, int){} + void save_override(const boost::archive::class_name_type & t, int){} + void save_override(const boost::archive::tracking_type & t, int){} +public: + log_archive(std::ostream & os, unsigned int flags = 0) : + boost::archive::xml_oarchive_impl( + os, + flags | boost::archive::no_header + ) + {} +}; + +#endif // LOG_ARCHIVE_HPP diff --git a/deal.II/contrib/boost/libs/serialization/example/polymorphic_portable_binary_iarchive.cpp b/deal.II/contrib/boost/libs/serialization/example/polymorphic_portable_binary_iarchive.cpp new file mode 100644 index 0000000000..7f2f23e4ce --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/example/polymorphic_portable_binary_iarchive.cpp @@ -0,0 +1,34 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// polymorphic_portable_binary_iarchive.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 + +#define BOOST_ARCHIVE_SOURCE +#include "polymorphic_portable_binary_iarchive.hpp" + +// explicitly instantiate for this type of text stream +#include +#include +#include + +namespace boost { +namespace archive { + +template class binary_iarchive_impl< + polymorphic_portable_binary_iarchive, + std::istream::char_type, + std::istream::traits_type +>; +template class detail::archive_pointer_iserializer< + polymorphic_portable_binary_iarchive +> ; + +} // namespace archive +} // namespace boost diff --git a/deal.II/contrib/boost/libs/serialization/example/polymorphic_portable_binary_iarchive.hpp b/deal.II/contrib/boost/libs/serialization/example/polymorphic_portable_binary_iarchive.hpp new file mode 100644 index 0000000000..95c5469511 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/example/polymorphic_portable_binary_iarchive.hpp @@ -0,0 +1,35 @@ +#ifndef BOOST_ARCHIVE_POLYMORPHIC_PORTABLE_BINARY_IARCHIVE_HPP +#define BOOST_ARCHIVE_POLYMORPHIC_PORTABLE_BINARY_IARCHIVE_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_portable_binary_iarchive.hpp + +// (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 +#include "portable_binary_iarchive.hpp" + +typedef boost::archive::detail::polymorphic_iarchive_dispatch< + portable_binary_iarchive +> polymorphic_portable_binary_iarchive; + +#include +#if BOOST_VERSION > 103401 + // required by export + BOOST_SERIALIZATION_REGISTER_ARCHIVE( + polymorphic_portable_binary_iarchive + ) +#endif + +#endif // BOOST_ARCHIVE_POLYMORPHIC_PORTABLE_BINARY_OARCHIVE_HPP + diff --git a/deal.II/contrib/boost/libs/serialization/example/polymorphic_portable_binary_oarchive.cpp b/deal.II/contrib/boost/libs/serialization/example/polymorphic_portable_binary_oarchive.cpp new file mode 100644 index 0000000000..f77b902169 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/example/polymorphic_portable_binary_oarchive.cpp @@ -0,0 +1,35 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// polymorphic_portable_binary_oarchive.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 + +#define BOOST_ARCHIVE_SOURCE +#include "polymorphic_portable_binary_oarchive.hpp" + +// explicitly instantiate for this type of text stream +#include +#include +#include + +namespace boost { +namespace archive { + +// explicitly instantiate for this type of binary stream +template class binary_oarchive_impl< + polymorphic_portable_binary_oarchive, + std::ostream::char_type, + std::ostream::traits_type +>; +template class detail::archive_pointer_oserializer< + polymorphic_portable_binary_oarchive +> ; + +} // namespace archive +} // namespace boost diff --git a/deal.II/contrib/boost/libs/serialization/example/polymorphic_portable_binary_oarchive.hpp b/deal.II/contrib/boost/libs/serialization/example/polymorphic_portable_binary_oarchive.hpp new file mode 100644 index 0000000000..d247464054 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/example/polymorphic_portable_binary_oarchive.hpp @@ -0,0 +1,34 @@ +#ifndef BOOST_ARCHIVE_POLYMORPHIC_PORTABLE_BINARY_OARCHIVE_HPP +#define BOOST_ARCHIVE_POLYMORPHIC_PORTABLE_BINARY_OARCHIVE_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_portable_binary_oarchive.hpp + +// (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 +#include "portable_binary_oarchive.hpp" + +typedef boost::archive::detail::polymorphic_oarchive_dispatch< + portable_binary_oarchive + > polymorphic_portable_binary_oarchive; + +#include +#if BOOST_VERSION > 103401 + // required by export + BOOST_SERIALIZATION_REGISTER_ARCHIVE( + polymorphic_portable_binary_oarchive + ) +#endif + +#endif // BOOST_ARCHIVE_POLYMORPHIC_PORTABLE_BINARY_OARCHIVE_HPP diff --git a/deal.II/contrib/boost/libs/serialization/example/portable_binary_archive.hpp b/deal.II/contrib/boost/libs/serialization/example/portable_binary_archive.hpp new file mode 100644 index 0000000000..ee23888e0b --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/example/portable_binary_archive.hpp @@ -0,0 +1,47 @@ +#ifndef PORTABLE_BINARY_ARCHIVE_HPP +#define PORTABLE_BINARY_ARCHIVE_HPP + +// (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) + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +#include +#include +#include +#include + +#include +#if CHAR_BIT != 8 +#error This code assumes an eight-bit byte. +#endif + +#include +#include + +enum portable_binary_archive_flags { + endian_big = 0x4000, + endian_little = 0x8000 +}; + +//#if ( endian_big <= boost::archive::flags_last ) +//#error archive flags conflict +//#endif + +inline void +reverse_bytes(char size, char *address){ + char * first = address; + char * last = first + size - 1; + for(;first < last;++first, --last){ + char x = *last; + *last = *first; + *first = x; + } +} + +#endif // PORTABLE_BINARY_ARCHIVE_HPP diff --git a/deal.II/contrib/boost/libs/serialization/example/portable_binary_iarchive.cpp b/deal.II/contrib/boost/libs/serialization/example/portable_binary_iarchive.cpp new file mode 100644 index 0000000000..445d69bbea --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/example/portable_binary_iarchive.cpp @@ -0,0 +1,127 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// portable_binary_iarchive.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 +#include + +#include +#include +#include + +#include "portable_binary_iarchive.hpp" + +void +portable_binary_iarchive::load_impl(boost::intmax_t & l, char maxsize){ + char size; + l = 0; + this->primitive_base_t::load(size); + + if(0 == size){ + return; + } + + bool negative = (size < 0); + if(negative) + size = -size; + + if(size > maxsize) + boost::serialization::throw_exception( + portable_binary_iarchive_exception() + ); + + char * cptr = reinterpret_cast(& l); + #ifdef BOOST_BIG_ENDIAN + cptr += (sizeof(boost::intmax_t) - size); + #endif + this->primitive_base_t::load_binary(cptr, size); + + #ifdef BOOST_BIG_ENDIAN + if(m_flags & endian_little) + #else + if(m_flags & endian_big) + #endif + reverse_bytes(size, cptr); + + if(negative) + l = -l; +} + +void +portable_binary_iarchive::load_override( + boost::archive::class_name_type & t, int +){ + std::string cn; + cn.reserve(BOOST_SERIALIZATION_MAX_KEY_SIZE); + load_override(cn, 0); + if(cn.size() > (BOOST_SERIALIZATION_MAX_KEY_SIZE - 1)) + boost::serialization::throw_exception( + boost::archive::archive_exception( + boost::archive::archive_exception::invalid_class_name) + ); + std::memcpy(t, cn.data(), cn.size()); + // borland tweak + t.t[cn.size()] = '\0'; +} + +void +portable_binary_iarchive::init(unsigned int flags){ + if(0 == (flags & boost::archive::no_header)){ + // read signature in an archive version independent manner + std::string file_signature; + * this >> file_signature; + if(file_signature != boost::archive::BOOST_ARCHIVE_SIGNATURE()) + boost::serialization::throw_exception( + boost::archive::archive_exception( + boost::archive::archive_exception::invalid_signature + ) + ); + // make sure the version of the reading archive library can + // support the format of the archive being read + boost::archive::version_type input_library_version; + * this >> input_library_version; + + // extra little .t is to get around borland quirk + if(boost::archive::BOOST_ARCHIVE_VERSION() < input_library_version.t) + boost::serialization::throw_exception( + boost::archive::archive_exception( + boost::archive::archive_exception::unsupported_version + ) + ); + + #if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3205)) + this->set_library_version(input_library_version); + //#else + //#if ! BOOST_WORKAROUND(BOOST_MSVC, <= 1200) + //detail:: + //#endif + boost::archive::detail::basic_iarchive::set_library_version( + input_library_version + ); + #endif + } + unsigned char x; + load(x); + m_flags = x << CHAR_BIT; +} + +#include + + +namespace boost { +namespace archive { + +template class basic_binary_iprimitive< + portable_binary_iarchive, + std::istream::char_type, + std::istream::traits_type +> ; + +} // namespace archive +} // namespace boost diff --git a/deal.II/contrib/boost/libs/serialization/example/portable_binary_iarchive.hpp b/deal.II/contrib/boost/libs/serialization/example/portable_binary_iarchive.hpp new file mode 100644 index 0000000000..6c3af4f754 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/example/portable_binary_iarchive.hpp @@ -0,0 +1,192 @@ +#ifndef PORTABLE_BINARY_IARCHIVE_HPP +#define PORTABLE_BINARY_IARCHIVE_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +#if defined(_MSC_VER) +#pragma warning( push ) +#pragma warning( disable : 4244 ) +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// portable_binary_iarchive.hpp + +// (C) Copyright 2002-7 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 +#include +#include +#include +#include +#include +#include + +#include "portable_binary_archive.hpp" + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// exception to be thrown if integer read from archive doesn't fit +// variable being loaded +class portable_binary_iarchive_exception : + public virtual boost::archive::archive_exception +{ +public: + typedef enum { + incompatible_integer_size + } exception_code; + portable_binary_iarchive_exception(exception_code c = incompatible_integer_size ) : + boost::archive::archive_exception(boost::archive::archive_exception::other_exception) + {} + virtual const char *what( ) const throw( ) + { + const char *msg = "programmer error"; + switch(code){ + case incompatible_integer_size: + msg = "integer cannot be represented"; + break; + default: + msg = boost::archive::archive_exception::what(); + assert(false); + break; + } + return msg; + } +}; + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// "Portable" input binary archive. It addresses integer size and endienness so +// that binary archives can be passed across systems. Note:floating point types +// not addressed here +class portable_binary_iarchive : + public boost::archive::basic_binary_iprimitive< + portable_binary_iarchive, + std::istream::char_type, + std::istream::traits_type + >, + public boost::archive::detail::common_iarchive< + portable_binary_iarchive + > + , + public boost::archive::detail::shared_ptr_helper + { + typedef boost::archive::basic_binary_iprimitive< + portable_binary_iarchive, + std::istream::char_type, + std::istream::traits_type + > primitive_base_t; + typedef boost::archive::detail::common_iarchive< + portable_binary_iarchive + > archive_base_t; +#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS +public: +#else + friend archive_base_t; + friend primitive_base_t; // since with override load below + friend class boost::archive::detail::interface_iarchive< + portable_binary_iarchive + >; + friend class boost::archive::load_access; +protected: +#endif + unsigned int m_flags; + void load_impl(boost::intmax_t & l, char maxsize); + + // default fall through for any types not specified here + template + void load(T & t){ + boost::intmax_t l; + load_impl(l, sizeof(T)); + // use cast to avoid compile time warning + t = static_cast(l); + } + void load(std::string & t){ + this->primitive_base_t::load(t); + } + #ifndef BOOST_NO_STD_WSTRING + void load(std::wstring & t){ + this->primitive_base_t::load(t); + } + #endif + void load(float & t){ + this->primitive_base_t::load(t); + // floats not supported + //BOOST_STATIC_ASSERT(false); + } + void load(double & t){ + this->primitive_base_t::load(t); + // doubles not supported + //BOOST_STATIC_ASSERT(false); + } + void load(char & t){ + this->primitive_base_t::load(t); + } + void load(unsigned char & t){ + this->primitive_base_t::load(t); + } + // intermediate level to support override of operators + // fot templates in the absence of partial function + // template ordering + typedef boost::archive::detail::common_iarchive + detail_common_iarchive; + template + void load_override(T & t, BOOST_PFTO int){ + this->detail_common_iarchive::load_override(t, 0); + } + void load_override(boost::archive::class_name_type & t, int); + // binary files don't include the optional information + void load_override( + boost::archive::class_id_optional_type & /* t */, + int + ){} + + void init(unsigned int flags); +public: + portable_binary_iarchive(std::istream & is, unsigned flags = 0) : + primitive_base_t( + * is.rdbuf(), + 0 != (flags & boost::archive::no_codecvt) + ), + archive_base_t(flags), + m_flags(0) + { + init(flags); + } + + portable_binary_iarchive( + std::basic_streambuf< + std::istream::char_type, + std::istream::traits_type + > & bsb, + unsigned int flags + ) : + primitive_base_t( + bsb, + 0 != (flags & boost::archive::no_codecvt) + ), + archive_base_t(flags), + m_flags(0) + { + init(flags); + } +}; + +// required by export in boost version > 1.34 +#ifdef BOOST_SERIALIZATION_REGISTER_ARCHIVE + BOOST_SERIALIZATION_REGISTER_ARCHIVE(portable_binary_iarchive) +#endif + +// required by export in boost <= 1.34 +#define BOOST_ARCHIVE_CUSTOM_IARCHIVE_TYPES portable_binary_iarchive + +#if defined(_MSC_VER) +#pragma warning( pop ) +#endif + +#endif // PORTABLE_BINARY_IARCHIVE_HPP diff --git a/deal.II/contrib/boost/libs/serialization/example/portable_binary_oarchive.cpp b/deal.II/contrib/boost/libs/serialization/example/portable_binary_oarchive.cpp new file mode 100644 index 0000000000..80799370d6 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/example/portable_binary_oarchive.cpp @@ -0,0 +1,93 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// portable_binary_oarchive.cpp + +// (C) Copyright 2002-7 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 +#include +#include "portable_binary_oarchive.hpp" + +void +portable_binary_oarchive::save_impl( + const boost::intmax_t l, + const char maxsize +){ + char size = 0; + + if(l == 0){ + this->primitive_base_t::save(size); + return; + } + + boost::intmax_t ll; + bool negative = (l < 0); + if(negative) + ll = -l; + else + ll = l; + + do{ + ll >>= CHAR_BIT; + ++size; + }while(ll != 0); + + this->primitive_base_t::save( + static_cast(negative ? -size : size) + ); + + if(negative) + ll = -l; + else + ll = l; + char * cptr = reinterpret_cast(& ll); + #ifdef BOOST_BIG_ENDIAN + cptr += (sizeof(boost::intmax_t) - size); + if(m_flags & endian_little) + reverse_bytes(size, cptr); + #else + if(m_flags & endian_big) + reverse_bytes(size, cptr); + #endif + this->primitive_base_t::save_binary(cptr, size); +} + +void +portable_binary_oarchive::init(unsigned int flags) { + if(m_flags == (endian_big | endian_little)){ + boost::serialization::throw_exception( + portable_binary_oarchive_exception() + ); + } + if(0 == (flags & boost::archive::no_header)){ + // write signature in an archive version independent manner + const std::string file_signature( + boost::archive::BOOST_ARCHIVE_SIGNATURE() + ); + * this << file_signature; + // write library version + const boost::archive::version_type v( + boost::archive::BOOST_ARCHIVE_VERSION() + ); + * this << v; + } + save(static_cast(m_flags >> CHAR_BIT)); +} + +#include + +namespace boost { +namespace archive { + +template class basic_binary_oprimitive< + portable_binary_oarchive, + std::ostream::char_type, + std::ostream::traits_type +> ; + +} // namespace archive +} // namespace boost diff --git a/deal.II/contrib/boost/libs/serialization/example/portable_binary_oarchive.hpp b/deal.II/contrib/boost/libs/serialization/example/portable_binary_oarchive.hpp new file mode 100644 index 0000000000..05c9f80ba9 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/example/portable_binary_oarchive.hpp @@ -0,0 +1,192 @@ +#ifndef PORTABLE_BINARY_OARCHIVE_HPP +#define PORTABLE_BINARY_OARCHIVE_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +#if defined(_MSC_VER) +#pragma warning( push ) +#pragma warning( disable : 4244 ) +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// portable_binary_oarchive.hpp + +// (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 +#include +#include +#include +#include +#include + +#include "portable_binary_archive.hpp" + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// exception to be thrown if integer read from archive doesn't fit +// variable being loaded +class portable_binary_oarchive_exception : + public virtual boost::archive::archive_exception +{ +public: + typedef enum { + invalid_flags + } exception_code; + portable_binary_oarchive_exception(exception_code c = invalid_flags ) + {} + virtual const char *what( ) const throw( ) + { + const char *msg = "programmer error"; + switch(code){ + case invalid_flags: + msg = "cannot be both big and little endian"; + default: + boost::archive::archive_exception::what(); + } + return msg; + } +}; + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// "Portable" output binary archive. This is a variation of the native binary +// archive. it addresses integer size and endienness so that binary archives can +// be passed across systems. Note:floating point types not addressed here + +class portable_binary_oarchive : + public boost::archive::basic_binary_oprimitive< + portable_binary_oarchive, + std::ostream::char_type, + std::ostream::traits_type + >, + public boost::archive::detail::common_oarchive< + portable_binary_oarchive + > +{ + typedef boost::archive::basic_binary_oprimitive< + portable_binary_oarchive, + std::ostream::char_type, + std::ostream::traits_type + > primitive_base_t; + typedef boost::archive::detail::common_oarchive< + portable_binary_oarchive + > archive_base_t; +#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS +public: +#else + friend archive_base_t; + friend primitive_base_t; // since with override save below + friend class boost::archive::detail::interface_oarchive< + portable_binary_oarchive + >; + friend class boost::archive::save_access; +protected: +#endif + unsigned int m_flags; + void save_impl(const boost::intmax_t l, const char maxsize); + // add base class to the places considered when matching + // save function to a specific set of arguments. Note, this didn't + // work on my MSVC 7.0 system so we use the sure-fire method below + // using archive_base_t::save; + + // default fall through for any types not specified here + template + void save(const T & t){ + save_impl(t, sizeof(T)); + } + void save(const std::string & t){ + this->primitive_base_t::save(t); + } + #ifndef BOOST_NO_STD_WSTRING + void save(const std::wstring & t){ + this->primitive_base_t::save(t); + } + #endif + void save(const float & t){ + this->primitive_base_t::save(t); + // floats not supported + //BOOST_STATIC_ASSERT(false); + } + void save(const double & t){ + this->primitive_base_t::save(t); + // doubles not supported + //BOOST_STATIC_ASSERT(false); + } + void save(const char & t){ + this->primitive_base_t::save(t); + } + void save(const unsigned char & t){ + this->primitive_base_t::save(t); + } + + // default processing - kick back to base class. Note the + // extra stuff to get it passed borland compilers + typedef boost::archive::detail::common_oarchive + detail_common_oarchive; + template + void save_override(T & t, BOOST_PFTO int){ + this->detail_common_oarchive::save_override(t, 0); + } + // explicitly convert to char * to avoid compile ambiguities + void save_override(const boost::archive::class_name_type & t, int){ + const std::string s(t); + * this << s; + } + // binary files don't include the optional information + void save_override( + const boost::archive::class_id_optional_type & /* t */, + int + ){} + + void init(unsigned int flags); +public: + portable_binary_oarchive(std::ostream & os, unsigned flags = 0) : + primitive_base_t( + * os.rdbuf(), + 0 != (flags & boost::archive::no_codecvt) + ), + archive_base_t(flags), + m_flags(flags & (endian_big | endian_little)) + { + init(flags); + } + + portable_binary_oarchive( + std::basic_streambuf< + std::ostream::char_type, + std::ostream::traits_type + > & bsb, + unsigned int flags + ) : + primitive_base_t( + bsb, + 0 != (flags & boost::archive::no_codecvt) + ), + archive_base_t(flags), + m_flags(0) + { + init(flags); + } +}; + + +// required by export in boost version > 1.34 +#ifdef BOOST_SERIALIZATION_REGISTER_ARCHIVE + BOOST_SERIALIZATION_REGISTER_ARCHIVE(portable_binary_oarchive) +#endif + +// required by export in boost <= 1.34 +#define BOOST_ARCHIVE_CUSTOM_OARCHIVE_TYPES portable_binary_oarchive + +#if defined(_MSC_VER) +#pragma warning( pop ) +#endif + +#endif // PORTABLE_BINARY_OARCHIVE_HPP diff --git a/deal.II/contrib/boost/libs/serialization/example/simple_log_archive.hpp b/deal.II/contrib/boost/libs/serialization/example/simple_log_archive.hpp new file mode 100644 index 0000000000..d70b7cca3d --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/example/simple_log_archive.hpp @@ -0,0 +1,166 @@ +#ifndef BOOST_SIMPLE_LOG_ARCHIVE_HPP +#define BOOST_SIMPLE_LOG_ARCHIVE_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 +// simple_log_archive.hpp + +// (C) Copyright 2010 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 +#include // std::size_t + +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::size_t; +} // namespace std +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +///////////////////////////////////////////////////////////////////////// +// log data to an output stream. This illustrates a simpler implemenation +// of text output which is useful for getting a formatted display of +// any serializable class. Intended to be useful as a debugging aid. +class simple_log_archive { + std::ostream & m_os; + unsigned int m_depth; + + template + struct save_enum_type { + template + static void invoke(Archive &ar, const T &t){ + ar.m_os << static_cast(t); + } + }; + template + struct save_primitive { + template + static void invoke(Archive & ar, const T & t){ + ar.m_os << t; + } + }; + template + struct save_only { + template + static void invoke(Archive & ar, const T & t){ + // make sure call is routed through the highest interface that might + // be specialized by the user. + boost::serialization::serialize_adl( + ar, + const_cast(t), + ::boost::serialization::version::value + ); + } + }; + template + void save(const T &t){ + typedef + BOOST_DEDUCED_TYPENAME boost::mpl::eval_if, + boost::mpl::identity >, + //else + BOOST_DEDUCED_TYPENAME boost::mpl::eval_if< + // if its primitive + boost::mpl::equal_to< + boost::serialization::implementation_level, + boost::mpl::int_ + >, + boost::mpl::identity >, + // else + boost::mpl::identity > + > >::type typex; + typex::invoke(*this, t); + } + #ifndef BOOST_NO_STD_WSTRING + void save(const std::wstring &ws){ + m_os << "wide string types not suported in log archive"; + } + #endif + +public: + /////////////////////////////////////////////////// + // Implement requirements for archive concept + + typedef boost::mpl::bool_ is_loading; + typedef boost::mpl::bool_ is_saving; + + // this can be a no-op since we ignore pointer polymorphism + template + void register_type(const T * = NULL){} + + unsigned int get_library_version(){ + return 0; + } + + void + save_binary(const void *address, std::size_t count){ + m_os << "save_binary not implemented"; + } + + // the << operators + template + simple_log_archive & operator<<(T const & t){ + m_os << ' '; + save(t); + return * this; + } + template + simple_log_archive & operator<<(T * const t){ + m_os << " ->"; + if(NULL == t) + m_os << " null"; + else + *this << * t; + return * this; + } + template + simple_log_archive & operator<<(const T (&t)[N]){ + ar << serialization::make_array( + static_cast(&t[0]),count + ); + } + template + simple_log_archive & operator<<(const ::boost::serialization::nvp & t){ + m_os << '\n'; // start line with each named object + // indent according to object depth + for(unsigned int i = 0; i < m_depth; ++i) + m_os << ' '; + ++m_depth; + m_os << t.name(); // output the name of the object + * this << t.const_value(); + --m_depth; + return * this; + } + + // the & operator + template + simple_log_archive & operator&(const T & t){ + return * this << t; + } + /////////////////////////////////////////////// + + simple_log_archive(std::ostream & os) : + m_os(os), + m_depth(0) + {} +}; + +#endif // BOOST_SIMPLE_LOG_ARCHIVE_HPP diff --git a/deal.II/contrib/boost/libs/serialization/index.html b/deal.II/contrib/boost/libs/serialization/index.html new file mode 100644 index 0000000000..ad01a7c513 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/index.html @@ -0,0 +1,15 @@ + + + + + + +Automatic redirection failed, please go to +doc/index.html. + + \ No newline at end of file diff --git a/deal.II/contrib/boost/libs/serialization/performance/Jamfile.v2 b/deal.II/contrib/boost/libs/serialization/performance/Jamfile.v2 new file mode 100644 index 0000000000..5ec2a29687 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/performance/Jamfile.v2 @@ -0,0 +1,48 @@ +# Boost serialization Library performance test Jamfile + +# (C) Copyright Robert Ramey 2002-2004. +# Use, modification, and distribution are 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) +# + +project libs/serialization/performance + : default-build release + : id serialization_performance + ; + +# import rules from the boost serialization test +# import ../util/test : test-bsl-run-no-lib ; +import ../util/test : + run-template + run-invoke + run-winvoke + test-bsl-run-no-lib + test-bsl-run + test-bsl-run_archive + test-bsl-run_files + test-bsl-run_polymorphic_archive +; + +BOOST_ARCHIVE_LIST = [ modules.peek : BOOST_ARCHIVE_LIST ] ; + +test-suite "performance" : + [ test-bsl-run_files peformance_array : ../test/A ] +# [ test-bsl-run_files performance_binary ] +# [ test-bsl-run_files performance_polymorphic ] +# [ test-bsl-run_files performance_vector ] +# [ test-bsl-run_files performance_no_rtti ] +# [ test-bsl-run_files performance_simple_class ] +# [ test-bsl-run_polymorphic_archive performance_polymorphic : ../test/test_polymorphic_A ] + + [ test-bsl-run-no-lib performance_iterators ] + [ test-bsl-run-no-lib performance_iterators_base64 ] +# [ test-bsl-run-no-lib performance_utf8_codecvt +# : ../src/utf8_codecvt_facet +# : # ../../config/test/all//BOOST_NO_STD_WSTREAMBUF +# ] +# [ test-bsl-run-no-lib performance_codecvt_null +# : ../src/codecvt_null +# : # ../../config/test/all//BOOST_NO_STD_WSTREAMBUF +# ] +; diff --git a/deal.II/contrib/boost/libs/serialization/performance/binary_archive.hpp b/deal.II/contrib/boost/libs/serialization/performance/binary_archive.hpp new file mode 100644 index 0000000000..3569bcf36c --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/performance/binary_archive.hpp @@ -0,0 +1,22 @@ +// (C) Copyright 2002-4 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. +// (C) Copyright 2002-4 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. + +// binary_archive +#include +typedef boost::archive::binary_oarchive test_oarchive; +typedef std::ofstream test_ostream; +#include +typedef boost::archive::binary_iarchive test_iarchive; +typedef std::ifstream test_istream; +#define TEST_STREAM_FLAGS std::ios::binary + diff --git a/deal.II/contrib/boost/libs/serialization/performance/binary_warchive.hpp b/deal.II/contrib/boost/libs/serialization/performance/binary_warchive.hpp new file mode 100644 index 0000000000..929f3a37db --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/performance/binary_warchive.hpp @@ -0,0 +1,14 @@ +// (C) Copyright 2002-4 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. +// binary_warchive +#include +typedef boost::archive::binary_woarchive test_oarchive; +typedef std::wofstream test_ostream; +#include +typedef boost::archive::binary_wiarchive test_iarchive; +typedef std::wifstream test_istream; +#define TEST_STREAM_FLAGS std::wios::binary diff --git a/deal.II/contrib/boost/libs/serialization/performance/peformance_array.cpp b/deal.II/contrib/boost/libs/serialization/performance/peformance_array.cpp new file mode 100644 index 0000000000..4015901347 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/performance/peformance_array.cpp @@ -0,0 +1,118 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_array.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) + +// should pass compilation and execution + +#include +#include // remove +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::remove; +} +#endif + +#include "../test/test_tools.hpp" + +#include +//#include +// the following fails with (only!) gcc 3.4 +// #include BOOST_PP_STRINGIZE(BOOST_PP_CAT(../test/,BOOST_ARCHIVE_TEST)) +// just copy over the files from the test directory +#include BOOST_PP_STRINGIZE(BOOST_ARCHIVE_TEST) + +#include +#include + +#include +#include "../test/A.hpp" +#include "../test/A.ipp" + +struct array_equal_to //: public std::binary_function +{ +template + bool operator()(const T & _Left, const U & _Right) const + { + // consider alignment + int count_left = sizeof(_Left) / ( + static_cast(static_cast(&_Left[1])) + - static_cast(static_cast(&_Left[0])) + ); + int count_right = sizeof(_Right) / ( + static_cast(static_cast(&_Right[1])) + - static_cast(static_cast(&_Right[0])) + ); + if(count_right != count_left) + return false; + while(count_left-- > 0){ + if(_Left[count_left] == _Right[count_left]) + continue; + return false; + } + return true; + } +}; + +template +int test_array(T) +{ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + + // test array of objects + const T a_array[10]={T(),T(),T(),T(),T(),T(),T(),T(),T(),T()}; + { + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + oa << boost::serialization::make_nvp("a_array", a_array); + } + { + T a_array1[10]; + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + ia >> boost::serialization::make_nvp("a_array", a_array1); + + array_equal_to/**/ Compare; + BOOST_CHECK(Compare(a_array, a_array1)); + } + { + T a_array1[9]; + test_istream is(testfile, TEST_STREAM_FLAGS); + BOOST_TRY { + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + bool exception_invoked = false; + BOOST_TRY { + ia >> boost::serialization::make_nvp("a_array", a_array1); + } + BOOST_CATCH (boost::archive::archive_exception ae){ + BOOST_CHECK( + boost::archive::archive_exception::array_size_too_short + == ae.code + ); + exception_invoked = true; + } + BOOST_CATCH_END + BOOST_CHECK(exception_invoked); + } + BOOST_CATCH (boost::archive::archive_exception ae){} + BOOST_CATCH_END + } + std::remove(testfile); + return EXIT_SUCCESS; +} + +int test_main( int /* argc */, char* /* argv */[] ) +{ + int res = test_array(A()); + // test an int array for which optimized versions should be available + if (res == EXIT_SUCCESS) + res = test_array(0); + return res; +} + +// EOF diff --git a/deal.II/contrib/boost/libs/serialization/performance/performance_binary.cpp b/deal.II/contrib/boost/libs/serialization/performance/performance_binary.cpp new file mode 100644 index 0000000000..7c817b2067 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/performance/performance_binary.cpp @@ -0,0 +1,96 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_simple_class.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) + +// should pass compilation and execution + +#include + +#include // for rand() +#include // remove +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::rand; + using ::remove; +} +#endif + +#include "../test/test_tools.hpp" +#include +// #include +// the following fails with (only!) gcc 3.4 +// #include BOOST_PP_STRINGIZE(BOOST_PP_CAT(../test/,BOOST_ARCHIVE_TEST)) +// just copy over the files from the test directory +#include BOOST_PP_STRINGIZE(BOOST_ARCHIVE_TEST) + +#include +#include + +class A { + friend class boost::serialization::access; + char data[150]; + // note: from an aesthetic perspective, I would much prefer to have this + // defined out of line. Unfortunately, this trips a bug in the VC 6.0 + // compiler. So hold our nose and put it her to permit running of tests. + template + void serialize(Archive & ar, const unsigned int /* file_version */){ + ar & boost::serialization::make_nvp( + "data", + boost::serialization::make_binary_object(data, sizeof(data)) + ); + } + +public: + A(); + bool operator==(const A & rhs) const; +}; + +A::A(){ + int i = sizeof(data); + while(i-- > 0) + data[i] = 0xff & std::rand(); +} + +bool A::operator==(const A & rhs) const { + int i = sizeof(data); + while(i-- > 0) + if(data[i] != rhs.data[i]) + return false; + return true; +} + +int test_main( int /* argc */, char* /* argv */[] ) +{ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + + const A a; + A a1; + const int i = 12345; + int i1 = 34790; + { + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + oa << BOOST_SERIALIZATION_NVP(a); + // note: add a little bit on the end of the archive to detect + // failure of text mode binary. + oa << BOOST_SERIALIZATION_NVP(i); + } + { + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + ia >> BOOST_SERIALIZATION_NVP(a1); + ia >> BOOST_SERIALIZATION_NVP(i1); + } + BOOST_CHECK(i == i1); + BOOST_CHECK(a == a1); + std::remove(testfile); + return EXIT_SUCCESS; +} + +// EOF diff --git a/deal.II/contrib/boost/libs/serialization/performance/performance_codecvt_null.cpp b/deal.II/contrib/boost/libs/serialization/performance/performance_codecvt_null.cpp new file mode 100644 index 0000000000..70dd573ee7 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/performance/performance_codecvt_null.cpp @@ -0,0 +1,136 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_codecvt_null.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) + +// should pass compilation and execution. Note: compilation with compilers +// which use wchar_t as 2 byte objects will emit warnings. These should be +// ignored. + +#include +#include +#include +#include +#include +#include +#include + +#include // remove +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::remove; +} +#endif + +#include "test_tools.hpp" + +#include +#include +#include +#include + +template +struct test_data +{ + static wchar_t wchar_encoding[]; +}; + +template<> +wchar_t test_data<2>::wchar_encoding[] = { + 0x0001, + 0x007f, + 0x0080, + 0x07ff, + 0x0800, + 0x7fff +}; + +template<> +wchar_t test_data<4>::wchar_encoding[] = { + 0x00000001, + 0x0000007f, + 0x00000080, + 0x000007ff, + 0x00000800, + 0x0000ffff, + 0x00010000, + 0x0010ffff, + 0x001fffff, + 0x00200000, + 0x03ffffff, + 0x04000000, + 0x7fffffff +}; + +#include + +int test_main( int /* argc */, char* /* argv */[] ) { + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + + std::locale old_loc; + std::locale * null_locale = + boost::archive::add_facet(old_loc, new boost::archive::codecvt_null); + + typedef test_data td; + { + std::wofstream ofs; + ofs.imbue(*null_locale); + ofs.open(testfile, std::ios::binary); + std::copy( + td::wchar_encoding, + #if ! defined(__BORLANDC__) + // borland 5.60 complains about this + td::wchar_encoding + sizeof(td::wchar_encoding)/sizeof(wchar_t), + #else + // so use this instead + td::wchar_encoding + 6, + #endif + boost::archive::iterators::ostream_iterator(ofs) + ); + } + bool ok = false; + { + std::wifstream ifs; + ifs.imbue(*null_locale); + ifs.open(testfile, std::ios::binary); + ok = std::equal( + td::wchar_encoding, + #if ! defined(__BORLANDC__) + // borland 5.60 complains about this + td::wchar_encoding + sizeof(td::wchar_encoding)/sizeof(wchar_t), + #else + // so use this instead + td::wchar_encoding + 6, + #endif + boost::archive::iterators::istream_iterator(ifs) + ); + } + + BOOST_CHECK(ok); + { + std::wofstream ofs("testfile2"); + ofs.imbue(*null_locale); + int i = 10; + ofs << i; + ofs.close(); + + std::wifstream ifs("testfile2"); + ifs.imbue(*null_locale); + int i2; + ifs >> i2; + std::cout << "i=" << i << std::endl; + std::cout << "i2=" << i2 << std::endl; + BOOST_CHECK(i == i2); + ifs.close(); + } + + delete null_locale; + std::remove(testfile); + return EXIT_SUCCESS; +} + diff --git a/deal.II/contrib/boost/libs/serialization/performance/performance_iterators.cpp b/deal.II/contrib/boost/libs/serialization/performance/performance_iterators.cpp new file mode 100644 index 0000000000..869b6eda56 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/performance/performance_iterators.cpp @@ -0,0 +1,213 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_iterators.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) + +#include +#include +#include // for rand +#include +#include // used to test stream iterators + +#include +#ifdef BOOST_NO_STDC_NAMESPACE +namespace std{ + using ::rand; +} +#endif + +#include +#if BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1) +#include +#endif + +#ifndef BOOST_NO_CWCHAR +#include +#include +#endif +#include +#include +#include +#include +#include + +#include "../test/test_tools.hpp" + +#ifndef BOOST_NO_CWCHAR + +void test_wchar_from_mb(const wchar_t *la, const char * a, const unsigned int size){ + typedef boost::archive::iterators::wchar_from_mb translator; + BOOST_CHECK(( + std::equal( + translator(BOOST_MAKE_PFTO_WRAPPER(a)), + translator(BOOST_MAKE_PFTO_WRAPPER(a + size)), + la + ) + )); +} + +void test_mb_from_wchar(const char * a, const wchar_t *la, const unsigned int size){ + typedef boost::archive::iterators::mb_from_wchar translator; + BOOST_CHECK( + std::equal( + translator(BOOST_MAKE_PFTO_WRAPPER(la)), + translator(BOOST_MAKE_PFTO_WRAPPER(la + size)), + a + ) + ); +} + +#endif + +template +void test_xml_escape( + const CharType * xml_escaped, + const CharType * xml, + unsigned int size +){ + typedef boost::archive::iterators::xml_escape translator; + + BOOST_CHECK( + std::equal( + translator(BOOST_MAKE_PFTO_WRAPPER(xml)), + translator(BOOST_MAKE_PFTO_WRAPPER(xml + size)), + xml_escaped + ) + ); +} + +template +void test_xml_unescape( + const CharType * xml, + const CharType * xml_escaped, + unsigned int size +){ + + // test xml_unescape + typedef boost::archive::iterators::xml_unescape translator; + + BOOST_CHECK( + std::equal( + translator(BOOST_MAKE_PFTO_WRAPPER(xml_escaped)), + translator(BOOST_MAKE_PFTO_WRAPPER(xml_escaped + size)), + xml + ) + ); +} + +template +void test_transform_width(unsigned int size){ + // test transform_width + char rawdata[8]; + + char * rptr; + for(rptr = rawdata + 6; rptr-- > rawdata;) + *rptr = std::rand(); + + // convert 8 to 6 bit characters + typedef boost::archive::iterators::transform_width< + char *, BitsOut, BitsIn + > translator1; + + std::vector v6; + + std::copy( + translator1(BOOST_MAKE_PFTO_WRAPPER(static_cast(rawdata))), + translator1(BOOST_MAKE_PFTO_WRAPPER(rawdata + size)), + std::back_inserter(v6) + ); + + // check to see we got the expected # of characters out + if(0 == size) + BOOST_CHECK(v6.size() == 0); + else + BOOST_CHECK(v6.size() == (size * BitsIn - 1 ) / BitsOut + 1); + + typedef boost::archive::iterators::transform_width< + std::vector::iterator, BitsIn, BitsOut + > translator2; + + BOOST_CHECK( + std::equal( + rawdata, + rawdata + size, + translator2(BOOST_MAKE_PFTO_WRAPPER(v6.begin())) + ) + ); + +} + +template +void test_stream_iterators( + const CharType * test_data, + unsigned int size +){ + std::basic_stringstream ss; + boost::archive::iterators::ostream_iterator osi = + boost::archive::iterators::ostream_iterator(ss); + std::copy(test_data, test_data + size, osi); + + BOOST_CHECK(size == ss.str().size()); + + boost::archive::iterators::istream_iterator isi = + boost::archive::iterators::istream_iterator(ss); + BOOST_CHECK(std::equal(test_data, test_data + size,isi)); +} + +int +test_main(int /* argc */, char* /* argv */ [] ) +{ + const char xml[] = "<+>+&+\"+'"; + const char xml_escaped[] = "<+>+&+"+'"; + test_xml_escape( + xml_escaped, + xml, + sizeof(xml) / sizeof(char) - 1 + ); + test_xml_unescape( + xml, + xml_escaped, + sizeof(xml_escaped) / sizeof(char) - 1 + ); + + const char a[] = "abcdefghijklmnopqrstuvwxyz"; + + #ifndef BOOST_NO_CWCHAR + const wchar_t wxml[] = L"<+>+&+\"+'"; + const wchar_t wxml_escaped[] = L"<+>+&+"+'"; + test_xml_escape( + wxml_escaped, + wxml, + sizeof(wxml) / sizeof(wchar_t) - 1 + ); + test_xml_unescape( + wxml, + wxml_escaped, + sizeof(wxml_escaped) / sizeof(wchar_t) - 1 + ); + + const wchar_t la[] = L"abcdefghijklmnopqrstuvwxyz"; + + test_wchar_from_mb(la, a, sizeof(a) / sizeof(char) - 1); + test_mb_from_wchar(a, la, sizeof(la) / sizeof(wchar_t) - 1); + + test_stream_iterators(la, sizeof(la)/sizeof(wchar_t) - 1); + #endif + + test_stream_iterators(a, sizeof(a) - 1); + + test_transform_width<6, 8>(0); + test_transform_width<6, 8>(1); + test_transform_width<6, 8>(2); + test_transform_width<6, 8>(3); + test_transform_width<6, 8>(4); + test_transform_width<6, 8>(5); + test_transform_width<6, 8>(6); + test_transform_width<6, 8>(7); + test_transform_width<6, 8>(8); + + return EXIT_SUCCESS; +} diff --git a/deal.II/contrib/boost/libs/serialization/performance/performance_iterators_base64.cpp b/deal.II/contrib/boost/libs/serialization/performance/performance_iterators_base64.cpp new file mode 100644 index 0000000000..662ea6cf75 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/performance/performance_iterators_base64.cpp @@ -0,0 +1,100 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_iterators.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) + +#include +#include + +#if (defined _MSC_VER) && (_MSC_VER == 1200) +# pragma warning (disable : 4786) // too long name, harmless warning +#endif + +#include +#include // size_t + +#include +#ifdef BOOST_NO_STDC_NAMESPACE +namespace std{ + using ::rand; + using ::size_t; +} +#endif + +#include + +#include +#include +#include +#include +#include + +#include "../test/test_tools.hpp" + +#include + +template +void test_base64(){ + CharType rawdata[150]; + std::size_t size = sizeof(rawdata) / sizeof(CharType); + CharType * rptr; + for(rptr = rawdata + size; rptr-- > rawdata;) + *rptr = std::rand(); + + // convert to base64 + typedef std::list text_base64_type; + text_base64_type text_base64; + + typedef + boost::archive::iterators::insert_linebreaks< + boost::archive::iterators::base64_from_binary< + boost::archive::iterators::transform_width< + CharType * + ,6 + ,sizeof(CharType) * 8 + > + > + ,72 + > + translate_out; + + std::copy( + translate_out(BOOST_MAKE_PFTO_WRAPPER(static_cast(rawdata))), + translate_out(BOOST_MAKE_PFTO_WRAPPER(rawdata + size)), + std::back_inserter(text_base64) + ); + + // convert from base64 to binary and compare with the original + typedef + boost::archive::iterators::transform_width< + boost::archive::iterators::binary_from_base64< + boost::archive::iterators::remove_whitespace< + BOOST_DEDUCED_TYPENAME text_base64_type::iterator + > + >, + sizeof(CharType) * 8, + 6 + > translate_in; + + BOOST_CHECK( + std::equal( + rawdata, + rawdata + size, + translate_in(BOOST_MAKE_PFTO_WRAPPER(text_base64.begin())) + ) + ); + +} + +int +test_main( int argc, char* argv[] ) +{ + test_base64(); + #ifndef BOOST_NO_CWCHAR + test_base64(); + #endif + return EXIT_SUCCESS; +} diff --git a/deal.II/contrib/boost/libs/serialization/performance/performance_no_rtti.cpp b/deal.II/contrib/boost/libs/serialization/performance/performance_no_rtti.cpp new file mode 100644 index 0000000000..bebafe7839 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/performance/performance_no_rtti.cpp @@ -0,0 +1,222 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_no_rtti.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) + +// note: this program tests the inter-operability of different +// extended typeinfo systems. In this example, one class is +// identified using the default RTTI while the other uses a custom +// system based on the export key. +// +// As this program uses RTTI for one of the types, the test will fail +// on a system for which RTTI is not enabled or not existent. + +#include + +#include // remove +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::remove; +} +#endif + +#include +#include + +#include +#include "../test/test_tools.hpp" +#include +// #include +// the following fails with (only!) gcc 3.4 +// #include BOOST_PP_STRINGIZE(BOOST_PP_CAT(../test/,BOOST_ARCHIVE_TEST)) +// just copy over the files from the test directory +#include BOOST_PP_STRINGIZE(BOOST_ARCHIVE_TEST) + +#include +#include +#include +#include +#include + +class polymorphic_base +{ + friend class boost::serialization::access; + template + void serialize(Archive & /* ar */, const unsigned int /* file_version */){ + } +public: + virtual const char * get_key() const = 0; + virtual ~polymorphic_base(){}; +}; + +BOOST_IS_ABSTRACT(polymorphic_base) +BOOST_CLASS_TYPE_INFO( + polymorphic_base, + extended_type_info_no_rtti +) +// 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 + 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 +) +BOOST_CLASS_EXPORT(polymorphic_derived1) + +const char * polymorphic_derived1::get_key() const { + const boost::serialization::extended_type_info *eti + = boost::serialization::type_info_implementation + ::type::get_instance(); + return eti->get_key(); +} + +class polymorphic_derived2 : public polymorphic_base +{ + friend class boost::serialization::access; + template + 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 +) + +BOOST_CLASS_EXPORT(polymorphic_derived2) + +const char * polymorphic_derived2::get_key() const { + // use the exported key as the identifier + const boost::serialization::extended_type_info *eti + = boost::serialization::type_info_implementation + ::type::get_instance(); + return eti->get_key(); +} + +// save derived polymorphic class +void save_derived(const char *testfile) +{ + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + + polymorphic_derived1 *rd1 = new polymorphic_derived1; + polymorphic_derived2 *rd2 = new polymorphic_derived2; + + oa << BOOST_SERIALIZATION_NVP(rd1); + oa << BOOST_SERIALIZATION_NVP(rd2); + + // the above opereration registers the derived classes as a side + // effect. Hence, instances can now be correctly serialized through + // a base class pointer. + polymorphic_base *rb1 = rd1; + polymorphic_base *rb2 = rd2; + oa << BOOST_SERIALIZATION_NVP(rb1); + oa << BOOST_SERIALIZATION_NVP(rb2); + + delete rd1; + delete rd2; +} + +// save derived polymorphic class +void load_derived(const char *testfile) +{ + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + + polymorphic_derived1 *rd1 = NULL; + polymorphic_derived2 *rd2 = NULL; + + ia >> BOOST_SERIALIZATION_NVP(rd1); + + BOOST_CHECK_MESSAGE( + boost::serialization::type_info_implementation + ::type::get_instance() + == boost::serialization::type_info_implementation + ::type::get_derived_extended_type_info(*rd1), + "restored pointer d1 not of correct type" + ); + + ia >> BOOST_SERIALIZATION_NVP(rd2); + + BOOST_CHECK_MESSAGE( + boost::serialization::type_info_implementation + ::type::get_instance() + == boost::serialization::type_info_implementation + ::type::get_derived_extended_type_info(*rd2), + "restored pointer d2 not of correct type" + ); + + polymorphic_base *rb1 = NULL; + polymorphic_base *rb2 = NULL; + + // the above opereration registers the derived classes as a side + // effect. Hence, instances can now be correctly serialized through + // a base class pointer. + ia >> BOOST_SERIALIZATION_NVP(rb1); + + BOOST_CHECK_MESSAGE( + rb1 == dynamic_cast(rd1), + "serialized pointers not correctly restored" + ); + + BOOST_CHECK_MESSAGE( + boost::serialization::type_info_implementation + ::type::get_instance() + == boost::serialization::type_info_implementation + ::type::get_derived_extended_type_info(*rb1), + "restored pointer b1 not of correct type" + ); + + ia >> BOOST_SERIALIZATION_NVP(rb2); + + BOOST_CHECK_MESSAGE( + rb2 == dynamic_cast(rd2), + "serialized pointers not correctly restored" + ); + + BOOST_CHECK_MESSAGE( + boost::serialization::type_info_implementation + ::type::get_instance() + == boost::serialization::type_info_implementation + ::type::get_derived_extended_type_info(*rb2), + "restored pointer b2 not of correct type" + ); + + delete rb1; + delete rb2; +} + +int +test_main( int /* argc */, char* /* argv */[] ) +{ + const char * testfile = boost::archive::tmpnam(NULL); + + BOOST_REQUIRE(NULL != testfile); + + save_derived(testfile); + load_derived(testfile); + + std::remove(testfile); + return EXIT_SUCCESS; +} + +// EOF diff --git a/deal.II/contrib/boost/libs/serialization/performance/performance_polymorphic.cpp b/deal.II/contrib/boost/libs/serialization/performance/performance_polymorphic.cpp new file mode 100644 index 0000000000..50bc21be23 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/performance/performance_polymorphic.cpp @@ -0,0 +1,104 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_polymorphic.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) + +// should pass compilation and execution + +#include + +#include // remove +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::remove; +} +#endif + +#include "../test/test_tools.hpp" + +#if !defined(BOOST_ARCHIVE_TEST) +#define BOOST_ARCHIVE_TEST polymorphic_text_archive.hpp +#endif + +// the following is to ensure that when one of the libraries changes +// BJAM rebuilds and relinks the test. +/* +#include "polymorphic_text_archive.hpp" +#include "polymorphic_text_warchive.hpp" +#include "polymorphic_binary_archive.hpp" +#include "polymorphic_xml_archive.hpp" +#include "polymorphic_xml_warchive.hpp" +*/ + +#include +// #include +// the following fails with (only!) gcc 3.4 +// #include BOOST_PP_STRINGIZE(BOOST_PP_CAT(../test/,BOOST_ARCHIVE_TEST)) +// just copy over the files from the test directory +#include BOOST_PP_STRINGIZE(BOOST_ARCHIVE_TEST) + +#include +#include + +#include +#include "../test/test_polymorphic_A.hpp" + +int test_main(int /* argc */, char * /* argv */ []) +{ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + const data d; + data d1; + // test using using polymorphic interface + { + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa_implementation(os); + boost::archive::polymorphic_oarchive & oa_interface = oa_implementation; + oa_interface << BOOST_SERIALIZATION_NVP(d); + } + { + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia_implementation(is); + boost::archive::polymorphic_iarchive & ia_interface = ia_implementation; + ia_interface >> BOOST_SERIALIZATION_NVP(d1); + } + BOOST_CHECK(d == d1); + std::remove(testfile); + + // test using using polymorphic implementation. + { + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa_implementation(os); + oa_implementation << BOOST_SERIALIZATION_NVP(d); + } + { + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia_implementation(is); + ia_implementation >> BOOST_SERIALIZATION_NVP(d1); + } + BOOST_CHECK(d == d1); + std::remove(testfile); + + // test using using polymorphic implementation. + { + test_ostream os(testfile, TEST_STREAM_FLAGS); + boost::archive::polymorphic_oarchive * oa_implementation + = new test_oarchive(os); + *oa_implementation << BOOST_SERIALIZATION_NVP(d); + delete oa_implementation; + } + { + test_istream is(testfile, TEST_STREAM_FLAGS); + boost::archive::polymorphic_iarchive * ia_implementation + = new test_iarchive(is); + *ia_implementation >> BOOST_SERIALIZATION_NVP(d1); + delete ia_implementation; + } + BOOST_CHECK(d == d1); + std::remove(testfile); + return EXIT_SUCCESS; +} diff --git a/deal.II/contrib/boost/libs/serialization/performance/performance_simple_class.cpp b/deal.II/contrib/boost/libs/serialization/performance/performance_simple_class.cpp new file mode 100644 index 0000000000..3f936078af --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/performance/performance_simple_class.cpp @@ -0,0 +1,55 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_simple_class.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) + +// should pass compilation and execution + +// invoke header for a custom archive test. + +#include + +#include // remove +#include + +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::remove; +} +#endif + +#include "../test/test_tools.hpp" +#include +// #include +// the following fails with (only!) gcc 3.4 +// #include BOOST_PP_STRINGIZE(BOOST_PP_CAT(../test/,BOOST_ARCHIVE_TEST)) +// just copy over the files from the test directory +#include BOOST_PP_STRINGIZE(BOOST_ARCHIVE_TEST) + +#include +#include "../test/A.hpp" + +int +test_main( int /* argc */, char* /* argv */[] ) +{ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + + A a, a1; + { + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + oa << boost::serialization::make_nvp("a", a); + } + { + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + ia >> boost::serialization::make_nvp("a", a1); + } + BOOST_CHECK_EQUAL(a, a1); + std::remove(testfile); + return (a == a1) ? EXIT_SUCCESS : EXIT_SUCCESS; +} diff --git a/deal.II/contrib/boost/libs/serialization/performance/performance_utf8_codecvt.cpp b/deal.II/contrib/boost/libs/serialization/performance/performance_utf8_codecvt.cpp new file mode 100644 index 0000000000..2562f4a712 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/performance/performance_utf8_codecvt.cpp @@ -0,0 +1,248 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_utf8_codecvt.cpp + +// (C) Copyright 2002-4 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) + +#include +#include +#include +#include +#include +#include +#include + +#include // size_t +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::size_t; +} // namespace std +#endif + +#include +#ifdef BOOST_NO_STDC_NAMESPACE +namespace std{ using ::wcslen; } +#endif + +#include "../test/test_tools.hpp" +#include +#include + +#include +#include + +template +struct test_data +{ + static unsigned char utf8_encoding[]; + static wchar_t wchar_encoding[]; +}; + +template<> +unsigned char test_data<2>::utf8_encoding[] = { + 0x01, + 0x7f, + 0xc2, 0x80, + 0xdf, 0xbf, + 0xe0, 0xa0, 0x80, + 0xe7, 0xbf, 0xbf +}; + +template<> +wchar_t test_data<2>::wchar_encoding[] = { + 0x0001, + 0x007f, + 0x0080, + 0x07ff, + 0x0800, + 0x7fff +}; + +template<> +unsigned char test_data<4>::utf8_encoding[] = { + 0x01, + 0x7f, + 0xc2, 0x80, + 0xdf, 0xbf, + 0xe0, 0xa0, 0x80, + 0xef, 0xbf, 0xbf, + 0xf0, 0x90, 0x80, 0x80, + 0xf4, 0x8f, 0xbf, 0xbf, + 0xf7, 0xbf, 0xbf, 0xbf, + 0xf8, 0x88, 0x80, 0x80, 0x80, + 0xfb, 0xbf, 0xbf, 0xbf, 0xbf, + 0xfc, 0x84, 0x80, 0x80, 0x80, 0x80, + 0xfd, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf +}; + +template<> +wchar_t test_data<4>::wchar_encoding[] = { + 0x00000001, + 0x0000007f, + 0x00000080, + 0x000007ff, + 0x00000800, + 0x0000ffff, + 0x00010000, + 0x0010ffff, + 0x001fffff, + 0x00200000, + 0x03ffffff, + 0x04000000, + 0x7fffffff +}; + +int +test_main(int /* argc */, char * /* argv */[]) { + std::locale old_loc; + std::locale * utf8_locale + = boost::archive::add_facet( + old_loc, + new boost::archive::detail::utf8_codecvt_facet + ); + + typedef char utf8_t; + typedef test_data td; + + // Send our test UTF-8 data to file + { + std::ofstream ofs; + ofs.open("test.dat", std::ios::binary); + std::copy( + td::utf8_encoding, + #if ! defined(__BORLANDC__) + // borland 5.60 complains about this + td::utf8_encoding + sizeof(td::utf8_encoding) / sizeof(unsigned char), + #else + // so use this instead + td::utf8_encoding + 12, + #endif + boost::archive::iterators::ostream_iterator(ofs) + ); + } + + // Read the test data back in, converting to UCS-4 on the way in + std::vector from_file; + { + std::wifstream ifs; + ifs.imbue(*utf8_locale); + ifs.open("test.dat"); + + wchar_t item = 0; + // note can't use normal vector from iterator constructor because + // dinkumware doesn't have it. + for(;;){ + item = ifs.get(); + if(item == WEOF) + break; + //ifs >> item; + //if(ifs.eof()) + // break; + from_file.push_back(item); + } + } + + // compare the data read back in with the orginal + #if ! defined(__BORLANDC__) + // borland 5.60 complains about this + BOOST_CHECK(from_file.size() == sizeof(td::wchar_encoding)/sizeof(wchar_t)); + #else + // so use this instead + BOOST_CHECK(from_file.size() == 6); + #endif + + BOOST_CHECK(std::equal(from_file.begin(), from_file.end(), td::wchar_encoding)); + + // Send the UCS4_data back out, converting to UTF-8 + { + std::wofstream ofs; + ofs.imbue(*utf8_locale); + ofs.open("test2.dat"); + std::copy( + from_file.begin(), + from_file.end(), + boost::archive::iterators::ostream_iterator(ofs) + ); + } + + // Make sure that both files are the same + { + typedef boost::archive::iterators::istream_iterator is_iter; + is_iter end_iter; + + std::ifstream ifs1("test.dat"); + is_iter it1(ifs1); + std::vector data1; + std::copy(it1, end_iter, std::back_inserter(data1)); + + std::ifstream ifs2("test2.dat"); + is_iter it2(ifs2); + std::vector data2; + std::copy(it2, end_iter, std::back_inserter(data2)); + + BOOST_CHECK(data1 == data2); + } + + // some libraries have trouble that only shows up with longer strings + + wchar_t * test3_data = L"\ + \ + \ + \ + \ + 1\ + 96953204\ + 177129195\ + 1\ + 5627\ + 23010\ + 7419\ +

    16212

    \ + 4086\ + 2749\ + -33\ + 124\ + 28\ + 32225\ + 17543\ + 0.84431422\ + 1.0170664757130923\ + tjbx\ + cuwjentqpkejp\ +
    \ +
    \ + "; + + // Send the UCS4_data back out, converting to UTF-8 + std::size_t l = std::wcslen(test3_data); + { + std::wofstream ofs; + ofs.imbue(*utf8_locale); + ofs.open("test3.dat"); + std::copy( + test3_data, + test3_data + l, + boost::archive::iterators::ostream_iterator(ofs) + ); + } + + // Make sure that both files are the same + { + std::wifstream ifs; + ifs.imbue(*utf8_locale); + ifs.open("test3.dat"); + BOOST_CHECK( + std::equal( + test3_data, + test3_data + l, + boost::archive::iterators::istream_iterator(ifs) + ) + ); + } + + delete utf8_locale; + return EXIT_SUCCESS; +} diff --git a/deal.II/contrib/boost/libs/serialization/performance/performance_vector.cpp b/deal.II/contrib/boost/libs/serialization/performance/performance_vector.cpp new file mode 100644 index 0000000000..f415c6ea27 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/performance/performance_vector.cpp @@ -0,0 +1,70 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_vector.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) + +// should pass compilation and execution + +#include + +#include // remove +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::remove; +} +#endif + +#include "../test/test_tools.hpp" +#include +// #include +// the following fails with (only!) gcc 3.4 +// #include BOOST_PP_STRINGIZE(BOOST_PP_CAT(../test/,BOOST_ARCHIVE_TEST)) +// just copy over the files from the test directory +#include BOOST_PP_STRINGIZE(BOOST_ARCHIVE_TEST) +#include + +#include "../test/A.hpp" + +template +int test_vector(T) +{ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + + // test array of objects + std::vector avector; + avector.push_back(T()); + avector.push_back(T()); + { + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + oa << boost::serialization::make_nvp("avector", avector); + } + std::vector avector1; + { + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + ia >> boost::serialization::make_nvp("avector", avector1); + } + BOOST_CHECK(avector == avector1); + std::remove(testfile); + return EXIT_SUCCESS; +} + +int test_main( int /* argc */, char* /* argv */[] ) +{ + int res = test_vector(A()); + // test an int vector for which optimized versions should be available + if (res == EXIT_SUCCESS) + res = test_vector(0); + // test a bool vector + if (res == EXIT_SUCCESS) + res = test_vector(false); + return res; +} + +// EOF diff --git a/deal.II/contrib/boost/libs/serialization/performance/polymorphic_array_binary_archive.hpp b/deal.II/contrib/boost/libs/serialization/performance/polymorphic_array_binary_archive.hpp new file mode 100644 index 0000000000..5097433aaa --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/performance/polymorphic_array_binary_archive.hpp @@ -0,0 +1,13 @@ +// (C) Copyright 2002-4 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 +typedef boost::archive::polymorphic_binary_oarchive test_oarchive; +typedef std::ofstream test_ostream; +#include +typedef boost::archive::polymorphic_binary_iarchive test_iarchive; +typedef std::ifstream test_istream; +#define TEST_STREAM_FLAGS std::ios::binary diff --git a/deal.II/contrib/boost/libs/serialization/performance/polymorphic_binary_archive.hpp b/deal.II/contrib/boost/libs/serialization/performance/polymorphic_binary_archive.hpp new file mode 100644 index 0000000000..5097433aaa --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/performance/polymorphic_binary_archive.hpp @@ -0,0 +1,13 @@ +// (C) Copyright 2002-4 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 +typedef boost::archive::polymorphic_binary_oarchive test_oarchive; +typedef std::ofstream test_ostream; +#include +typedef boost::archive::polymorphic_binary_iarchive test_iarchive; +typedef std::ifstream test_istream; +#define TEST_STREAM_FLAGS std::ios::binary diff --git a/deal.II/contrib/boost/libs/serialization/performance/polymorphic_text_archive.hpp b/deal.II/contrib/boost/libs/serialization/performance/polymorphic_text_archive.hpp new file mode 100644 index 0000000000..c8184b1579 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/performance/polymorphic_text_archive.hpp @@ -0,0 +1,13 @@ +// (C) Copyright 2002-4 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 +typedef boost::archive::polymorphic_text_oarchive test_oarchive; +typedef std::ofstream test_ostream; +#include +typedef boost::archive::polymorphic_text_iarchive test_iarchive; +typedef std::ifstream test_istream; +#define TEST_STREAM_FLAGS (std::ios_base::openmode)0 diff --git a/deal.II/contrib/boost/libs/serialization/performance/polymorphic_text_warchive.hpp b/deal.II/contrib/boost/libs/serialization/performance/polymorphic_text_warchive.hpp new file mode 100644 index 0000000000..4a5774c83e --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/performance/polymorphic_text_warchive.hpp @@ -0,0 +1,18 @@ +// (C) Copyright 2002-4 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 +#ifdef BOOST_NO_STD_WSTREAMBUF +#error "wide char i/o not supported on this platform" +#else +#include +typedef boost::archive::polymorphic_text_woarchive test_oarchive; +typedef std::wofstream test_ostream; +#include +typedef boost::archive::polymorphic_text_wiarchive test_iarchive; +typedef std::wifstream test_istream; +#define TEST_STREAM_FLAGS (std::ios_base::openmode)0 +#endif diff --git a/deal.II/contrib/boost/libs/serialization/performance/polymorphic_xml_archive.hpp b/deal.II/contrib/boost/libs/serialization/performance/polymorphic_xml_archive.hpp new file mode 100644 index 0000000000..849d1a02db --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/performance/polymorphic_xml_archive.hpp @@ -0,0 +1,13 @@ +// (C) Copyright 2002-4 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 +typedef boost::archive::polymorphic_xml_oarchive test_oarchive; +typedef std::ofstream test_ostream; +#include +typedef boost::archive::polymorphic_xml_iarchive test_iarchive; +typedef std::ifstream test_istream; +#define TEST_STREAM_FLAGS (std::ios_base::openmode)0 diff --git a/deal.II/contrib/boost/libs/serialization/performance/polymorphic_xml_warchive.hpp b/deal.II/contrib/boost/libs/serialization/performance/polymorphic_xml_warchive.hpp new file mode 100644 index 0000000000..1f5c5ff0af --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/performance/polymorphic_xml_warchive.hpp @@ -0,0 +1,13 @@ +// (C) Copyright 2002-4 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 +typedef boost::archive::polymorphic_xml_woarchive test_oarchive; +typedef std::wofstream test_ostream; +#include +typedef boost::archive::polymorphic_xml_wiarchive test_iarchive; +typedef std::wifstream test_istream; +#define TEST_STREAM_FLAGS (std::ios_base::openmode)0 diff --git a/deal.II/contrib/boost/libs/serialization/performance/portable_binary_archive.hpp b/deal.II/contrib/boost/libs/serialization/performance/portable_binary_archive.hpp new file mode 100644 index 0000000000..c1377c92e7 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/performance/portable_binary_archive.hpp @@ -0,0 +1,22 @@ +// (C) Copyright 2002-4 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.// file includes for testing a custom archive. +// as an example this tests the portable binary archive + +// #include output archive header +#include "../example/portable_binary_oarchive.hpp" +// define output archive class to be used +typedef portable_binary_oarchive test_oarchive; +// and corresponding stream +typedef std::ofstream test_ostream; + +// repeat the above for correspondng input archive +#include "../example/portable_binary_iarchive.hpp" +typedef portable_binary_iarchive test_iarchive; +typedef std::ifstream test_istream; + +// and stream open flags +#define TEST_STREAM_FLAGS std::ios::binary diff --git a/deal.II/contrib/boost/libs/serialization/performance/profile.sh b/deal.II/contrib/boost/libs/serialization/performance/profile.sh new file mode 100755 index 0000000000..95ae42022d --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/performance/profile.sh @@ -0,0 +1,39 @@ +# build and run the tests leaving the executables in place + +# (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) + +# profile.sh --toolset=gcc preserve-test-targets=on variant=profile +if test $# -eq 0 +then + echo "Usage: $0 " + echo "Typical bjam arguements are:" + echo " toolset=msvc-7.1,gcc" + echo " link=static,shared" + echo " threading=single,multi" + echo " -sBOOST_ARCHIVE_LIST=" +else + bjam --dump-tests variant=profile preserve-test-targets=on $@ >bjam.log 2>&1 + process_jam_log --v2 $dir/profile.txt + done + done + + library_status library_status.html links.html +fi diff --git a/deal.II/contrib/boost/libs/serialization/performance/text_archive.hpp b/deal.II/contrib/boost/libs/serialization/performance/text_archive.hpp new file mode 100644 index 0000000000..e7e1b3ca4a --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/performance/text_archive.hpp @@ -0,0 +1,14 @@ +// (C) Copyright 2002-4 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. +// text_archive +#include +typedef boost::archive::text_oarchive test_oarchive; +typedef std::ofstream test_ostream; +#include +typedef boost::archive::text_iarchive test_iarchive; +typedef std::ifstream test_istream; +#define TEST_STREAM_FLAGS (std::ios_base::openmode)0 diff --git a/deal.II/contrib/boost/libs/serialization/performance/text_warchive.hpp b/deal.II/contrib/boost/libs/serialization/performance/text_warchive.hpp new file mode 100644 index 0000000000..de7dea01ba --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/performance/text_warchive.hpp @@ -0,0 +1,19 @@ +// (C) Copyright 2002-4 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. +// text_warchive +#include +typedef boost::archive::text_woarchive test_oarchive; +typedef std::wofstream test_ostream; +#include +typedef boost::archive::text_wiarchive test_iarchive; +typedef std::wifstream test_istream; +#define TEST_STREAM_FLAGS (std::ios_base::openmode)0 + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/performance/xml_archive.hpp b/deal.II/contrib/boost/libs/serialization/performance/xml_archive.hpp new file mode 100644 index 0000000000..1e3bdc1ac3 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/performance/xml_archive.hpp @@ -0,0 +1,16 @@ +// (C) Copyright 2002-4 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. +// xml_archive +#include +typedef boost::archive::xml_oarchive test_oarchive; +typedef std::ofstream test_ostream; +#include +typedef boost::archive::xml_iarchive test_iarchive; +typedef std::ifstream test_istream; +#define TEST_STREAM_FLAGS (std::ios_base::openmode)0 + + diff --git a/deal.II/contrib/boost/libs/serialization/performance/xml_warchive.hpp b/deal.II/contrib/boost/libs/serialization/performance/xml_warchive.hpp new file mode 100644 index 0000000000..3483e22577 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/performance/xml_warchive.hpp @@ -0,0 +1,16 @@ +// (C) Copyright 2002-4 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. +// xml_warchive +#include +typedef boost::archive::xml_woarchive test_oarchive; +typedef std::wofstream test_ostream; +#include +typedef boost::archive::xml_wiarchive test_iarchive; +typedef std::wifstream test_istream; +#define TEST_STREAM_FLAGS (std::ios_base::openmode)0 + + diff --git a/deal.II/contrib/boost/libs/serialization/src/archive_exception.cpp b/deal.II/contrib/boost/libs/serialization/src/archive_exception.cpp new file mode 100644 index 0000000000..08cbe48095 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/src/archive_exception.cpp @@ -0,0 +1,110 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// archive_exception.cpp: + +// (C) Copyright 2009 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. + +#if (defined _MSC_VER) && (_MSC_VER == 1200) +# pragma warning (disable : 4786) // too long name, harmless warning +#endif + +#include +#include +#include + +#define BOOST_ARCHIVE_SOURCE +#include + +namespace boost { +namespace archive { + +BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) +archive_exception::archive_exception( + exception_code c, + const char * e1, + const char * e2 +) : + code(c) +{ + m_msg = "programming error"; + switch(code){ + case no_exception: + m_msg = "uninitialized exception"; + break; + case unregistered_class: + m_msg = "unregistered class"; + if(NULL != e1){ + m_msg += " - "; + m_msg += e1; + } + break; + case invalid_signature: + m_msg = "invalid signature"; + break; + case unsupported_version: + m_msg = "unsupported version"; + break; + case pointer_conflict: + m_msg = "pointer conflict"; + break; + case incompatible_native_format: + m_msg = "incompatible native format"; + if(NULL != e1){ + m_msg += " - "; + m_msg += e1; + } + break; + case array_size_too_short: + m_msg = "array size too short"; + break; + case stream_error: + m_msg = "stream error"; + break; + case invalid_class_name: + m_msg = "class name too long"; + break; + case unregistered_cast: + m_msg = "unregistered void cast "; + m_msg += (NULL != e1) ? e1 : "?"; + m_msg += "<-"; + m_msg += (NULL != e2) ? e2 : "?"; + break; + case unsupported_class_version: + m_msg = "class version"; + break; + case other_exception: + // if get here - it indicates a derived exception + // was sliced by passing by value in catch + m_msg = "unknown derived exception"; + break; + case multiple_code_instantiation: + m_msg = "code instantiated in more than one module"; + if(NULL != e1){ + m_msg += " - "; + m_msg += e1; + } + break; + default: + assert(false); + break; + } +} +BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) +archive_exception::~archive_exception() throw () {} + +BOOST_ARCHIVE_DECL(const char *) +archive_exception::what( ) const throw() +{ + return m_msg.c_str(); +} +BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) +archive_exception::archive_exception() : + code(no_exception) +{} + +} // archive +} // boost diff --git a/deal.II/contrib/boost/libs/serialization/src/basic_archive.cpp b/deal.II/contrib/boost/libs/serialization/src/basic_archive.cpp new file mode 100644 index 0000000000..a2a7d83ef2 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/src/basic_archive.cpp @@ -0,0 +1,68 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_archive.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. + +////////////////////////////////////////////////////////////////////// +// +// objects are stored as +// +// class_id* // -1 for a null pointer +// if a new class id +// [ +// exported key - class name* +// tracking level - always/never +// class version +// ] +// +// if tracking +// [ +// object_id +// ] +// +// [ // if a new object id +// data... +// ] +// +// * required only for pointers - optional for objects + +#define BOOST_ARCHIVE_SOURCE +#include + +namespace boost { +namespace archive { + +/////////////////////////////////////////////////////////////////////// +// constants used in archive signature +//This should never ever change. note that is not an std::string +// string. +BOOST_ARCHIVE_DECL(const char *) +BOOST_ARCHIVE_SIGNATURE(){ + return "serialization::archive"; +} + +// this should change if the capabilities are added to the library +// such that archives can be created which can't be read by previous +// versions of this library +// 1 - initial version +// 2 - made address tracking optional +// 3 - numerous changes - can't guarentee compatibility with previous versions +// 4 - Boost 1.34 +// added register_version to properly support versioning for collections +// 5 - Boost 1.36 +// changed serialization of collections: adding version even for primitive +// types caused backwards compatibility breaking change in 1.35 +// 6 - Boost 1.41, serializing collection sizes as std::size_t + +BOOST_ARCHIVE_DECL(version_type) +BOOST_ARCHIVE_VERSION(){ + return version_type(7); +} + +} // namespace archive +} // namespace boost diff --git a/deal.II/contrib/boost/libs/serialization/src/basic_iarchive.cpp b/deal.II/contrib/boost/libs/serialization/src/basic_iarchive.cpp new file mode 100644 index 0000000000..50da890cde --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/src/basic_iarchive.cpp @@ -0,0 +1,586 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_archive.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 // msvc 6.0 needs this to suppress warnings + +#include +#include +#include +#include +#include // size_t, NULL + +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::size_t; +} // namespace std +#endif + +#include +#include +#include +#include + +#define BOOST_ARCHIVE_SOURCE +#define BOOST_SERIALIZATION_SOURCE + +#include + +#include +#include +#include +#include +#include + +#include + +using namespace boost::serialization; + +namespace boost { +namespace archive { +namespace detail { + +class basic_iarchive_impl { + friend class basic_iarchive; + version_type m_archive_library_version; + unsigned int m_flags; + + ////////////////////////////////////////////////////////////////////// + // information about each serialized object loaded + // indexed on object_id + struct aobject + { + void * address; + bool loaded_as_pointer; + class_id_type class_id; + aobject( + void *a, + class_id_type class_id_ + ) : + address(a), + loaded_as_pointer(false), + class_id(class_id_) + {} + aobject() : + address(NULL), + loaded_as_pointer(false), + class_id(-2) + {} + }; + typedef std::vector object_id_vector_type; + object_id_vector_type object_id_vector; + + ////////////////////////////////////////////////////////////////////// + // used to implement the reset_object_address operation. + object_id_type moveable_objects_start; + object_id_type moveable_objects_end; + object_id_type moveable_objects_recent; + + void reset_object_address( + const void * new_address, + const void *old_address + ); + + ////////////////////////////////////////////////////////////////////// + // used by load object to look up class id given basic_serializer + struct cobject_type + { + const basic_iserializer * m_bis; + const class_id_type m_class_id; + cobject_type( + std::size_t class_id, + const basic_iserializer & bis + ) : + m_bis(& bis), + m_class_id(class_id) + {} + cobject_type(const cobject_type & rhs) : + m_bis(rhs.m_bis), + m_class_id(rhs.m_class_id) + {} + // the following cannot be defined because of the const + // member. This will generate a link error if an attempt + // is made to assign. This should never be necessary + cobject_type & operator=(const cobject_type & rhs); + bool operator<(const cobject_type &rhs) const + { + return *m_bis < *(rhs.m_bis); + } + }; + typedef std::set cobject_info_set_type; + cobject_info_set_type cobject_info_set; + + ////////////////////////////////////////////////////////////////////// + // information about each serialized class indexed on class_id + class cobject_id + { + public: + cobject_id & operator=(const cobject_id & rhs){ + bis_ptr = rhs.bis_ptr; + bpis_ptr = rhs.bpis_ptr; + file_version = rhs.file_version; + tracking_level = rhs.tracking_level; + initialized = rhs.initialized; + return *this; + } + const basic_iserializer * bis_ptr; + const basic_pointer_iserializer * bpis_ptr; + version_type file_version; + tracking_type tracking_level; + bool initialized; + + cobject_id(const basic_iserializer & bis_) : + bis_ptr(& bis_), + bpis_ptr(NULL), + file_version(0), + tracking_level(track_never), + initialized(false) + {} + cobject_id(const cobject_id &rhs): + bis_ptr(rhs.bis_ptr), + bpis_ptr(rhs.bpis_ptr), + file_version(rhs.file_version), + tracking_level(rhs.tracking_level), + initialized(rhs.initialized) + {} + }; + typedef std::vector cobject_id_vector_type; + cobject_id_vector_type cobject_id_vector; + + ////////////////////////////////////////////////////////////////////// + // address of the most recent object serialized as a poiner + // whose data itself is now pending serialization + void * pending_object; + const basic_iserializer * pending_bis; + version_type pending_version; + + basic_iarchive_impl(unsigned int flags) : + m_archive_library_version(BOOST_ARCHIVE_VERSION()), + m_flags(flags), + moveable_objects_start(0), + moveable_objects_end(0), + moveable_objects_recent(0), + pending_object(NULL), + pending_bis(NULL), + pending_version(0) + {} + ~basic_iarchive_impl(){} + void set_library_version(version_type archive_library_version){ + m_archive_library_version = archive_library_version; + } + bool + track( + basic_iarchive & ar, + void * & t + ); + void + load_preamble( + basic_iarchive & ar, + cobject_id & co + ); + class_id_type register_type( + const basic_iserializer & bis + ); + + // redirect through virtual functions to load functions for this archive + template + void load(basic_iarchive & ar, T & t){ + ar.vload(t); + } + +//public: + void + next_object_pointer(void * t){ + pending_object = t; + } + void delete_created_pointers(); + class_id_type register_type( + const basic_pointer_iserializer & bpis + ); + void load_object( + basic_iarchive & ar, + void * t, + const basic_iserializer & bis + ); + const basic_pointer_iserializer * load_pointer( + basic_iarchive & ar, + void * & t, + const basic_pointer_iserializer * bpis, + const basic_pointer_iserializer * (*finder)( + const boost::serialization::extended_type_info & type + ) + + ); +}; + +inline void +basic_iarchive_impl::reset_object_address( + const void * new_address, + const void *old_address +){ + // this code handles a couple of situations. + // a) where reset_object_address is applied to an untracked object. + // In such a case the call is really superfluous and its really an + // an error. But we don't have access to the types here so we can't + // know that. However, this code will effectively turn this situation + // into a no-op and every thing will work fine - albeat with a small + // execution time penalty. + // b) where the call to reset_object_address doesn't immediatly follow + // the << operator to which it corresponds. This would be a bad idea + // but the code may work anyway. Naturally, a bad practice on the part + // of the programmer but we can't detect it - as above. So maybe we + // can save a few more people from themselves as above. + object_id_type i; + for(i = moveable_objects_recent; i < moveable_objects_end; ++i){ + if(old_address == object_id_vector[i].address) + break; + } + for(; i < moveable_objects_end; ++i){ + + // calculate displacement from this level + // warning - pointer arithmetic on void * is in herently non-portable + // but expected to work on all platforms in current usage + if(object_id_vector[i].address > old_address){ + std::size_t member_displacement + = reinterpret_cast(object_id_vector[i].address) + - reinterpret_cast(old_address); + object_id_vector[i].address = reinterpret_cast( + reinterpret_cast(new_address) + member_displacement + ); + } + else{ + std::size_t member_displacement + = reinterpret_cast(old_address) + - reinterpret_cast(object_id_vector[i].address); + object_id_vector[i].address = reinterpret_cast( + reinterpret_cast(new_address) - member_displacement + ); + } + } +} + +inline void +basic_iarchive_impl::delete_created_pointers() +{ + object_id_vector_type::iterator i; + for( + i = object_id_vector.begin(); + i != object_id_vector.end(); + ++i + ){ + if(i->loaded_as_pointer){ + // borland complains without this minor hack + const int j = i->class_id; + const cobject_id & co = cobject_id_vector[j]; + //const cobject_id & co = cobject_id_vector[i->class_id]; + // with the appropriate input serializer, + // delete the indicated object + co.bis_ptr->destroy(i->address); + } + } +} + +inline class_id_type +basic_iarchive_impl::register_type( + const basic_iserializer & bis +){ + assert( + cobject_info_set.size() + <= + boost::integer_traits::const_max + ); + class_id_type cid(static_cast( + cobject_info_set.size() + )); + cobject_type co(cid, bis); + std::pair + result = cobject_info_set.insert(co); + + if(result.second){ + cobject_id_vector.push_back(cobject_id(bis)); + assert(cobject_info_set.size() == cobject_id_vector.size()); + } + cid = result.first->m_class_id; + // borland complains without this minor hack + const int tid = cid; + cobject_id & coid = cobject_id_vector[tid]; + coid.bpis_ptr = bis.get_bpis_ptr(); + return cid; +} + +void +basic_iarchive_impl::load_preamble( + basic_iarchive & ar, + cobject_id & co +){ + if(! co.initialized){ + if(co.bis_ptr->class_info()){ + class_id_optional_type cid; + load(ar, cid); // to be thrown away + load(ar, co.tracking_level); + load(ar, co.file_version); + } + else{ + // override tracking with indicator from class information + co.tracking_level = co.bis_ptr->tracking(m_flags); + co.file_version = version_type( + co.bis_ptr->version() + ); + } + co.initialized = true; + } +} + +bool +basic_iarchive_impl::track( + basic_iarchive & ar, + void * & t +){ + object_id_type oid; + load(ar, oid); + + // if its a reference to a old object + if(object_id_type(object_id_vector.size()) > oid){ + // we're done + t = object_id_vector[oid].address; + return false; + } + return true; +} + +inline void +basic_iarchive_impl::load_object( + basic_iarchive & ar, + void * t, + const basic_iserializer & bis +){ + // if its been serialized through a pointer and the preamble's been done + if(t == pending_object && & bis == pending_bis){ + // read data + (bis.load_object_data)(ar, t, pending_version); + return; + } + + const class_id_type cid = register_type(bis); + const int i = cid; + cobject_id & co = cobject_id_vector[i]; + + load_preamble(ar, co); + + // save the current move stack position in case we want to truncate it + boost::serialization::state_saver w(moveable_objects_start); + + // note: extra line used to evade borland issue + const bool tracking = co.tracking_level; + + object_id_type this_id; + moveable_objects_start = + this_id = object_id_vector.size(); + + // if we tracked this object when the archive was saved + if(tracking){ + // if it was already read + if(!track(ar, t)) + // we're done + return; + // add a new enty into the tracking list + object_id_vector.push_back(aobject(t, cid)); + // and add an entry for this object + moveable_objects_end = object_id_vector.size(); + } + // read data + (bis.load_object_data)(ar, t, co.file_version); + moveable_objects_recent = this_id; +} + +inline const basic_pointer_iserializer * +basic_iarchive_impl::load_pointer( + basic_iarchive &ar, + void * & t, + const basic_pointer_iserializer * bpis_ptr, + const basic_pointer_iserializer * (*finder)( + const boost::serialization::extended_type_info & type_ + ) + +){ + class_id_type cid; + load(ar, cid); + + if(NULL_POINTER_TAG == cid){ + t = NULL; + return bpis_ptr; + } + + assert( + cobject_info_set.size() + <= + boost::integer_traits::const_max + ); + // if its a new class type - i.e. never been registered + if(class_id_type(cobject_info_set.size()) <= cid){ + // if its either abstract + if(NULL == bpis_ptr + // or polymorphic + || bpis_ptr->get_basic_serializer().is_polymorphic()){ + // is must have been exported + char key[BOOST_SERIALIZATION_MAX_KEY_SIZE]; + class_name_type class_name(key); + load(ar, class_name); + // if it has a class name + const serialization::extended_type_info *eti = NULL; + if(0 != key[0]) + eti = serialization::extended_type_info::find(key); + if(NULL == eti) + boost::serialization::throw_exception( + archive_exception(archive_exception::unregistered_class) + ); + bpis_ptr = (*finder)(*eti); + } + assert(NULL != bpis_ptr); + class_id_type new_cid = register_type(bpis_ptr->get_basic_serializer()); + int i = cid; + cobject_id_vector[i].bpis_ptr = bpis_ptr; + assert(new_cid == cid); + } + int i = cid; + cobject_id & co = cobject_id_vector[i]; + bpis_ptr = co.bpis_ptr; + + load_preamble(ar, co); + + // extra line to evade borland issue + const bool tracking = co.tracking_level; + // if we're tracking and the pointer has already been read + if(tracking && ! track(ar, t)) + // we're done + return bpis_ptr; + + // save state + serialization::state_saver w_start(moveable_objects_start); + + if(! tracking){ + bpis_ptr->load_object_ptr(ar, t, co.file_version); + } + else{ + serialization::state_saver x(pending_object); + serialization::state_saver y(pending_bis); + serialization::state_saver z(pending_version); + + pending_bis = & bpis_ptr->get_basic_serializer(); + pending_version = co.file_version; + + // predict next object id to be created + const unsigned int ui = object_id_vector.size(); + + serialization::state_saver w_end(moveable_objects_end); + + // because the following operation could move the items + // don't use co after this + // add to list of serialized objects so that we can properly handle + // cyclic strucures + object_id_vector.push_back(aobject(t, cid)); + + bpis_ptr->load_object_ptr( + ar, + object_id_vector[ui].address, + co.file_version + ); + t = object_id_vector[ui].address; + object_id_vector[ui].loaded_as_pointer = true; + assert(NULL != t); + } + + return bpis_ptr; +} + +} // namespace detail +} // namespace archive +} // namespace boost + +////////////////////////////////////////////////////////////////////// +// implementation of basic_iarchive functions +namespace boost { +namespace archive { +namespace detail { + +BOOST_ARCHIVE_DECL(void) +basic_iarchive::next_object_pointer(void *t){ + pimpl->next_object_pointer(t); +} + +BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) +basic_iarchive::basic_iarchive(unsigned int flags) : + pimpl(new basic_iarchive_impl(flags)) +{} + +BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) +basic_iarchive::~basic_iarchive() +{ + delete pimpl; +} + +BOOST_ARCHIVE_DECL(void) +basic_iarchive::set_library_version(version_type archive_library_version){ + pimpl->set_library_version(archive_library_version); +} + +BOOST_ARCHIVE_DECL(void) +basic_iarchive::reset_object_address( + const void * new_address, + const void * old_address +){ + pimpl->reset_object_address(new_address, old_address); +} + +BOOST_ARCHIVE_DECL(void) +basic_iarchive::load_object( + void *t, + const basic_iserializer & bis +){ + pimpl->load_object(*this, t, bis); +} + +// load a pointer object +BOOST_ARCHIVE_DECL(const basic_pointer_iserializer *) +basic_iarchive::load_pointer( + void * &t, + const basic_pointer_iserializer * bpis_ptr, + const basic_pointer_iserializer * (*finder)( + const boost::serialization::extended_type_info & type_ + ) + +){ + return pimpl->load_pointer(*this, t, bpis_ptr, finder); +} + +BOOST_ARCHIVE_DECL(void) +basic_iarchive::register_basic_serializer(const basic_iserializer & bis){ + pimpl->register_type(bis); +} + +BOOST_ARCHIVE_DECL(void) +basic_iarchive::delete_created_pointers() +{ + pimpl->delete_created_pointers(); +} + +BOOST_ARCHIVE_DECL(unsigned int) +basic_iarchive::get_library_version() const{ + return pimpl->m_archive_library_version; +} + +BOOST_ARCHIVE_DECL(unsigned int) +basic_iarchive::get_flags() const{ + return pimpl->m_flags; +} + +} // namespace detail +} // namespace archive +} // namespace boost diff --git a/deal.II/contrib/boost/libs/serialization/src/basic_iserializer.cpp b/deal.II/contrib/boost/libs/serialization/src/basic_iserializer.cpp new file mode 100644 index 0000000000..e18e16fe50 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/src/basic_iserializer.cpp @@ -0,0 +1,33 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_iserializer.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 // NULL + +#define BOOST_ARCHIVE_SOURCE +#include + +namespace boost { +namespace archive { +namespace detail { + +BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) +basic_iserializer::basic_iserializer( + const boost::serialization::extended_type_info & eti +) : + basic_serializer(eti), + m_bpis(NULL) +{} + +BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) +basic_iserializer::~basic_iserializer(){} + +} // namespace detail +} // namespace archive +} // namespace boost diff --git a/deal.II/contrib/boost/libs/serialization/src/basic_oarchive.cpp b/deal.II/contrib/boost/libs/serialization/src/basic_oarchive.cpp new file mode 100644 index 0000000000..21d4287c88 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/src/basic_oarchive.cpp @@ -0,0 +1,469 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_oarchive.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 // msvc 6.0 needs this for warning suppression + +#include +#include +#include // NULL + +#include +#include +#include + +// including this here to work around an ICC in intel 7.0 +// normally this would be part of basic_oarchive.hpp below. +#define BOOST_ARCHIVE_SOURCE +#define BOOST_SERIALIZATION_SOURCE + +#include +#include +#include +#include +#include +#include +#include + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4251 4231 4660 4275) +#endif + +using namespace boost::serialization; + +namespace boost { +namespace archive { +namespace detail { + +class basic_oarchive_impl { + friend class basic_oarchive; + unsigned int m_flags; + + ////////////////////////////////////////////////////////////////////// + // information about each serialized object saved + // keyed on address, class_id + struct aobject + { + const void * address; + class_id_type class_id; + object_id_type object_id; + + bool operator<(const aobject &rhs) const + { + assert(NULL != address); + assert(NULL != rhs.address); + if( address < rhs.address ) + return true; + if( address > rhs.address ) + return false; + return class_id < rhs.class_id; + } + aobject & operator=(const aobject & rhs) + { + address = rhs.address; + class_id = rhs.class_id; + object_id = rhs.object_id; + return *this; + } + aobject( + const void *a, + class_id_type class_id_, + object_id_type object_id_ + ) : + address(a), + class_id(class_id_), + object_id(object_id_) + {} + aobject() : address(NULL){} + }; + // keyed on class_id, address + typedef std::set object_set_type; + object_set_type object_set; + + ////////////////////////////////////////////////////////////////////// + // information about each serialized class saved + // keyed on type_info + struct cobject_type + { + const basic_oserializer * m_bos_ptr; + const class_id_type m_class_id; + bool m_initialized; + cobject_type( + std::size_t class_id, + const basic_oserializer & bos + ) : + m_bos_ptr(& bos), + m_class_id( + static_cast(class_id) + ), + m_initialized(false) + {} + cobject_type(const basic_oserializer & bos) + : m_bos_ptr(& bos) + {} + cobject_type( + const cobject_type & rhs + ) : + m_bos_ptr(rhs.m_bos_ptr), + m_class_id(rhs.m_class_id), + m_initialized(rhs.m_initialized) + {} + // the following cannot be defined because of the const + // member. This will generate a link error if an attempt + // is made to assign. This should never be necessary + // use this only for lookup argument + cobject_type & operator=(const cobject_type &rhs); + bool operator<(const cobject_type &rhs) const { + return *m_bos_ptr < *(rhs.m_bos_ptr); + } + }; + // keyed on type_info + typedef std::set cobject_info_set_type; + cobject_info_set_type cobject_info_set; + + // list of objects initially stored as pointers - used to detect errors + // keyed on object id + std::set stored_pointers; + + // address of the most recent object serialized as a poiner + // whose data itself is now pending serialization + const void * pending_object; + const basic_oserializer * pending_bos; + + basic_oarchive_impl(unsigned int flags) : + m_flags(flags), + pending_object(NULL), + pending_bos(NULL) + {} + + const cobject_type & + find(const basic_oserializer & bos); + const basic_oserializer * + find(const serialization::extended_type_info &ti) const; + +//public: + const cobject_type & + register_type(const basic_oserializer & bos); + void save_object( + basic_oarchive & ar, + const void *t, + const basic_oserializer & bos + ); + void save_pointer( + basic_oarchive & ar, + const void * t, + const basic_pointer_oserializer * bpos + ); +}; + +////////////////////////////////////////////////////////////////////// +// basic_oarchive implementation functions + +// given a type_info - find its bos +// return NULL if not found +inline const basic_oserializer * +basic_oarchive_impl::find(const serialization::extended_type_info & ti) const { + #ifdef BOOST_MSVC + # pragma warning(push) + # pragma warning(disable : 4511 4512) + #endif + class bosarg : + public basic_oserializer + { + bool class_info() const { + assert(false); + return false; + } + // returns true if objects should be tracked + bool tracking(const unsigned int) const { + assert(false); + return false; + } + // returns class version + version_type version() const { + assert(false); + return version_type(0); + } + // returns true if this class is polymorphic + bool is_polymorphic() const{ + assert(false); + return false; + } + void save_object_data( + basic_oarchive & /*ar*/, const void * /*x*/ + ) const { + assert(false); + } + public: + bosarg(const serialization::extended_type_info & eti) : + boost::archive::detail::basic_oserializer(eti) + {} + }; + #ifdef BOOST_MSVC + #pragma warning(pop) + #endif + bosarg bos(ti); + cobject_info_set_type::const_iterator cit + = cobject_info_set.find(cobject_type(bos)); + // it should already have been "registered" - see below + if(cit == cobject_info_set.end()){ + // if an entry is not found in the table it is because a pointer + // of a derived class has been serialized through its base class + // but the derived class hasn't been "registered" + return NULL; + } + // return pointer to the real class + return cit->m_bos_ptr; +} + +inline const basic_oarchive_impl::cobject_type & +basic_oarchive_impl::find(const basic_oserializer & bos) +{ + assert( + cobject_info_set.size() + <= + boost::integer_traits::const_max + ); + std::pair cresult = + cobject_info_set.insert(cobject_type(cobject_info_set.size(), bos)); + return *(cresult.first); +} + +inline const basic_oarchive_impl::cobject_type & +basic_oarchive_impl::register_type( + const basic_oserializer & bos +){ + assert( + cobject_info_set.size() + <= + boost::integer_traits::const_max + ); + cobject_type co(cobject_info_set.size(), bos); + std::pair + result = cobject_info_set.insert(co); + return *(result.first); +} + +inline void +basic_oarchive_impl::save_object( + basic_oarchive & ar, + const void *t, + const basic_oserializer & bos +){ + // if its been serialized through a pointer and the preamble's been done + if(t == pending_object && pending_bos == & bos){ + // just save the object data + ar.end_preamble(); + (bos.save_object_data)(ar, t); + return; + } + + // get class information for this object + const cobject_type & co = register_type(bos); + if(bos.class_info()){ + if( ! co.m_initialized){ + ar.vsave(class_id_optional_type(co.m_class_id)); + ar.vsave(tracking_type(bos.tracking(m_flags))); + ar.vsave(version_type(bos.version())); + (const_cast(co)).m_initialized = true; + } + } + + // we're not tracking this type of object + if(! bos.tracking(m_flags)){ + // just windup the preamble - no object id to write + ar.end_preamble(); + // and save the data + (bos.save_object_data)(ar, t); + return; + } + + // look for an existing object id + object_id_type oid(object_set.size()); + // lookup to see if this object has already been written to the archive + basic_oarchive_impl::aobject ao(t, co.m_class_id, oid); + std::pair + aresult = object_set.insert(ao); + oid = aresult.first->object_id; + + // if its a new object + if(aresult.second){ + // write out the object id + ar.vsave(oid); + ar.end_preamble(); + // and data + (bos.save_object_data)(ar, t); + return; + } + + // check that it wasn't originally stored through a pointer + if(stored_pointers.end() != stored_pointers.find(oid)){ + // this has to be a user error. loading such an archive + // would create duplicate objects + boost::serialization::throw_exception( + archive_exception(archive_exception::pointer_conflict) + ); + } + // just save the object id + ar.vsave(object_reference_type(oid)); + ar.end_preamble(); + return; +} + +// save a pointer to an object instance +inline void +basic_oarchive_impl::save_pointer( + basic_oarchive & ar, + const void * t, + const basic_pointer_oserializer * bpos_ptr +){ + const basic_oserializer & bos = bpos_ptr->get_basic_serializer(); + std::size_t original_count = cobject_info_set.size(); + const cobject_type & co = register_type(bos); + if(! co.m_initialized){ + ar.vsave(co.m_class_id); + // if its a previously unregistered class + if((cobject_info_set.size() > original_count)){ + if(bos.is_polymorphic()){ + const serialization::extended_type_info *eti = & bos.get_eti(); + const char * key = NULL; + if(NULL != eti) + key = eti->get_key(); + if(NULL != key){ + // the following is required by IBM C++ compiler which + // makes a copy when passing a non-const to a const. This + // is permitted by the standard but rarely seen in practice + const class_name_type cn(key); + // write out the external class identifier + ar.vsave(cn); + } + else + // without an external class name + // we won't be able to de-serialize it so bail now + boost::serialization::throw_exception( + archive_exception(archive_exception::unregistered_class) + ); + } + } + if(bos.class_info()){ + ar.vsave(tracking_type(bos.tracking(m_flags))); + ar.vsave(version_type(bos.version())); + } + (const_cast(co)).m_initialized = true; + } + else{ + ar.vsave(class_id_reference_type(co.m_class_id)); + } + + // if we're not tracking + if(! bos.tracking(m_flags)){ + // just save the data itself + ar.end_preamble(); + serialization::state_saver x(pending_object); + serialization::state_saver y(pending_bos); + pending_object = t; + pending_bos = & bpos_ptr->get_basic_serializer(); + bpos_ptr->save_object_ptr(ar, t); + return; + } + + object_id_type oid(object_set.size()); + // lookup to see if this object has already been written to the archive + basic_oarchive_impl::aobject ao(t, co.m_class_id, oid); + std::pair + aresult = object_set.insert(ao); + oid = aresult.first->object_id; + // if the saved object already exists + if(! aresult.second){ + // append the object id to he preamble + ar.vsave(object_reference_type(oid)); + // and windup. + ar.end_preamble(); + return; + } + + // append id of this object to preamble + ar.vsave(oid); + ar.end_preamble(); + + // and save the object itself + serialization::state_saver x(pending_object); + serialization::state_saver y(pending_bos); + pending_object = t; + pending_bos = & bpos_ptr->get_basic_serializer(); + bpos_ptr->save_object_ptr(ar, t); + // add to the set of object initially stored through pointers + stored_pointers.insert(oid); +} + +} // namespace detail +} // namespace archive +} // namespace boost + +////////////////////////////////////////////////////////////////////// +// implementation of basic_oarchive functions + +namespace boost { +namespace archive { +namespace detail { + +BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) +basic_oarchive::basic_oarchive(unsigned int flags) + : pimpl(new basic_oarchive_impl(flags)) +{} + +BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) +basic_oarchive::~basic_oarchive() +{ + delete pimpl; +} + +BOOST_ARCHIVE_DECL(void) +basic_oarchive::save_object( + const void *x, + const basic_oserializer & bos +){ + pimpl->save_object(*this, x, bos); +} + +BOOST_ARCHIVE_DECL(void) +basic_oarchive::save_pointer( + const void * t, + const basic_pointer_oserializer * bpos_ptr +){ + pimpl->save_pointer(*this, t, bpos_ptr); +} + +BOOST_ARCHIVE_DECL(void) +basic_oarchive::register_basic_serializer(const basic_oserializer & bos){ + pimpl->register_type(bos); +} + +BOOST_ARCHIVE_DECL(unsigned int) +basic_oarchive::get_library_version() const{ + return BOOST_ARCHIVE_VERSION(); +} + +BOOST_ARCHIVE_DECL(unsigned int) +basic_oarchive::get_flags() const{ + return pimpl->m_flags; +} + +BOOST_ARCHIVE_DECL(void) +basic_oarchive::end_preamble(){ +} + +} // namespace detail +} // namespace archive +} // namespace boost + +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif diff --git a/deal.II/contrib/boost/libs/serialization/src/basic_oserializer.cpp b/deal.II/contrib/boost/libs/serialization/src/basic_oserializer.cpp new file mode 100644 index 0000000000..0e21806454 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/src/basic_oserializer.cpp @@ -0,0 +1,33 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_oserializer.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 // NULL + +#define BOOST_ARCHIVE_SOURCE +#include + +namespace boost { +namespace archive { +namespace detail { + +BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) +basic_oserializer::basic_oserializer( + const boost::serialization::extended_type_info & eti +) : + basic_serializer(eti), + m_bpos(NULL) +{} + +BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) +basic_oserializer::~basic_oserializer(){} + +} // namespace detail +} // namespace archive +} // namespace boost diff --git a/deal.II/contrib/boost/libs/serialization/src/basic_pointer_iserializer.cpp b/deal.II/contrib/boost/libs/serialization/src/basic_pointer_iserializer.cpp new file mode 100644 index 0000000000..fac766fdef --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/src/basic_pointer_iserializer.cpp @@ -0,0 +1,30 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_pointer_iserializer.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. + +#define BOOST_ARCHIVE_SOURCE +#include + +namespace boost { +namespace archive { +namespace detail { + +BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) +basic_pointer_iserializer::basic_pointer_iserializer( + const boost::serialization::extended_type_info & eti +) : + basic_serializer(eti) +{} + +BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) +basic_pointer_iserializer::~basic_pointer_iserializer() {} + +} // namespace detail +} // namespace archive +} // namespace boost diff --git a/deal.II/contrib/boost/libs/serialization/src/basic_pointer_oserializer.cpp b/deal.II/contrib/boost/libs/serialization/src/basic_pointer_oserializer.cpp new file mode 100644 index 0000000000..9e9f1dd15f --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/src/basic_pointer_oserializer.cpp @@ -0,0 +1,30 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_pointer_oserializer.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. + +#define BOOST_ARCHIVE_SOURCE +#include + +namespace boost { +namespace archive { +namespace detail { + +BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) +basic_pointer_oserializer::basic_pointer_oserializer( + const boost::serialization::extended_type_info & eti +) : + basic_serializer(eti) +{} + +BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) +basic_pointer_oserializer::~basic_pointer_oserializer() {} + +} // namespace detail +} // namespace archive +} // namespace boost diff --git a/deal.II/contrib/boost/libs/serialization/src/basic_serializer_map.cpp b/deal.II/contrib/boost/libs/serialization/src/basic_serializer_map.cpp new file mode 100644 index 0000000000..429f3a45e3 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/src/basic_serializer_map.cpp @@ -0,0 +1,104 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// serializer_map.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. + +#if (defined _MSC_VER) && (_MSC_VER == 1200) +# pragma warning (disable : 4786) // too long name, harmless warning +#endif + +#include +#include + +#define BOOST_ARCHIVE_SOURCE +#include +#include + +#include +#include + +namespace boost { + namespace serialization { + class extended_type_info; + } +namespace archive { +namespace detail { + +bool +basic_serializer_map::type_info_pointer_compare::operator()( + const basic_serializer * lhs, const basic_serializer * rhs +) const { + return *lhs < *rhs; +} + +BOOST_ARCHIVE_DECL(bool) +basic_serializer_map::insert(const basic_serializer * bs){ + // attempt to insert serializer into it's map + const std::pair result = + m_map.insert(bs); + // the following is commented out - rather than being just + // deleted as a reminder not to try this. + + // At first it seemed like a good idea. It enforced the + // idea that a type be exported from at most one code module + // (DLL or mainline). This would enforce a "one definition rule" + // across code modules. This seems a good idea to me. + // But it seems that it's just too hard for many users to implement. + + // Ideally, I would like to make this exception a warning - + // but there isn't anyway to do that. + + // if this fails, it's because it's been instantiated + // in multiple modules - DLLS - a recipe for problems. + // So trap this here + // if(!result.second){ + // boost::serialization::throw_exception( + // archive_exception( + // archive_exception::multiple_code_instantiation, + // bs->get_debug_info() + // ) + // ); + // } + return true; +} + +BOOST_ARCHIVE_DECL(void) +basic_serializer_map::erase(const basic_serializer * bs){ + map_type::iterator it = m_map.begin(); + map_type::iterator it_end = m_map.end(); + + while(it != it_end){ + // note item 9 from Effective STL !!! it++ + if(*it == bs) + m_map.erase(it++); + else + it++; + } + // note: we can't do this since some of the eti records + // we're pointing to might be expired and the comparison + // won't work. Leave this as a reminder not to "optimize" this. + //it = m_map.find(bs); + //assert(it != m_map.end()); + //if(*it == bs) + // m_map.erase(it); +} +BOOST_ARCHIVE_DECL(const basic_serializer *) +basic_serializer_map::find( + const boost::serialization::extended_type_info & eti +) const { + const basic_serializer_arg bs(eti); + map_type::const_iterator it; + it = m_map.find(& bs); + assert(it != m_map.end()); + return *it; +} + +} // namespace detail +} // namespace archive +} // namespace boost + diff --git a/deal.II/contrib/boost/libs/serialization/src/basic_text_iprimitive.cpp b/deal.II/contrib/boost/libs/serialization/src/basic_text_iprimitive.cpp new file mode 100644 index 0000000000..c67a9420ba --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/src/basic_text_iprimitive.cpp @@ -0,0 +1,28 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_text_iprimitive.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. + +#if (defined _MSC_VER) && (_MSC_VER == 1200) +# pragma warning (disable : 4786) // too long name, harmless warning +#endif + +#include + +#define BOOST_ARCHIVE_SOURCE +#include +#include + +namespace boost { +namespace archive { + +// explicitly instantiate for this type of text stream +template class basic_text_iprimitive ; + +} // namespace archive +} // namespace boost diff --git a/deal.II/contrib/boost/libs/serialization/src/basic_text_oprimitive.cpp b/deal.II/contrib/boost/libs/serialization/src/basic_text_oprimitive.cpp new file mode 100644 index 0000000000..d8d98d6977 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/src/basic_text_oprimitive.cpp @@ -0,0 +1,28 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_text_oprimitive.cpp: + +// (C) Copyright 2004 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. + +#if (defined _MSC_VER) && (_MSC_VER == 1200) +# pragma warning (disable : 4786) // too long name, harmless warning +#endif + +#include + +#define BOOST_ARCHIVE_SOURCE +#include +#include + +namespace boost { +namespace archive { + +// explicitly instantiate for this type of text stream +template class basic_text_oprimitive ; + +} // namespace archive +} // namespace boost diff --git a/deal.II/contrib/boost/libs/serialization/src/basic_text_wiprimitive.cpp b/deal.II/contrib/boost/libs/serialization/src/basic_text_wiprimitive.cpp new file mode 100644 index 0000000000..4797485b0d --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/src/basic_text_wiprimitive.cpp @@ -0,0 +1,35 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_text_wiprimitive.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 + +#ifdef BOOST_NO_STD_WSTREAMBUF +#error "wide char i/o not supported on this platform" +#else + +#if (defined _MSC_VER) && (_MSC_VER == 1200) +# pragma warning (disable : 4786) // too long name, harmless warning +#endif + +#include + +#define BOOST_WARCHIVE_SOURCE +#include +#include + +namespace boost { +namespace archive { + +template class basic_text_iprimitive ; + +} // namespace archive +} // namespace boost + +#endif // BOOST_NO_STD_WSTREAMBUF diff --git a/deal.II/contrib/boost/libs/serialization/src/basic_text_woprimitive.cpp b/deal.II/contrib/boost/libs/serialization/src/basic_text_woprimitive.cpp new file mode 100644 index 0000000000..e13294e70c --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/src/basic_text_woprimitive.cpp @@ -0,0 +1,35 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_text_woprimitive.cpp: + +// (C) Copyright 2004 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 + +#ifdef BOOST_NO_STD_WSTREAMBUF +#error "wide char i/o not supported on this platform" +#else + +#if (defined _MSC_VER) && (_MSC_VER == 1200) +# pragma warning (disable : 4786) // too long name, harmless warning +#endif + +#include + +#define BOOST_WARCHIVE_SOURCE +#include +#include + +namespace boost { +namespace archive { + +template class basic_text_oprimitive ; + +} // namespace archive +} // namespace boost + +#endif // BOOST_NO_STD_WSTREAMBUF diff --git a/deal.II/contrib/boost/libs/serialization/src/basic_xml_archive.cpp b/deal.II/contrib/boost/libs/serialization/src/basic_xml_archive.cpp new file mode 100644 index 0000000000..e71aaef39c --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/src/basic_xml_archive.cpp @@ -0,0 +1,51 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_xml_archive.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. + +#define BOOST_ARCHIVE_SOURCE +#include + +namespace boost { +namespace archive { + +BOOST_ARCHIVE_DECL(const char *) +BOOST_ARCHIVE_XML_OBJECT_ID(){ + return "object_id"; +} +BOOST_ARCHIVE_DECL(const char *) +BOOST_ARCHIVE_XML_OBJECT_REFERENCE(){ + return "object_id_reference"; +} +BOOST_ARCHIVE_DECL(const char *) +BOOST_ARCHIVE_XML_CLASS_ID(){ + return "class_id"; +} +BOOST_ARCHIVE_DECL(const char *) +BOOST_ARCHIVE_XML_CLASS_ID_REFERENCE(){ + return "class_id_reference"; +} +BOOST_ARCHIVE_DECL(const char *) +BOOST_ARCHIVE_XML_CLASS_NAME(){ + return "class_name"; +} +BOOST_ARCHIVE_DECL(const char *) +BOOST_ARCHIVE_XML_TRACKING(){ + return "tracking_level"; +} +BOOST_ARCHIVE_DECL(const char *) +BOOST_ARCHIVE_XML_VERSION(){ + return "version"; +} +BOOST_ARCHIVE_DECL(const char *) +BOOST_ARCHIVE_XML_SIGNATURE(){ + return "signature"; +} + +}// namespace archive +}// namespace boost diff --git a/deal.II/contrib/boost/libs/serialization/src/basic_xml_grammar.ipp b/deal.II/contrib/boost/libs/serialization/src/basic_xml_grammar.ipp new file mode 100644 index 0000000000..0d7682bb1d --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/src/basic_xml_grammar.ipp @@ -0,0 +1,468 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// basic_xml_grammar.ipp: + +// (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. + +#if (defined _MSC_VER) && (_MSC_VER == 1200) +# pragma warning (disable : 4786) // too long name, harmless warning +#endif + +#include +#include +#include // BOOST_DEDUCED_TYPENAME + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +// spirit stuff +#include +#include +#include + +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + +// for head_iterator test +//#include +#include +#include + +#include +#include +#include +#include +#include +#include + +using namespace boost::spirit; + +namespace boost { +namespace archive { + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// template code for basic_xml_grammar of both wchar_t and char types + +namespace xml { // anonymous + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +template +struct assign_impl { + T & t; + void operator()(const T t_) const { + t = t_; + } + assign_impl(T & t_) + : t(t_) + {} +}; + +template<> +struct assign_impl { + std::string & t; + void operator()( + std::string::const_iterator b, + std::string::const_iterator e + ) const { + t.resize(0); + while(b != e){ + t += * b; + ++b; + } + } + assign_impl & operator=( + assign_impl & rhs + ); + assign_impl(std::string & t_) + : t(t_) + {} +}; + +#ifndef BOOST_NO_STD_WSTRING +template<> +struct assign_impl { + std::wstring & t; + void operator()( + std::wstring::const_iterator b, + std::wstring::const_iterator e + ) const { + t.resize(0); + while(b != e){ + t += * b; + ++b; + } + } + assign_impl(std::wstring & t_) + : t(t_) + {} +}; +#endif + +template +assign_impl assign_object(T &t){ + return assign_impl(t); +} + +struct assign_level { + tracking_type & tracking_level; + void operator()(const unsigned int tracking_level_) const { + tracking_level = (0 == tracking_level_) ? false : true; + } + assign_level(tracking_type & tracking_level_) + : tracking_level(tracking_level_) + {} +}; + +template +struct append_string { + String & contents; + void operator()(Iterator start, Iterator end) const { + #if 0 + typedef boost::archive::iterators::xml_unescape translator; + contents.append( + translator(BOOST_MAKE_PFTO_WRAPPER(start)), + translator(BOOST_MAKE_PFTO_WRAPPER(end)) + ); + #endif + contents.append(start, end); + } + append_string(String & contents_) + : contents(contents_) + {} +}; + +template +struct append_char { + String & contents; + void operator()(const unsigned int char_value) const { + const BOOST_DEDUCED_TYPENAME String::value_type z = char_value; + contents += z; + } + append_char(String & contents_) + : contents(contents_) + {} +}; + +template +struct append_lit { + String & contents; + template + void operator()(const X & /*x*/, const Y & /*y*/) const { + const BOOST_DEDUCED_TYPENAME String::value_type z = c; + contents += z; + } + append_lit(String & contents_) + : contents(contents_) + {} +}; + +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + +} // namespace anonymous + +template +bool basic_xml_grammar::my_parse( + BOOST_DEDUCED_TYPENAME basic_xml_grammar::IStream & is, + const rule_t & rule_, + CharType delimiter +) const { + if(is.fail()){ + boost::serialization::throw_exception( + archive_exception(archive_exception::stream_error) + ); + } + + boost::io::ios_flags_saver ifs(is); + is >> std::noskipws; + + std::basic_string arg; + + CharType val; + do{ + BOOST_DEDUCED_TYPENAME basic_xml_grammar::IStream::int_type + result = is.get(); + if(is.fail()) + return false; + val = static_cast(result); + arg += val; + } + while(val != delimiter); + + // read just one more character. This will be the newline after the tag + // this is so that the next operation will return fail if the archive + // is terminated. This will permit the archive to be used for debug + // and transaction data logging in the standard way. + + parse_info::iterator> + result = boost::spirit::parse(arg.begin(), arg.end(), rule_); + return result.hit; +} + +template +bool basic_xml_grammar::parse_start_tag( + BOOST_DEDUCED_TYPENAME basic_xml_grammar::IStream & is +){ + rv.class_name.resize(0); + return my_parse(is, STag); +} + +template +bool basic_xml_grammar::parse_end_tag(IStream & is) const { + return my_parse(is, ETag); +} + +template +bool basic_xml_grammar::parse_string(IStream & is, StringType & s){ + rv.contents.resize(0); + bool result = my_parse(is, content, '<'); + // note: unget caused a problem with dinkumware. replace with + // is.unget(); + // putback another dilimiter instead + is.putback('<'); + if(result) + s = rv.contents; + return result; +} + +template +basic_xml_grammar::basic_xml_grammar(){ + init_chset(); + + S = + +(Sch) + ; + + // refactoring to workaround template depth on darwin + NameHead = (Letter | '_' | ':'); + NameTail = *NameChar ; + Name = + NameHead >> NameTail + ; + + Eq = + !S >> '=' >> !S + ; + + AttributeList = + *(S >> Attribute) + ; + + STag = + !S + >> '<' + >> Name [xml::assign_object(rv.object_name)] + >> AttributeList + >> !S + >> '>' + ; + + ETag = + !S + >> "> Name [xml::assign_object(rv.object_name)] + >> !S + >> '>' + ; + + // refactoring to workaround template depth on darwin + CharDataChars = +(anychar_p - chset_p(L"&<")); + CharData = + CharDataChars [ + xml::append_string< + StringType, + BOOST_DEDUCED_TYPENAME std::basic_string::const_iterator + >(rv.contents) + ] + ; + + // slight factoring works around ICE in msvc 6.0 + CharRef1 = + str_p(L"&#") >> uint_p [xml::append_char(rv.contents)] >> L';' + ; + CharRef2 = + str_p(L"&#x") >> hex_p [xml::append_char(rv.contents)] >> L';' + ; + CharRef = CharRef1 | CharRef2 ; + + AmpRef = str_p(L"&")[xml::append_lit(rv.contents)]; + LTRef = str_p(L"<")[xml::append_lit(rv.contents)]; + GTRef = str_p(L">")[xml::append_lit'>(rv.contents)]; + AposRef = str_p(L"'")[xml::append_lit(rv.contents)]; + QuoteRef = str_p(L""")[xml::append_lit(rv.contents)]; + + Reference = + AmpRef + | LTRef + | GTRef + | AposRef + | QuoteRef + | CharRef + ; + + content = + L"<" // should be end_p + | +(Reference | CharData) >> L"<" + ; + + ClassIDAttribute = + str_p(BOOST_ARCHIVE_XML_CLASS_ID()) >> NameTail + >> Eq + >> L'"' + >> int_p [xml::assign_object(rv.class_id.t)] + >> L'"' + ; + + ObjectIDAttribute = ( + str_p(BOOST_ARCHIVE_XML_OBJECT_ID()) + | + str_p(BOOST_ARCHIVE_XML_OBJECT_REFERENCE()) + ) + >> NameTail + >> Eq + >> L'"' + >> L'_' + >> uint_p [xml::assign_object(rv.object_id.t)] + >> L'"' + ; + + AmpName = str_p(L"&")[xml::append_lit(rv.class_name)]; + LTName = str_p(L"<")[xml::append_lit(rv.class_name)]; + GTName = str_p(L">")[xml::append_lit'>(rv.class_name)]; + ClassNameChar = + AmpName + | LTName + | GTName + | (anychar_p - chset_p(L"\"")) [xml::append_char(rv.class_name)] + ; + + ClassName = + * ClassNameChar + ; + + ClassNameAttribute = + str_p(BOOST_ARCHIVE_XML_CLASS_NAME()) + >> Eq + >> L'"' + >> ClassName + >> L'"' + ; + + TrackingAttribute = + str_p(BOOST_ARCHIVE_XML_TRACKING()) + >> Eq + >> L'"' + >> uint_p [xml::assign_level(rv.tracking_level)] + >> L'"' + ; + + VersionAttribute = + str_p(BOOST_ARCHIVE_XML_VERSION()) + >> Eq + >> L'"' + >> uint_p [xml::assign_object(rv.version.t)] + >> L'"' + ; + + UnusedAttribute = + Name + >> Eq + >> L'"' + >> !CharData + >> L'"' + ; + + Attribute = + ClassIDAttribute + | ObjectIDAttribute + | ClassNameAttribute + | TrackingAttribute + | VersionAttribute + | UnusedAttribute + ; + + XMLDeclChars = *(anychar_p - chset_p(L"?>")); + XMLDecl = + !S + >> str_p(L"> S + >> str_p(L"version") + >> Eq + >> str_p(L"\"1.0\"") + >> XMLDeclChars + >> !S + >> str_p(L"?>") + ; + + DocTypeDeclChars = *(anychar_p - chset_p(L">")); + DocTypeDecl = + !S + >> str_p(L"> DocTypeDeclChars + >> L'>' + ; + + SignatureAttribute = + str_p(L"signature") + >> Eq + >> L'"' + >> Name [xml::assign_object(rv.class_name)] + >> L'"' + ; + + SerializationWrapper = + !S + >> str_p(L"> S + >> SignatureAttribute + >> S + >> VersionAttribute + >> !S + >> L'>' + ; +} + +template +void basic_xml_grammar::init(IStream & is){ + init_chset(); + if(! my_parse(is, XMLDecl)) + boost::serialization::throw_exception( + xml_archive_exception(xml_archive_exception::xml_archive_parsing_error) + ); + if(! my_parse(is, DocTypeDecl)) + boost::serialization::throw_exception( + xml_archive_exception(xml_archive_exception::xml_archive_parsing_error) + ); + if(! my_parse(is, SerializationWrapper)) + boost::serialization::throw_exception( + xml_archive_exception(xml_archive_exception::xml_archive_parsing_error) + ); + if(! std::equal(rv.class_name.begin(), rv.class_name.end(), BOOST_ARCHIVE_SIGNATURE())) + boost::serialization::throw_exception( + archive_exception(archive_exception::invalid_signature) + ); +} + +template +void basic_xml_grammar::windup(IStream & is){ + if(is.fail()) + return; + // uh-oh - don't throw exception from code called by a destructor ! + // so just ignore any failure. + my_parse(is, ETag); +} + +} // namespace archive +} // namespace boost diff --git a/deal.II/contrib/boost/libs/serialization/src/binary_iarchive.cpp b/deal.II/contrib/boost/libs/serialization/src/binary_iarchive.cpp new file mode 100644 index 0000000000..7bb0435cc4 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/src/binary_iarchive.cpp @@ -0,0 +1,53 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// binary_iarchive.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 + +#define BOOST_ARCHIVE_SOURCE +#include +#include + +#include +#include +#include + +namespace boost { +namespace archive { + +// explicitly instantiate for this type of stream +template class detail::archive_serializer_map; +template class basic_binary_iprimitive< + naked_binary_iarchive, + std::istream::char_type, + std::istream::traits_type +>; +template class basic_binary_iarchive ; +template class binary_iarchive_impl< + naked_binary_iarchive, + std::istream::char_type, + std::istream::traits_type +>; + +// explicitly instantiate for this type of stream +template class detail::archive_serializer_map; +template class basic_binary_iprimitive< + binary_iarchive, + std::istream::char_type, + std::istream::traits_type +>; +template class basic_binary_iarchive ; +template class binary_iarchive_impl< + binary_iarchive, + std::istream::char_type, + std::istream::traits_type +>; + +} // namespace archive +} // namespace boost diff --git a/deal.II/contrib/boost/libs/serialization/src/binary_oarchive.cpp b/deal.II/contrib/boost/libs/serialization/src/binary_oarchive.cpp new file mode 100644 index 0000000000..e7ab9040ef --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/src/binary_oarchive.cpp @@ -0,0 +1,39 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// binary_oarchive.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 + +#define BOOST_ARCHIVE_SOURCE +#include +#include + +// explicitly instantiate for this type of binary stream +#include +#include +#include + +namespace boost { +namespace archive { + +template class detail::archive_serializer_map; +template class basic_binary_oprimitive< + binary_oarchive, + std::ostream::char_type, + std::ostream::traits_type +>; +template class basic_binary_oarchive ; +template class binary_oarchive_impl< + binary_oarchive, + std::ostream::char_type, + std::ostream::traits_type +>; + +} // namespace archive +} // namespace boost diff --git a/deal.II/contrib/boost/libs/serialization/src/binary_wiarchive.cpp b/deal.II/contrib/boost/libs/serialization/src/binary_wiarchive.cpp new file mode 100644 index 0000000000..a6135c8cb8 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/src/binary_wiarchive.cpp @@ -0,0 +1,60 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// binary_wiarchive.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 + +#ifdef BOOST_NO_STD_WSTREAMBUF +#error "wide char i/o not supported on this platform" +#else + +#define BOOST_WARCHIVE_SOURCE +#include +#include + +// explicitly instantiate for this type of text stream +#include +#include +#include + +namespace boost { +namespace archive { + +template class detail::archive_serializer_map; +template class basic_binary_iprimitive< + naked_binary_wiarchive, + wchar_t, + std::char_traits +>; +template class basic_binary_iarchive ; +template class binary_iarchive_impl< + naked_binary_wiarchive, + wchar_t, + std::char_traits +>; + +// explicitly instantiate for this type of text stream +template class detail::archive_serializer_map; +template class basic_binary_iprimitive< + binary_wiarchive, + wchar_t, + std::char_traits +>; +template class basic_binary_iarchive ; +template class binary_iarchive_impl< + binary_wiarchive, + wchar_t, + std::char_traits +>; + +} // namespace archive +} // namespace boost + +#endif // BOOST_NO_STD_WSTREAMBUF + diff --git a/deal.II/contrib/boost/libs/serialization/src/binary_woarchive.cpp b/deal.II/contrib/boost/libs/serialization/src/binary_woarchive.cpp new file mode 100644 index 0000000000..905a319d66 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/src/binary_woarchive.cpp @@ -0,0 +1,44 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// binary_woarchive.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 + +#ifdef BOOST_NO_STD_WSTREAMBUF +#error "wide char i/o not supported on this platform" +#else + +#define BOOST_WARCHIVE_SOURCE +#include + +// explicitly instantiate for this type of text stream +#include +#include +#include + +namespace boost { +namespace archive { + +template class detail::archive_serializer_map; +template class basic_binary_oprimitive< + binary_woarchive, + wchar_t, + std::char_traits +>; +template class basic_binary_oarchive ; +template class binary_oarchive_impl< + binary_woarchive, + wchar_t, + std::char_traits +>; + +} // namespace archive +} // namespace boost + +#endif // BOOST_NO_STD_WSTREAMBUF diff --git a/deal.II/contrib/boost/libs/serialization/src/codecvt_null.cpp b/deal.II/contrib/boost/libs/serialization/src/codecvt_null.cpp new file mode 100644 index 0000000000..b6c06bdcd2 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/src/codecvt_null.cpp @@ -0,0 +1,83 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// codecvt_null.cpp + +// Copyright (c) 2004 Robert Ramey, Indiana University (garcia@osl.iu.edu) +// Andrew Lumsdaine, Indiana University (lums@osl.iu.edu). +// 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) + +#define BOOST_WARCHIVE_SOURCE +#include + +// codecvt implementation for passing wchar_t objects to char output +// without any translation whatever. Used to implement binary output +// of wchar_t objects. + +namespace boost { +namespace archive { + +BOOST_WARCHIVE_DECL(std::codecvt_base::result) +codecvt_null::do_out( + std::mbstate_t & /*state*/, + const wchar_t * first1, + const wchar_t * last1, + const wchar_t * & next1, + char * first2, + char * last2, + char * & next2 +) const { + while(first1 != last1){ + // Per std::22.2.1.5.2/2, we can store no more that + // last2-first2 characters. If we need to more encode + // next internal char type, return 'partial'. + if(static_cast(sizeof(wchar_t)) > (last2 - first2)){ + next1 = first1; + next2 = first2; + return std::codecvt_base::partial; + } + * reinterpret_cast(first2) = * first1++; + first2 += sizeof(wchar_t); + + } + next1 = first1; + next2 = first2; + return std::codecvt_base::ok; +} + +BOOST_WARCHIVE_DECL(std::codecvt_base::result) +codecvt_null::do_in( + std::mbstate_t & state, + const char * first1, + const char * last1, + const char * & next1, + wchar_t * first2, + wchar_t * last2, + wchar_t * & next2 +) const { + // Process input characters until we've run of them, + // or the number of remaining characters is not + // enough to construct another output character, + // or we've run out of place for output characters. + while(first2 != last2){ + // Have we converted all input characters? + // Return with 'ok', if so. + if (first1 == last1) + break; + // Do we have less input characters than needed + // for a single output character? + if(static_cast(sizeof(wchar_t)) > (last1 - first1)){ + next1 = first1; + next2 = first2; + return std::codecvt_base::partial; + } + *first2++ = * reinterpret_cast(first1); + first1 += sizeof(wchar_t); + } + next1 = first1; + next2 = first2; + return std::codecvt_base::ok; +} + +} // namespace archive +} // namespace boost diff --git a/deal.II/contrib/boost/libs/serialization/src/extended_type_info.cpp b/deal.II/contrib/boost/libs/serialization/src/extended_type_info.cpp new file mode 100644 index 0000000000..bc28d6ad34 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/src/extended_type_info.cpp @@ -0,0 +1,188 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// extended_type_info.cpp: implementation for portable version of type_info + +// (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. + +#if (defined _MSC_VER) && (_MSC_VER == 1200) +# pragma warning (disable : 4786) // too long name, harmless warning +#endif + +#include +#include +#include +#include +#include // NULL + +#include // msvc needs this to suppress warning + +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ using ::strcmp; } +#endif + +#include +#include +#include + +#define BOOST_SERIALIZATION_SOURCE +#include + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +namespace boost { +namespace serialization { +namespace detail { + +struct key_compare +{ + bool + operator()( + const extended_type_info * lhs, + const extended_type_info * rhs + ) const { + // performance shortcut + if(lhs == rhs) + return false; + const char * l = lhs->get_key(); + assert(NULL != l); + const char * r = rhs->get_key(); + assert(NULL != r); + // performance shortcut + // shortcut to exploit string pooling + if(l == r) + return false; + // for exported types, use the string key so that + // multiple instances in different translation units + // can be matched up + return std::strcmp(l, r) < 0; + } +}; + +typedef std::multiset ktmap; + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +class extended_type_info_arg : public extended_type_info +{ + virtual bool + is_less_than(const extended_type_info & /*rhs*/) const { + assert(false); + return false; + }; + virtual bool + is_equal(const extended_type_info & /*rhs*/) const { + assert(false); + return false; + }; + virtual const char * get_debug_info() const { + return get_key(); + } + virtual void * construct(unsigned int /*count*/, ...) const{ + assert(false); + return NULL; + } + virtual void destroy(void const * const /*p*/) const { + assert(false); + } +public: + extended_type_info_arg(const char * key) : + extended_type_info(0, key) + {} + + ~extended_type_info_arg(){ + } +}; + +#ifdef BOOST_MSVC +# pragma warning(pop) +#endif + +} // namespace detail + +BOOST_SERIALIZATION_DECL(void) +extended_type_info::key_register() const{ + if(NULL == get_key()) + return; + singleton::get_mutable_instance().insert(this); +} + +BOOST_SERIALIZATION_DECL(void) +extended_type_info::key_unregister() const{ + if(NULL == get_key()) + return; + if(! singleton::is_destroyed()){ + detail::ktmap & x = singleton::get_mutable_instance(); + detail::ktmap::iterator start = x.lower_bound(this); + detail::ktmap::iterator end = x.upper_bound(this); + // remove entry in map which corresponds to this type + for(;start != end; ++start){ + if(this == *start){ + x.erase(start); + break; + } + } + } +} + +BOOST_SERIALIZATION_DECL(const extended_type_info *) +extended_type_info::find(const char *key) { + assert(NULL != key); + const detail::ktmap & k = singleton::get_const_instance(); + const detail::extended_type_info_arg eti_key(key); + const detail::ktmap::const_iterator it = k.find(& eti_key); + if(k.end() == it) + return NULL; + return *(it); +} + +BOOST_SERIALIZATION_DECL(BOOST_PP_EMPTY()) +extended_type_info::extended_type_info( + const unsigned int type_info_key, + const char * key +) : + m_type_info_key(type_info_key), + m_key(key) +{ +} + +BOOST_SERIALIZATION_DECL(BOOST_PP_EMPTY()) +extended_type_info::~extended_type_info(){ +} + +BOOST_SERIALIZATION_DECL(bool) +extended_type_info::operator<(const extended_type_info &rhs) const { + // short cut for a common cases + if(this == & rhs) + return false; + if(m_type_info_key == rhs.m_type_info_key){ + return is_less_than(rhs); + } + if(m_type_info_key < rhs.m_type_info_key) + return true; + return false; +} + +BOOST_SERIALIZATION_DECL(bool) +extended_type_info::operator==(const extended_type_info &rhs) const { + // short cut for a common cases + if(this == & rhs) + return true; + if(m_type_info_key != rhs.m_type_info_key){ + return false; + } + return is_equal(rhs); +} + +} // namespace serialization +} // namespace boost diff --git a/deal.II/contrib/boost/libs/serialization/src/extended_type_info_no_rtti.cpp b/deal.II/contrib/boost/libs/serialization/src/extended_type_info_no_rtti.cpp new file mode 100644 index 0000000000..cb4f14f9c7 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/src/extended_type_info_no_rtti.cpp @@ -0,0 +1,85 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// extended_type_info_no_rtti.cpp: specific implementation of type info +// that is NOT based on typeid + +// (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 +#include // NULL +#include + +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ using ::strcmp; } +#endif + +#define BOOST_SERIALIZATION_SOURCE +#include + +#define EXTENDED_TYPE_INFO_NO_RTTI_KEY 2 + +namespace boost { +namespace serialization { +namespace no_rtti_system { + +BOOST_SERIALIZATION_DECL(BOOST_PP_EMPTY()) +extended_type_info_no_rtti_0::extended_type_info_no_rtti_0( + const char * key +) : + extended_type_info(EXTENDED_TYPE_INFO_NO_RTTI_KEY, key) +{} + +BOOST_SERIALIZATION_DECL(bool) +extended_type_info_no_rtti_0::is_less_than( + const boost::serialization::extended_type_info &rhs) const +{ + // shortcut for common case + if(this == & rhs) + return false; + const char * l = get_key(); + const char * r = rhs.get_key(); + // if this assertion is triggered, it could mean one of the following + // a) This class was never exported - make sure all calls which use + // this method of type id are in fact exported. + // b) This class was used (e.g. serialized through a pointer) before + // it was exported. Make sure that classes which use this method + // of type id are NOT "automatically" registered by serializating + // through a pointer to the to most derived class. OR make sure + // that the BOOST_CLASS_EXPORT is included in every file + // which does this. + assert(NULL != l); + assert(NULL != r); + return std::strcmp(l, r) < 0; +} + +BOOST_SERIALIZATION_DECL(bool) +extended_type_info_no_rtti_0::is_equal( + const boost::serialization::extended_type_info &rhs) const +{ + // shortcut for common case + if(this == & rhs) + return true; + // null keys don't match with anything + const char * l = get_key(); + assert(NULL != l); + if(NULL == l) + return false; + const char * r = rhs.get_key(); + assert(NULL != r); + if(NULL == r) + return false; + return 0 == std::strcmp(l, r); +} + +BOOST_SERIALIZATION_DECL(BOOST_PP_EMPTY()) +extended_type_info_no_rtti_0::~extended_type_info_no_rtti_0() +{} + +} // namespece detail +} // namespace serialization +} // namespace boost diff --git a/deal.II/contrib/boost/libs/serialization/src/extended_type_info_typeid.cpp b/deal.II/contrib/boost/libs/serialization/src/extended_type_info_typeid.cpp new file mode 100644 index 0000000000..8b5e38d60c --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/src/extended_type_info_typeid.cpp @@ -0,0 +1,161 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// extended_type_info_typeid.cpp: specific implementation of type info +// that is based on typeid + +// (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 +#include +#include +#include +#include // NULL + +#include + +#include + +#define BOOST_SERIALIZATION_SOURCE +#include + +namespace boost { +namespace serialization { +namespace typeid_system { + +#define EXTENDED_TYPE_INFO_TYPE_KEY 1 + +struct type_compare +{ + bool + operator()( + const extended_type_info_typeid_0 * lhs, + const extended_type_info_typeid_0 * rhs + ) const { + return lhs->is_less_than(*rhs); + } +}; + +typedef std::multiset< + const extended_type_info_typeid_0 *, + type_compare +> tkmap; + +BOOST_SERIALIZATION_DECL(bool) +extended_type_info_typeid_0::is_less_than( + const boost::serialization::extended_type_info & rhs +) const { + // shortcut for common case + if(this == & rhs) + return false; + return 0 != m_ti->before( + *(static_cast(rhs).m_ti) + ); +} + +BOOST_SERIALIZATION_DECL(bool) +extended_type_info_typeid_0::is_equal( + const boost::serialization::extended_type_info & rhs +) const { + return + // note: std::type_info == operator returns an int !!! + // the following permits conversion to bool without a warning. + ! ( + * m_ti + != *(static_cast(rhs).m_ti) + ) + ; +} + +BOOST_SERIALIZATION_DECL(BOOST_PP_EMPTY()) +extended_type_info_typeid_0::extended_type_info_typeid_0( + const char * key +) : + extended_type_info(EXTENDED_TYPE_INFO_TYPE_KEY, key), + m_ti(NULL) +{} + +BOOST_SERIALIZATION_DECL(BOOST_PP_EMPTY()) +extended_type_info_typeid_0::~extended_type_info_typeid_0() +{} + +BOOST_SERIALIZATION_DECL(void) +extended_type_info_typeid_0::type_register(const std::type_info & ti){ + m_ti = & ti; + singleton::get_mutable_instance().insert(this); +} + +BOOST_SERIALIZATION_DECL(void) +extended_type_info_typeid_0::type_unregister() +{ + if(NULL != m_ti){ + if(! singleton::is_destroyed()){ + tkmap & x = singleton::get_mutable_instance(); + tkmap::iterator start = x.lower_bound(this); + tkmap::iterator end = x.upper_bound(this); + assert(start != end); + + // remove entry in map which corresponds to this type + do{ + if(this == *start) + x.erase(start++); + else + ++start; + }while(start != end); + } + } + m_ti = NULL; +} + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +// this derivation is used for creating search arguments +class extended_type_info_typeid_arg : + public extended_type_info_typeid_0 +{ + virtual void * construct(unsigned int /*count*/, ...) const{ + assert(false); + return NULL; + } + virtual void destroy(void const * const /*p*/) const { + assert(false); + } +public: + extended_type_info_typeid_arg(const std::type_info & ti) : + extended_type_info_typeid_0(NULL) + { + // note absense of self register and key as this is used only as + // search argument given a type_info reference and is not to + // be added to the map. + m_ti = & ti; + } + ~extended_type_info_typeid_arg(){ + m_ti = NULL; + } +}; + +#ifdef BOOST_MSVC +# pragma warning(pop) +#endif + +BOOST_SERIALIZATION_DECL(const extended_type_info *) +extended_type_info_typeid_0::get_extended_type_info( + const std::type_info & ti +) const { + typeid_system::extended_type_info_typeid_arg etia(ti); + const tkmap & t = singleton::get_const_instance(); + const tkmap::const_iterator it = t.find(& etia); + if(t.end() == it) + return NULL; + return *(it); +} + +} // namespace detail +} // namespace serialization +} // namespace boost diff --git a/deal.II/contrib/boost/libs/serialization/src/polymorphic_iarchive.cpp b/deal.II/contrib/boost/libs/serialization/src/polymorphic_iarchive.cpp new file mode 100644 index 0000000000..5e8c986783 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/src/polymorphic_iarchive.cpp @@ -0,0 +1,29 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// polymorphic_iarchive.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. + +#if (defined _MSC_VER) && (_MSC_VER == 1200) +# pragma warning (disable : 4786) // too long name, harmless warning +#endif + +#define BOOST_ARCHIVE_SOURCE +#include + +#include +#include + +namespace boost { +namespace archive { +namespace detail { + +template class archive_serializer_map; + +} // detail +} // archive +} // boost diff --git a/deal.II/contrib/boost/libs/serialization/src/polymorphic_oarchive.cpp b/deal.II/contrib/boost/libs/serialization/src/polymorphic_oarchive.cpp new file mode 100644 index 0000000000..b85895e260 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/src/polymorphic_oarchive.cpp @@ -0,0 +1,29 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// polymorphic_oarchive.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. + +#if (defined _MSC_VER) && (_MSC_VER == 1200) +# pragma warning (disable : 4786) // too long name, harmless warning +#endif + +#define BOOST_ARCHIVE_SOURCE +#include + +#include +#include + +namespace boost { +namespace archive { +namespace detail { + +template class archive_serializer_map; + +} // detail +} // archive +} // boost diff --git a/deal.II/contrib/boost/libs/serialization/src/shared_ptr_helper.cpp b/deal.II/contrib/boost/libs/serialization/src/shared_ptr_helper.cpp new file mode 100644 index 0000000000..ec15e2e28f --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/src/shared_ptr_helper.cpp @@ -0,0 +1,135 @@ +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// shared_ptr_helper.hpp: serialization for boost shared pointern + +// (C) Copyright 2004-2009 Robert Ramey, Martin Ecker and Takatoshi Kondo +// 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 +#include +#include +#include // NULL + +#define BOOST_ARCHIVE_SOURCE + +#include +#include +#include +#include +#include + +namespace boost { +namespace archive{ +namespace detail { + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// a common class for holding various types of shared pointers + +// returns pointer to object and an indicator whether this is a +// new entry (true) or a previous one (false) +BOOST_ARCHIVE_DECL(shared_ptr) +shared_ptr_helper::get_od( + const void * t, + const boost::serialization::extended_type_info * true_type, + const boost::serialization::extended_type_info * this_type +){ + // get void pointer to the most derived type + // this uniquely identifies the object referred to + const void * od = void_downcast( + *true_type, + *this_type, + t + ); + if(NULL == od) + boost::serialization::throw_exception( + archive_exception( + archive_exception::unregistered_cast, + true_type->get_debug_info(), + this_type->get_debug_info() + ) + ); + + // make tracking array if necessary + if(NULL == m_pointers) + m_pointers = new collection_type; + + //shared_ptr sp(od, null_deleter()); + shared_ptr sp(od, null_deleter()); + collection_type::iterator i = m_pointers->find(sp); + + if(i == m_pointers->end()){ + shared_ptr np; + return np; + } + od = void_upcast( + *true_type, + *this_type, + i->get() + ); + if(NULL == od) + boost::serialization::throw_exception( + archive_exception( + archive_exception::unregistered_cast, + true_type->get_debug_info(), + this_type->get_debug_info() + ) + ); + + return shared_ptr( + const_pointer_cast(*i), + const_cast(od) + ); +} + +BOOST_ARCHIVE_DECL(void) +shared_ptr_helper::append(const boost::shared_ptr &sp){ + // make tracking array if necessary + if(NULL == m_pointers) + m_pointers = new collection_type; + + collection_type::iterator i = m_pointers->find(sp); + + if(i == m_pointers->end()){ + std::pair result; + result = m_pointers->insert(sp); + assert(result.second); + } +} + +// #ifdef BOOST_SERIALIZATION_SHARED_PTR_132_HPP +BOOST_ARCHIVE_DECL(void) +shared_ptr_helper::append(const boost_132::shared_ptr & t){ + if(NULL == m_pointers_132) + m_pointers_132 = new std::list >; + m_pointers_132->push_back(t); +} +// #endif +BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) +shared_ptr_helper::shared_ptr_helper() : + m_pointers(NULL) + #ifdef BOOST_SERIALIZATION_SHARED_PTR_132_HPP + , m_pointers_132(NULL) + #endif +{} +BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) +shared_ptr_helper::~shared_ptr_helper(){ + if(NULL != m_pointers) + delete m_pointers; + #ifdef BOOST_SERIALIZATION_SHARED_PTR_132_HPP + if(NULL != m_pointers_132) + delete m_pointers_132; + #endif +} + +} // namespace detail +} // namespace serialization +} // namespace boost + diff --git a/deal.II/contrib/boost/libs/serialization/src/stl_port.cpp b/deal.II/contrib/boost/libs/serialization/src/stl_port.cpp new file mode 100644 index 0000000000..e5378bca4b --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/src/stl_port.cpp @@ -0,0 +1,43 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// stl_port.cpp: implementation of run-time casting of void pointers + +// (C) Copyright 2005 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. + +#if (defined _MSC_VER) && (_MSC_VER == 1200) +# pragma warning (disable : 4786) // too long name, harmless warning +#endif + +// this befuddles the msvc 6 compiler so we can't use it +#if ! ((defined _MSC_VER) && (_MSC_VER <= 1300)) \ +&& ! defined(__BORLANDC__) + +#include + +#if defined(__SGI_STL_PORT) && (__SGI_STL_PORT < 0x500) + +#include + +// explicit instantiation + +namespace std { + +template +locale::locale( + const locale& __loc, boost::archive::codecvt_null * __f +); + +template +locale::locale( + const locale& __loc, boost::archive::codecvt_null * __f +); + +} // namespace std + +#endif + +#endif diff --git a/deal.II/contrib/boost/libs/serialization/src/text_iarchive.cpp b/deal.II/contrib/boost/libs/serialization/src/text_iarchive.cpp new file mode 100644 index 0000000000..cb9017fa4a --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/src/text_iarchive.cpp @@ -0,0 +1,36 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// text_iarchive.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. + +#if (defined _MSC_VER) && (_MSC_VER == 1200) +# pragma warning (disable : 4786) // too long name, harmless warning +#endif + +#define BOOST_ARCHIVE_SOURCE +#include +#include + +// explicitly instantiate for this type of text stream +#include +#include +#include + +namespace boost { +namespace archive { + +template class detail::archive_serializer_map; +template class basic_text_iarchive ; +template class text_iarchive_impl ; + +template class detail::archive_serializer_map; +template class basic_text_iarchive ; +template class text_iarchive_impl ; + +} // namespace archive +} // namespace boost diff --git a/deal.II/contrib/boost/libs/serialization/src/text_oarchive.cpp b/deal.II/contrib/boost/libs/serialization/src/text_oarchive.cpp new file mode 100644 index 0000000000..19165d62de --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/src/text_oarchive.cpp @@ -0,0 +1,33 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// text_oarchive.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. + +#if (defined _MSC_VER) && (_MSC_VER == 1200) +# pragma warning (disable : 4786) // too long name, harmless warning +#endif + +#define BOOST_ARCHIVE_SOURCE +#include +#include + +// explicitly instantiate for this type of text stream +#include +#include +#include + +namespace boost { +namespace archive { + +//template class basic_text_oprimitive ; +template class detail::archive_serializer_map; +template class basic_text_oarchive ; +template class text_oarchive_impl ; + +} // namespace serialization +} // namespace boost diff --git a/deal.II/contrib/boost/libs/serialization/src/text_wiarchive.cpp b/deal.II/contrib/boost/libs/serialization/src/text_wiarchive.cpp new file mode 100644 index 0000000000..a6630c03bc --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/src/text_wiarchive.cpp @@ -0,0 +1,41 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// text_wiarchive.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 + +#ifdef BOOST_NO_STD_WSTREAMBUF +#error "wide char i/o not supported on this platform" +#else + +#define BOOST_WARCHIVE_SOURCE +#include +#include + +// explicitly instantiate for this type of text stream +#include +#include +#include + +namespace boost { +namespace archive { + +template class detail::archive_serializer_map; +template class basic_text_iarchive ; +template class text_wiarchive_impl ; + +template class detail::archive_serializer_map; +template class basic_text_iarchive ; +template class text_wiarchive_impl ; + +} // namespace archive +} // namespace boost + +#endif // BOOST_NO_STD_WSTREAMBUF + diff --git a/deal.II/contrib/boost/libs/serialization/src/text_woarchive.cpp b/deal.II/contrib/boost/libs/serialization/src/text_woarchive.cpp new file mode 100644 index 0000000000..54b4a0df58 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/src/text_woarchive.cpp @@ -0,0 +1,35 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// text_woarchive.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 +#ifdef BOOST_NO_STD_WSTREAMBUF +#error "wide char i/o not supported on this platform" +#else + +#define BOOST_WARCHIVE_SOURCE +#include +#include + +// explicitly instantiate for this type of text stream +#include +#include +#include + +namespace boost { +namespace archive { + +template class detail::archive_serializer_map; +template class basic_text_oarchive ; +template class text_woarchive_impl ; + +} // namespace archive +} // namespace boost + +#endif // BOOST_NO_STD_WSTREAMBUF diff --git a/deal.II/contrib/boost/libs/serialization/src/utf8_codecvt_facet.cpp b/deal.II/contrib/boost/libs/serialization/src/utf8_codecvt_facet.cpp new file mode 100644 index 0000000000..1ee4eadd71 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/src/utf8_codecvt_facet.cpp @@ -0,0 +1,21 @@ +// Copyright Vladimir Prus 2004. +// Distributed under 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) + +#include +#ifdef BOOST_NO_STD_WSTREAMBUF +#error "wide char i/o not supported on this platform" +#else + +#define BOOST_UTF8_BEGIN_NAMESPACE \ + namespace boost { namespace archive { namespace detail { +#define BOOST_UTF8_DECL +#define BOOST_UTF8_END_NAMESPACE }}} +#include "../../detail/utf8_codecvt_facet.cpp" +#undef BOOST_UTF8_END_NAMESPACE +#undef BOOST_UTF8_DECL +#undef BOOST_UTF8_BEGIN_NAMESPACE + +#endif // BOOST_NO_STD_WSTREAMBUF + diff --git a/deal.II/contrib/boost/libs/serialization/src/void_cast.cpp b/deal.II/contrib/boost/libs/serialization/src/void_cast.cpp new file mode 100644 index 0000000000..ef8aa767aa --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/src/void_cast.cpp @@ -0,0 +1,354 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// void_cast.cpp: implementation of run-time casting of void pointers + +// (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. + +#if (defined _MSC_VER) && (_MSC_VER == 1200) +# pragma warning (disable : 4786) // too long name, harmless warning +#endif + +#include +#include // NULL +#ifdef BOOST_SERIALIZATION_LOG +#include +#endif + +// STL +#include +#include +#include +#include + +// BOOST +#define BOOST_SERIALIZATION_SOURCE +#include + +#define BOOST_SERIALIZATION_SOURCE +#include +#include + +namespace boost { +namespace serialization { +namespace void_cast_detail { + +// note that void_casters are keyed on value of +// member extended type info records - NOT their +// addresses. This is necessary in order for the +// void cast operations to work across dll and exe +// module boundries. +bool void_caster::operator<(const void_caster & rhs) const { + // include short cut to save time and eliminate + // problems when when base class aren't virtual + if(m_derived != rhs.m_derived){ + if(*m_derived < *rhs.m_derived) + return true; + if(*rhs.m_derived < *m_derived) + return false; + } + // m_derived == rhs.m_derived + if(m_base != rhs.m_base) + return *m_base < *rhs.m_base; + else + return false; +} + +struct void_caster_compare { + bool operator()(const void_caster * lhs, const void_caster * rhs) const { + return *lhs < *rhs; + } +}; + +typedef std::set set_type; +typedef boost::serialization::singleton void_caster_registry; + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +// implementation of shortcut void caster +class void_caster_shortcut : public void_caster +{ + bool m_includes_virtual_base; + + void const * + vbc_upcast( + void const * const t + ) const; + void const * + vbc_downcast( + void const * const t + ) const; + virtual void const * + upcast(void const * const t) const{ + if(m_includes_virtual_base) + return vbc_upcast(t); + return static_cast ( t ) - m_difference; + } + virtual void const * + downcast(void const * const t) const{ + if(m_includes_virtual_base) + return vbc_downcast(t); + return static_cast ( t ) + m_difference; + } + virtual bool is_shortcut() const { + return true; + } +public: + void_caster_shortcut( + extended_type_info const * derived, + extended_type_info const * base, + std::ptrdiff_t difference, + bool includes_virtual_base, + void_caster const * const parent + ) : + void_caster(derived, base, difference, parent), + m_includes_virtual_base(includes_virtual_base) + { + recursive_register(includes_virtual_base); + } + virtual ~void_caster_shortcut(){ + recursive_unregister(); + } +}; + +#ifdef BOOST_MSVC +# pragma warning(pop) +#endif + +void const * +void_caster_shortcut::vbc_downcast( + void const * const t +) const { + // try to find a chain that gives us what we want + const void_cast_detail::set_type & s + = void_cast_detail::void_caster_registry::get_const_instance(); + void_cast_detail::set_type::const_iterator it; + for(it = s.begin(); it != s.end(); ++it){ + // if the current candidate casts to the desired target type + if ((*it)->m_derived == m_derived){ + // and if it's not us + if ((*it)->m_base != m_base){ + // try to cast from the candidate base to our base + const void * t_new; + t_new = void_downcast(*(*it)->m_base, *m_base, t); + // if we were successful + if(NULL != t_new){ + // recast to our derived + const void_caster * vc = *it; + return vc->downcast(t_new); + } + } + } + } + return NULL; +} + +void const * +void_caster_shortcut::vbc_upcast( + void const * const t +) const { + // try to find a chain that gives us what we want + const void_cast_detail::set_type & s + = void_cast_detail::void_caster_registry::get_const_instance(); + void_cast_detail::set_type::const_iterator it; + for(it = s.begin(); it != s.end(); ++it){ + // if the current candidate casts from the desired base type + if((*it)->m_base == m_base){ + // and if it's not us + if ((*it)->m_derived != m_derived){ + // try to cast from the candidate derived to our our derived + const void * t_new; + t_new = void_upcast(*m_derived, *(*it)->m_derived, t); + if(NULL != t_new) + return (*it)->upcast(t_new); + } + } + } + return NULL; +} + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +// just used as a search key +class void_caster_argument : public void_caster +{ + virtual void const * + upcast(void const * const /*t*/) const { + assert(false); + return NULL; + } + virtual void const * + downcast( void const * const /*t*/) const { + assert(false); + return NULL; + } +public: + void_caster_argument( + extended_type_info const * derived, + extended_type_info const * base + ) : + void_caster(derived, base) + {} + virtual ~void_caster_argument(){}; +}; + +#ifdef BOOST_MSVC +# pragma warning(pop) +#endif + +// implementation of void caster base class +BOOST_SERIALIZATION_DECL(void) +void_caster::recursive_register(bool includes_virtual_base) const { + void_cast_detail::set_type & s + = void_cast_detail::void_caster_registry::get_mutable_instance(); + + #ifdef BOOST_SERIALIZATION_LOG + std::clog << "recursive_register\n"; + std::clog << m_derived->get_debug_info(); + std::clog << "<-"; + std::clog << m_base->get_debug_info(); + std::clog << "\n"; + #endif + + std::pair result; + result = s.insert(this); + assert(result.second); + + // generate all implied void_casts. + void_cast_detail::set_type::const_iterator it; + for(it = s.begin(); it != s.end(); ++it){ + if(* m_derived == * (*it)->m_base){ + const void_caster_argument vca( + (*it)->m_derived, + m_base + ); + void_cast_detail::set_type::const_iterator i; + i = s.find(& vca); + if(i == s.end()){ + new void_caster_shortcut( + (*it)->m_derived, + m_base, + m_difference + (*it)->m_difference, + includes_virtual_base, + this + ); + } + } + if(* (*it)->m_derived == * m_base){ + const void_caster_argument vca( + m_derived, + (*it)->m_base + ); + void_cast_detail::set_type::const_iterator i; + i = s.find(& vca); + if(i == s.end()){ + new void_caster_shortcut( + m_derived, + (*it)->m_base, + m_difference + (*it)->m_difference, + includes_virtual_base, + this + ); + } + } + } +} + +BOOST_SERIALIZATION_DECL(void) +void_caster::recursive_unregister() const { + if(void_caster_registry::is_destroyed()) + return; + + #ifdef BOOST_SERIALIZATION_LOG + std::clog << "recursive_unregister\n"; + std::clog << m_derived->get_debug_info(); + std::clog << "<-"; + std::clog << m_base->get_debug_info(); + std::clog << "\n"; + #endif + + void_cast_detail::set_type & s + = void_caster_registry::get_mutable_instance(); + + // delete all shortcuts which use this primitive + void_cast_detail::set_type::iterator it; + for(it = s.begin(); it != s.end();){ + const void_caster * vc = *it; + if(vc == this){ + s.erase(it++); + } + else + if(vc->m_parent == this){ + s.erase(it); + delete vc; + it = s.begin(); + } + else + it++; + } +} + +} // namespace void_cast_detail + +// Given a void *, assume that it really points to an instance of one type +// and alter it so that it would point to an instance of a related type. +// Return the altered pointer. If there exists no sequence of casts that +// can transform from_type to to_type, return a NULL. +BOOST_SERIALIZATION_DECL(void const *) +void_upcast( + extended_type_info const & derived, + extended_type_info const & base, + void const * const t +){ + // same types - trivial case + if (derived == base) + return t; + + // check to see if base/derived pair is found in the registry + const void_cast_detail::set_type & s + = void_cast_detail::void_caster_registry::get_const_instance(); + const void_cast_detail::void_caster_argument ca(& derived, & base); + + void_cast_detail::set_type::const_iterator it; + it = s.find(& ca); + if (s.end() != it) + return (*it)->upcast(t); + + return NULL; +} + +BOOST_SERIALIZATION_DECL(void const *) +void_downcast( + extended_type_info const & derived, + extended_type_info const & base, + void const * const t +){ + // same types - trivial case + if (derived == base) + return t; + + // check to see if base/derived pair is found in the registry + const void_cast_detail::set_type & s + = void_cast_detail::void_caster_registry::get_const_instance(); + const void_cast_detail::void_caster_argument ca(& derived, & base); + + void_cast_detail::set_type::const_iterator it; + it = s.find(&ca); + if (s.end() != it) + return(*it)->downcast(t); + + return NULL; +} + +} // namespace serialization +} // namespace boost diff --git a/deal.II/contrib/boost/libs/serialization/src/xml_archive_exception.cpp b/deal.II/contrib/boost/libs/serialization/src/xml_archive_exception.cpp new file mode 100644 index 0000000000..ad16bd9e2f --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/src/xml_archive_exception.cpp @@ -0,0 +1,56 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// xml_archive_exception.cpp: + +// (C) Copyright 2009 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. + +#if (defined _MSC_VER) && (_MSC_VER == 1200) +# pragma warning (disable : 4786) // too long name, harmless warning +#endif + +#define BOOST_ARCHIVE_SOURCE + +#include +#include +#include + +#include + +namespace boost { +namespace archive { + +BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) +xml_archive_exception::xml_archive_exception( + exception_code c, + const char * e1, + const char * e2 + ) : + archive_exception(other_exception, e1, e2) + { + m_msg = "programming error"; + switch(c){ + case xml_archive_parsing_error: + m_msg = "unrecognized XML syntax"; + break; + case xml_archive_tag_mismatch: + m_msg = "XML start/end tag mismatch"; + if(NULL != e1){ + m_msg += " - "; + m_msg += e1; + } + break; + case xml_archive_tag_name_error: + m_msg = "Invalid XML tag name"; + break; + default: + assert(false); + break; + } + } + +} // archive +} // boost diff --git a/deal.II/contrib/boost/libs/serialization/src/xml_grammar.cpp b/deal.II/contrib/boost/libs/serialization/src/xml_grammar.cpp new file mode 100644 index 0000000000..4f2c37c6d9 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/src/xml_grammar.cpp @@ -0,0 +1,73 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// xml_grammar.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. + +#if (defined _MSC_VER) && (_MSC_VER == 1200) +# pragma warning (disable : 4786) // too long name, harmless warning +#endif + +#define BOOST_ARCHIVE_SOURCE +#include + +using namespace boost::spirit; + +#include + +// fixup for borland +// The following code will be put into Boost.Config in a later revision +#if ! defined(__SGI_STL_PORT) \ +&& defined(BOOST_RWSTD_VER) && BOOST_RWSTD_VER<=0x020101 +#include +namespace std { + template<> + inline string & + string::replace ( + char * first1, + char * last1, + const char * first2, + const char * last2 + ){ + replace(first1-begin(),last1-first1,first2,last2-first2,0,last2-first2); + return *this; + } +} // namespace std +#endif + +namespace boost { +namespace archive { + +typedef basic_xml_grammar xml_grammar; + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// specific definitions for char based XML + +template<> +void xml_grammar::init_chset(){ + Char = chset_t("\x9\xA\xD\x20-\x7f\x80\x81-\xFF"); + Letter = chset_t("\x41-\x5A\x61-\x7A\xC0-\xD6\xD8-\xF6\xF8-\xFF"); + Digit = chset_t("0-9"); + Extender = chset_t('\xB7'); + Sch = chset_t("\x20\x9\xD\xA"); + NameChar = Letter | Digit | chset_p("._:-") | Extender ; +} + +} // namespace archive +} // namespace boost + +#include "basic_xml_grammar.ipp" + +namespace boost { +namespace archive { + +// explicit instantiation of xml for 8 bit characters +template class basic_xml_grammar; + +} // namespace archive +} // namespace boost + diff --git a/deal.II/contrib/boost/libs/serialization/src/xml_iarchive.cpp b/deal.II/contrib/boost/libs/serialization/src/xml_iarchive.cpp new file mode 100644 index 0000000000..6d0de772f4 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/src/xml_iarchive.cpp @@ -0,0 +1,46 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// xml_iarchive.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. + +#if (defined _MSC_VER) && (_MSC_VER == 1200) +# pragma warning (disable : 4786) // too long name, harmless warning +#endif + +#define BOOST_ARCHIVE_SOURCE + +// the following works around an issue between spirit 1.61 and borland. +// it turns out the the certain spirit stuff must be defined before +// certain parts of mpl. including this here makes sure that happens +#include +#include +#if BOOST_WORKAROUND(__BORLANDC__, <= 0x560 ) +#include +#endif + +#include +#include + +// explicitly instantiate for this type of xml stream +#include +#include +#include + +namespace boost { +namespace archive { + +template class detail::archive_serializer_map; +template class basic_xml_iarchive ; +template class xml_iarchive_impl ; + +template class detail::archive_serializer_map; +template class basic_xml_iarchive ; +template class xml_iarchive_impl ; + +} // namespace archive +} // namespace boost diff --git a/deal.II/contrib/boost/libs/serialization/src/xml_oarchive.cpp b/deal.II/contrib/boost/libs/serialization/src/xml_oarchive.cpp new file mode 100644 index 0000000000..88bcdd652b --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/src/xml_oarchive.cpp @@ -0,0 +1,32 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// xml_oarchive.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. + +#if (defined _MSC_VER) && (_MSC_VER == 1200) +# pragma warning (disable : 4786) // too long name, harmless warning +#endif + +#define BOOST_ARCHIVE_SOURCE +#include +#include + +// explicitly instantiate for this type of xml stream +#include +#include +#include + +namespace boost { +namespace archive { + +template class detail::archive_serializer_map; +template class basic_xml_oarchive ; +template class xml_oarchive_impl ; + +} // namespace archive +} // namespace boost diff --git a/deal.II/contrib/boost/libs/serialization/src/xml_wgrammar.cpp b/deal.II/contrib/boost/libs/serialization/src/xml_wgrammar.cpp new file mode 100644 index 0000000000..cbd3c7b15b --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/src/xml_wgrammar.cpp @@ -0,0 +1,157 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// xml_wgrammar.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 + +#ifdef BOOST_NO_STD_WSTREAMBUF +#error "wide char i/o not supported on this platform" +#else + +#define BOOST_WARCHIVE_SOURCE +#include + +using namespace boost::spirit; + +// fixup for RogueWave +#include +#if ! defined(__SGI_STL_PORT) \ +&& defined(BOOST_RWSTD_VER) && BOOST_RWSTD_VER<=0x020101 +#include +namespace std { + template<> + inline wstring & + wstring::replace ( + wchar_t * first1, + wchar_t * last1, + const wchar_t * first2, + const wchar_t * last2 + ){ + replace(first1-begin(),last1-first1,first2,last2-first2,0,last2-first2); + return *this; + } +} // namespace std +#endif + +namespace boost { +namespace archive { + +typedef basic_xml_grammar xml_wgrammar; + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// specific definitions for wchar_t based XML + +template<> +void xml_wgrammar::init_chset(){ + Char = chset_t( + #if defined(__GNUC__) && defined(linux) + L"\x9\xA\xD\x20-\xD7FF\xE000-\xFFFD\x10000-\x10FFFF" + #else + L"\x9\xA\xD\x20-\xD7FF\xE000-\xFFFD" + #endif + ); + + Sch = chset_t(L"\x20\x9\xD\xA"); + + BaseChar = chset_t( + L"\x41-\x5A\x61-\x7A\xC0-\xD6\xD8-\xF6\xF8-\xFF\x100-\x131\x134-\x13E" + L"\x141-\x148\x14A-\x17E\x180-\x1C3\x1CD-\x1F0\x1F4-\x1F5\x1FA-\x217" + L"\x250-\x2A8\x2BB-\x2C1\x386\x388-\x38A\x38C\x38E-\x3A1\x3A3-\x3CE" + L"\x3D0-\x3D6\x3DA\x3DC\x3DE\x3E0\x3E2-\x3F3\x401-\x40C\x40E-\x44F" + L"\x451-\x45C\x45E-\x481\x490-\x4C4\x4C7-\x4C8\x4CB-\x4CC\x4D0-\x4EB" + L"\x4EE-\x4F5\x4F8-\x4F9\x531-\x556\x559\x561-\x586\x5D0-\x5EA" + L"\x5F0-\x5F2\x621-\x63A\x641-\x64A\x671-\x6B7\x6BA-\x6BE\x6C0-\x6CE" + L"\x6D0-\x6D3\x6D5\x6E5-\x6E6\x905-\x939\x93D\x958-\x961\x985-\x98C" + L"\x98F-\x990\x993-\x9A8\x9AA-\x9B0\x9B2\x9B6-\x9B9\x9DC-\x9DD" + L"\x9DF-\x9E1\x9F0-\x9F1\xA05-\xA0A\xA0F-\xA10\xA13-\xA28\xA2A-\xA30" + L"\xA32-\xA33\xA35-\xA36\xA38-\xA39\xA59-\xA5C\xA5E\xA72-\xA74" + L"\xA85-\xA8B\xA8D\xA8F-\xA91\xA93-\xAA8\xAAA-\xAB0\xAB2-\xAB3" + L"\xAB5-\xAB9\xABD\xAE0\xB05-\xB0C\xB0F-\xB10\xB13-\xB28\xB2A-\xB30" + L"\xB32-\xB33\xB36-\xB39\xB3D\xB5C-\xB5D\xB5F-\xB61\xB85-\xB8A" + L"\xB8E-\xB90\xB92-\xB95\xB99-\xB9A\xB9C\xB9E-\xB9F\xBA3-\xBA4" + L"\xBA8-\xBAA\xBAE-\xBB5\xBB7-\xBB9\xC05-\xC0C\xC0E-\xC10\xC12-\xC28" + L"\xC2A-\xC33\xC35-\xC39\xC60-\xC61\xC85-\xC8C\xC8E-\xC90\xC92-\xCA8" + L"\xCAA-\xCB3\xCB5-\xCB9\xCDE\xCE0-\xCE1\xD05-\xD0C\xD0E-\xD10" + L"\xD12-\xD28\xD2A-\xD39\xD60-\xD61\xE01-\xE2E\xE30\xE32-\xE33" + L"\xE40-\xE45\xE81-\xE82\xE84\xE87-\xE88\xE8A\xE8D\xE94-\xE97" + L"\xE99-\xE9F\xEA1-\xEA3\xEA5\xEA7\xEAA-\xEAB\xEAD-\xEAE\xEB0" + L"\xEB2-\xEB3\xEBD\xEC0-\xEC4\xF40-\xF47\xF49-\xF69\x10A0-\x10C5" + L"\x10D0-\x10F6\x1100\x1102-\x1103\x1105-\x1107\x1109\x110B-\x110C" + L"\x110E-\x1112\x113C\x113E\x1140\x114C\x114E\x1150\x1154-\x1155" + L"\x1159\x115F-\x1161\x1163\x1165\x1167\x1169\x116D-\x116E" + L"\x1172-\x1173\x1175\x119E\x11A8\x11AB\x11AE-\x11AF\x11B7-\x11B8" + L"\x11BA\x11BC-\x11C2\x11EB\x11F0\x11F9\x1E00-\x1E9B\x1EA0-\x1EF9" + L"\x1F00-\x1F15\x1F18-\x1F1D\x1F20-\x1F45\x1F48-\x1F4D\x1F50-\x1F57" + L"\x1F59\x1F5B\x1F5D\x1F5F-\x1F7D\x1F80-\x1FB4\x1FB6-\x1FBC\x1FBE" + L"\x1FC2-\x1FC4\x1FC6-\x1FCC\x1FD0-\x1FD3\x1FD6-\x1FDB\x1FE0-\x1FEC" + L"\x1FF2-\x1FF4\x1FF6-\x1FFC\x2126\x212A-\x212B\x212E\x2180-\x2182" + L"\x3041-\x3094\x30A1-\x30FA\x3105-\x312C\xAC00-\xD7A3" + ); + + Ideographic = chset_t(L"\x4E00-\x9FA5\x3007\x3021-\x3029"); + + Letter = BaseChar | Ideographic; + + CombiningChar = chset_t( + L"\x0300-\x0345\x0360-\x0361\x0483-\x0486\x0591-\x05A1\x05A3-\x05B9" + L"\x05BB-\x05BD\x05BF\x05C1-\x05C2\x05C4\x064B-\x0652\x0670" + L"\x06D6-\x06DC\x06DD-\x06DF\x06E0-\x06E4\x06E7-\x06E8\x06EA-\x06ED" + L"\x0901-\x0903\x093C\x093E-\x094C\x094D\x0951-\x0954\x0962-\x0963" + L"\x0981-\x0983\x09BC\x09BE\x09BF\x09C0-\x09C4\x09C7-\x09C8" + L"\x09CB-\x09CD\x09D7\x09E2-\x09E3\x0A02\x0A3C\x0A3E\x0A3F" + L"\x0A40-\x0A42\x0A47-\x0A48\x0A4B-\x0A4D\x0A70-\x0A71\x0A81-\x0A83" + L"\x0ABC\x0ABE-\x0AC5\x0AC7-\x0AC9\x0ACB-\x0ACD\x0B01-\x0B03\x0B3C" + L"\x0B3E-\x0B43\x0B47-\x0B48\x0B4B-\x0B4D\x0B56-\x0B57\x0B82-\x0B83" + L"\x0BBE-\x0BC2\x0BC6-\x0BC8\x0BCA-\x0BCD\x0BD7\x0C01-\x0C03" + L"\x0C3E-\x0C44\x0C46-\x0C48\x0C4A-\x0C4D\x0C55-\x0C56\x0C82-\x0C83" + L"\x0CBE-\x0CC4\x0CC6-\x0CC8\x0CCA-\x0CCD\x0CD5-\x0CD6\x0D02-\x0D03" + L"\x0D3E-\x0D43\x0D46-\x0D48\x0D4A-\x0D4D\x0D57\x0E31\x0E34-\x0E3A" + L"\x0E47-\x0E4E\x0EB1\x0EB4-\x0EB9\x0EBB-\x0EBC\x0EC8-\x0ECD" + L"\x0F18-\x0F19\x0F35\x0F37\x0F39\x0F3E\x0F3F\x0F71-\x0F84" + L"\x0F86-\x0F8B\x0F90-\x0F95\x0F97\x0F99-\x0FAD\x0FB1-\x0FB7\x0FB9" + L"\x20D0-\x20DC\x20E1\x302A-\x302F\x3099\x309A" + ); + + Digit = chset_t( + L"\x0030-\x0039\x0660-\x0669\x06F0-\x06F9\x0966-\x096F\x09E6-\x09EF" + L"\x0A66-\x0A6F\x0AE6-\x0AEF\x0B66-\x0B6F\x0BE7-\x0BEF\x0C66-\x0C6F" + L"\x0CE6-\x0CEF\x0D66-\x0D6F\x0E50-\x0E59\x0ED0-\x0ED9\x0F20-\x0F29" + ); + + Extender = chset_t( + L"\x00B7\x02D0\x02D1\x0387\x0640\x0E46\x0EC6\x3005\x3031-\x3035" + L"\x309D-\x309E\x30FC-\x30FE" + ); + + NameChar = + Letter + | Digit + | L'.' + | L'-' + | L'_' + | L':' + | CombiningChar + | Extender + ; +} +} // namespace archive +} // namespace boost + +#include "basic_xml_grammar.ipp" + +namespace boost { +namespace archive { + +// explicit instantiation of xml for wide characters +template class basic_xml_grammar; + +} // namespace archive +} // namespace boost + +#endif diff --git a/deal.II/contrib/boost/libs/serialization/src/xml_wiarchive.cpp b/deal.II/contrib/boost/libs/serialization/src/xml_wiarchive.cpp new file mode 100644 index 0000000000..2e10947b51 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/src/xml_wiarchive.cpp @@ -0,0 +1,53 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// xml_wiarchive.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 +#ifdef BOOST_NO_STD_WSTREAMBUF +#error "wide char i/o not supported on this platform" +#else + +#include + +#if (defined _MSC_VER) && (_MSC_VER == 1200) +# pragma warning (disable : 4786) // too long name, harmless warning +#endif + +#define BOOST_WARCHIVE_SOURCE + +// the following works around an issue between spirit 1.61 and borland. +// it turns out the the certain spirit stuff must be defined before +// certain parts of mpl. including this here makes sure that happens +#if BOOST_WORKAROUND(__BORLANDC__, <= 0x560 ) +#include +#endif + +#include +#include + +// explicitly instantiate for this type of xml stream +#include +#include +#include + +namespace boost { +namespace archive { + +template class detail::archive_serializer_map; +template class basic_xml_iarchive ; +template class xml_wiarchive_impl ; + +template class detail::archive_serializer_map; +template class basic_xml_iarchive ; +template class xml_wiarchive_impl ; + +} // namespace archive +} // namespace boost + +#endif // BOOST_NO_STD_WSTREAMBUF diff --git a/deal.II/contrib/boost/libs/serialization/src/xml_woarchive.cpp b/deal.II/contrib/boost/libs/serialization/src/xml_woarchive.cpp new file mode 100644 index 0000000000..e71daaf6fd --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/src/xml_woarchive.cpp @@ -0,0 +1,35 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// xml_woarchive.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 +#ifdef BOOST_NO_STD_WSTREAMBUF +#error "wide char i/o not supported on this platform" +#else + +#define BOOST_WARCHIVE_SOURCE +#include +#include + +// explicitly instantiate for this type of text stream +#include +#include +#include + +namespace boost { +namespace archive { + +template class detail::archive_serializer_map; +template class basic_xml_oarchive ; +template class xml_woarchive_impl ; + +} // namespace archive +} // namespace boost + +#endif // BOOST_NO_STD_WSTREAMBUF diff --git a/deal.II/contrib/boost/libs/serialization/test/A.cpp b/deal.II/contrib/boost/libs/serialization/test/A.cpp new file mode 100644 index 0000000000..bd3e9fb91f --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/A.cpp @@ -0,0 +1,222 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// A.cpp 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 +#include // rand() +#include // fabs() +#include // size_t + +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::rand; + using ::fabs; + using ::size_t; +} +#endif + +#include +#if BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1) +#include +#endif + +#include "A.hpp" + +template +void randomize(S &x) +{ + assert(0 == x.size()); + for(;;){ + unsigned int i = std::rand() % 27; + if(0 == i) + break; + x += static_cast('a' - 1 + i); + } +} + +template +void accumulate(std::size_t & s, const T & t){ + const char * tptr = (const char *)(& t); + unsigned int count = sizeof(t); + while(count-- > 0){ + s += *tptr++; + } +} + +A::operator std::size_t () const { + std::size_t retval = 0; + accumulate(retval, b); + #ifndef BOOST_NO_INT64_T + accumulate(retval, f); + accumulate(retval, g); + #endif + accumulate(retval, l); + accumulate(retval, m); + accumulate(retval, n); + accumulate(retval, o); + accumulate(retval, p); + accumulate(retval, q); + #ifndef BOOST_NO_CWCHAR + accumulate(retval, r); + #endif + accumulate(retval, c); + accumulate(retval, s); + accumulate(retval, t); + accumulate(retval, u); + accumulate(retval, v); + return retval; +} + +#if defined(_MSC_VER) +#pragma warning(push) // Save warning settings. +#pragma warning(disable : 4244) // Disable possible loss of data warning + +#endif +A::A() : + b(true), + #ifndef BOOST_NO_INT64_T + f(std::rand() * std::rand()), + g(std::rand() * std::rand()), + #endif + l(static_cast(std::rand() % 3)), + m(std::rand()), + n(std::rand()), + o(std::rand()), + p(std::rand()), + q(std::rand()), + #ifndef BOOST_NO_CWCHAR + r(std::rand()), + #endif + c(0xff & std::rand()), + s(0xff & std::rand()), + t(0xff & std::rand()), + u(std::rand()), + v(std::rand()), + w((float)std::rand()), + x((double)std::rand()) +{ + randomize(y); + #ifndef BOOST_NO_STD_WSTRING + randomize(z); + #endif +} + +#if defined(_MSC_VER) +#pragma warning(pop) // Restore warnings to previous state. +#endif + +bool A::operator==(const A &rhs) const +{ + if(b != rhs.b) + return false; + if(l != rhs.l) + return false; + #ifndef BOOST_NO_INT64_T + if(f != rhs.f) + return false; + if(g != rhs.g) + return false; + #endif + if(m != rhs.m) + return false; + if(n != rhs.n) + return false; + if(o != rhs.o) + return false; + if(p != rhs.p) + return false; + if(q != rhs.q) + return false; + #ifndef BOOST_NO_CWCHAR + if(r != rhs.r) + return false; + #endif + if(c != rhs.c) + return false; + if(s != rhs.s) + return false; + if(t != rhs.t) + return false; + if(u != rhs.u) + return false; + if(v != rhs.v) + return false; + if(w == 0 && std::fabs(rhs.w) > std::numeric_limits::epsilon()) + return false; + if(std::fabs(rhs.w/w - 1.0) > std::numeric_limits::epsilon()) + return false; + if(x == 0 && std::fabs(rhs.x - x) > std::numeric_limits::epsilon()) + return false; + if(std::fabs(rhs.x/x - 1.0) > std::numeric_limits::epsilon()) + return false; + if(0 != y.compare(rhs.y)) + return false; + #ifndef BOOST_NO_STD_WSTRING + if(0 != z.compare(rhs.z)) + return false; + #endif + return true; +} + +bool A::operator!=(const A &rhs) const +{ + return ! (*this == rhs); +} + +bool A::operator<(const A &rhs) const +{ + if(b != rhs.b) + return b < rhs.b; + #ifndef BOOST_NO_INT64_T + if(f != rhs.f) + return f < rhs.f; + if(g != rhs.g) + return g < rhs.g; + #endif + if(l != rhs.l ) + return l < rhs.l; + if(m != rhs.m ) + return m < rhs.m; + if(n != rhs.n ) + return n < rhs.n; + if(o != rhs.o ) + return o < rhs.o; + if(p != rhs.p ) + return p < rhs.p; + if(q != rhs.q ) + return q < rhs.q; + #ifndef BOOST_NO_CWCHAR + if(r != rhs.r ) + return r < rhs.r; + #endif + if(c != rhs.c ) + return c < rhs.c; + if(s != rhs.s ) + return s < rhs.s; + if(t != rhs.t ) + return t < rhs.t; + if(u != rhs.u ) + return u < rhs.u; + if(v != rhs.v ) + return v < rhs.v; + if(w != rhs.w ) + return w < rhs.w; + if(x != rhs.x ) + return x < rhs.x; + int i = y.compare(rhs.y); + if(i != 0 ) + return i < 0; + #ifndef BOOST_NO_STD_WSTRING + int j = z.compare(rhs.z); + if(j != 0 ) + return j < 0; + #endif + return false; +} diff --git a/deal.II/contrib/boost/libs/serialization/test/A.hpp b/deal.II/contrib/boost/libs/serialization/test/A.hpp new file mode 100644 index 0000000000..25ea5f476d --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/A.hpp @@ -0,0 +1,158 @@ +#ifndef BOOST_SERIALIZATION_TEST_A_HPP +#define BOOST_SERIALIZATION_TEST_A_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 +// A.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 // for friend output operators +#include // size_t +#include +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::size_t; +} +#endif + +#include +#include +#include + +#include + +#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) + #include + #if BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1) + #include + #endif +#endif + +#include +#include + +#include + +#include "test_decl.hpp" + +#if defined(A_IMPORT) + #define DLL_DECL IMPORT_DECL +#elif defined(A_EXPORT) + #define DLL_DECL EXPORT_DECL +#else + #define DLL_DECL(x) +#endif + +class DLL_DECL(BOOST_PP_EMPTY()) A +{ +private: + friend class boost::serialization::access; + // note: from an aesthetic perspective, I would much prefer to have this + // defined out of line. Unfortunately, this trips a bug in the VC 6.0 + // compiler. So hold our nose and put it her to permit running of tests. + // mscvc 6.0 requires template functions to be implemented. For this + // reason we can't make abstract. + #if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) + template + void serialize( + Archive &ar, + const unsigned int /* file_version */ + ){ + ar & BOOST_SERIALIZATION_NVP(b); + #ifndef BOOST_NO_INT64_T + ar & BOOST_SERIALIZATION_NVP(f); + ar & BOOST_SERIALIZATION_NVP(g); + #endif + #if BOOST_WORKAROUND(__BORLANDC__, <= 0x551 ) + int i; + if(BOOST_DEDUCED_TYPENAME Archive::is_saving::value){ + i = l; + ar & BOOST_SERIALIZATION_NVP(i); + } + else{ + ar & BOOST_SERIALIZATION_NVP(i); + l = i; + } + #else + ar & BOOST_SERIALIZATION_NVP(l); + #endif + ar & BOOST_SERIALIZATION_NVP(m); + ar & BOOST_SERIALIZATION_NVP(n); + ar & BOOST_SERIALIZATION_NVP(o); + ar & BOOST_SERIALIZATION_NVP(p); + ar & BOOST_SERIALIZATION_NVP(q); + #ifndef BOOST_NO_CWCHAR + ar & BOOST_SERIALIZATION_NVP(r); + #endif + ar & BOOST_SERIALIZATION_NVP(c); + ar & BOOST_SERIALIZATION_NVP(s); + ar & BOOST_SERIALIZATION_NVP(t); + ar & BOOST_SERIALIZATION_NVP(u); + ar & BOOST_SERIALIZATION_NVP(v); + ar & BOOST_SERIALIZATION_NVP(w); + ar & BOOST_SERIALIZATION_NVP(x); + ar & BOOST_SERIALIZATION_NVP(y); + #ifndef BOOST_NO_STD_WSTRING + ar & BOOST_SERIALIZATION_NVP(z); + #endif + } + #else + template + void serialize( + Archive &ar, + const unsigned int /* file_version */ + ); + #endif + bool b; + #ifndef BOOST_NO_INT64_T + boost::int64_t f; + boost::uint64_t g; + #endif + enum h { + i = 0, + j, + k + } l; + std::size_t m; + signed long n; + unsigned long o; + signed short p; + unsigned short q; + #ifndef BOOST_NO_CWCHAR + wchar_t r; + #endif + char c; + signed char s; + unsigned char t; + signed int u; + unsigned int v; + float w; + double x; + std::string y; + #ifndef BOOST_NO_STD_WSTRING + std::wstring z; + #endif +public: + A(); + bool operator==(const A &rhs) const; + bool operator!=(const A &rhs) const; + bool operator<(const A &rhs) const; // used by less + // hash function for class A + operator std::size_t () const; + friend std::ostream & operator<<(std::ostream & os, A const & a); +}; + +#undef DLL_DECL + +#endif // BOOST_SERIALIZATION_TEST_A_HPP diff --git a/deal.II/contrib/boost/libs/serialization/test/A.ipp b/deal.II/contrib/boost/libs/serialization/test/A.ipp new file mode 100644 index 0000000000..91d3254890 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/A.ipp @@ -0,0 +1,64 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// A.ipp 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 +#if ! BOOST_WORKAROUND(BOOST_MSVC, <= 1300) + +#if BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1) +#include +#endif + +#include "A.hpp" + +template +void A::serialize( + Archive &ar, + const unsigned int /* file_version */ +){ + ar & BOOST_SERIALIZATION_NVP(b); + #ifndef BOOST_NO_INT64_T + ar & BOOST_SERIALIZATION_NVP(f); + ar & BOOST_SERIALIZATION_NVP(g); + #endif + #if BOOST_WORKAROUND(__BORLANDC__, <= 0x551 ) + int i; + if(BOOST_DEDUCED_TYPENAME Archive::is_saving::value){ + i = l; + ar & BOOST_SERIALIZATION_NVP(i); + } + else{ + ar & BOOST_SERIALIZATION_NVP(i); + l = i; + } + #else + ar & BOOST_SERIALIZATION_NVP(l); + #endif + ar & BOOST_SERIALIZATION_NVP(m); + ar & BOOST_SERIALIZATION_NVP(n); + ar & BOOST_SERIALIZATION_NVP(o); + ar & BOOST_SERIALIZATION_NVP(p); + ar & BOOST_SERIALIZATION_NVP(q); + #ifndef BOOST_NO_CWCHAR + ar & BOOST_SERIALIZATION_NVP(r); + #endif + ar & BOOST_SERIALIZATION_NVP(c); + ar & BOOST_SERIALIZATION_NVP(s); + ar & BOOST_SERIALIZATION_NVP(t); + ar & BOOST_SERIALIZATION_NVP(u); + ar & BOOST_SERIALIZATION_NVP(v); + ar & BOOST_SERIALIZATION_NVP(w); + ar & BOOST_SERIALIZATION_NVP(x); + ar & BOOST_SERIALIZATION_NVP(y); + #ifndef BOOST_NO_STD_WSTRING + ar & BOOST_SERIALIZATION_NVP(z); + #endif +} + +#endif // workaround BOOST_WORKAROUND(BOOST_MSVC, <= 1300) diff --git a/deal.II/contrib/boost/libs/serialization/test/B.hpp b/deal.II/contrib/boost/libs/serialization/test/B.hpp new file mode 100644 index 0000000000..9d2f14d821 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/B.hpp @@ -0,0 +1,113 @@ +#ifndef BOOST_SERIALIZATION_TEST_B_HPP +#define BOOST_SERIALIZATION_TEST_B_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 +// B.hpp + +// (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 // for rand() +#include + +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::rand; +} +#endif + +#include +#include +#include + +#include "A.hpp" + +/////////////////////////////////////////////////////// +// Derived class test +class B : public A +{ +private: + friend class boost::serialization::access; + template + void save(Archive &ar, const unsigned int /* file_version */) const + { + // write any base class info to the archive + ar << BOOST_SERIALIZATION_BASE_OBJECT_NVP(A); + + // write out members + ar << BOOST_SERIALIZATION_NVP(s); + ar << BOOST_SERIALIZATION_NVP(t); + ar << BOOST_SERIALIZATION_NVP(u); + ar << BOOST_SERIALIZATION_NVP(v); + ar << BOOST_SERIALIZATION_NVP(w); + ar << BOOST_SERIALIZATION_NVP(x); + } + + template + void load(Archive & ar, const unsigned int file_version) + { + // read any base class info to the archive + ar >> BOOST_SERIALIZATION_BASE_OBJECT_NVP(A); + switch(file_version){ + case 1: + case 2: + ar >> BOOST_SERIALIZATION_NVP(s); + ar >> BOOST_SERIALIZATION_NVP(t); + ar >> BOOST_SERIALIZATION_NVP(u); + ar >> BOOST_SERIALIZATION_NVP(v); + ar >> BOOST_SERIALIZATION_NVP(w); + ar >> BOOST_SERIALIZATION_NVP(x); + default: + break; + } + } + + BOOST_SERIALIZATION_SPLIT_MEMBER() + signed char s; + unsigned char t; + signed int u; + unsigned int v; + float w; + double x; +public: + B(); + virtual ~B(){}; + bool operator==(const B &rhs) const; +}; + +B::B() : + s(static_cast(std::rand())), + t(static_cast(std::rand())), + u(std::rand()), + v(std::rand()), + w((float)std::rand() / std::rand()), + x((double)std::rand() / std::rand()) +{ +} + +BOOST_CLASS_VERSION(B, 2) + +inline bool B::operator==(const B &rhs) const +{ + return + A::operator==(rhs) + && s == rhs.s + && t == rhs.t + && u == rhs.u + && v == rhs.v + && std::fabs(w - rhs.w) <= std::numeric_limits::round_error() + && std::fabs(x - rhs.x) <= std::numeric_limits::round_error() + ; +} + +#endif // BOOST_SERIALIZATION_TEST_B_HPP diff --git a/deal.II/contrib/boost/libs/serialization/test/C.hpp b/deal.II/contrib/boost/libs/serialization/test/C.hpp new file mode 100644 index 0000000000..8dc0a1b9c2 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/C.hpp @@ -0,0 +1,68 @@ +#ifndef BOOST_SERIALIZATION_TEST_A_HPP +#define BOOST_SERIALIZATION_TEST_A_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 +// C.hpp + +// (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 +#include +#include + +#include "B.hpp" + +/////////////////////////////////////////////////////// +// Contained class +class C +{ +private: + friend class boost::serialization::access; + template + void save(Archive &ar, boost::archive::version_type file_version) const; + template + void load(Archive & ar, boost::archive::version_type file_version); + BOOST_SERIALIZATION_MEMBER_SPLIT() + B b; +public: + bool operator==(const C &rhs) const; +}; + +BOOST_CLASS_VERSION(C, 1) + +inline bool C::operator==(const C &rhs) const +{ + return b == rhs.b; +} + +template +inline void save(Archive &ar, boost::archive::version_type file_version) const +{ + ar << b; +} + +template +inline void load(Archive & ar, boost::archive::version_type file_version){ +{ + switch(file_version){ + case 1: + ar >> b; + break; + case 2: + default: + assert(false); + break; + } +} + +#endif // BOOST_SERIALIZATION_TEST_C_HPP diff --git a/deal.II/contrib/boost/libs/serialization/test/D.hpp b/deal.II/contrib/boost/libs/serialization/test/D.hpp new file mode 100644 index 0000000000..972aceeea5 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/D.hpp @@ -0,0 +1,88 @@ +#ifndef BOOST_SERIALIZATION_TEST_D_HPP +#define BOOST_SERIALIZATION_TEST_D_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 +// D.hpp + +// (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 // NULL + +#include "test_tools.hpp" +#include +#include +#include + +#include "B.hpp" + +/////////////////////////////////////////////////////// +// Contained class with multiple identical pointers +class D +{ +private: + friend class boost::serialization::access; + B *b1; + B *b2; + template + void save(Archive &ar, const unsigned int file_version) const{ + ar << BOOST_SERIALIZATION_NVP(b1); + ar << BOOST_SERIALIZATION_NVP(b2); + } + + template + void load(Archive & ar, const unsigned int file_version){ + BOOST_TRY { + ar >> boost::serialization::make_nvp("b", b1); + ar >> boost::serialization::make_nvp("b", b2); + } + BOOST_CATCH (...){ + // eliminate invalid pointers + b1 = NULL; + b2 = NULL; + BOOST_FAIL( "multiple identical pointers failed to load" ); + } + BOOST_CATCH_END + // check that loading was correct + BOOST_CHECK(b1 == b2); + } + + BOOST_SERIALIZATION_SPLIT_MEMBER() +public: + D(); + ~D(); + bool operator==(const D &rhs) const; +}; + +BOOST_CLASS_VERSION(D, 3) + +D::D() +{ + b1 = new B(); + b2 = b1; +} + +D::~D() +{ + delete b1; +} + +bool D::operator==(const D &rhs) const +{ + if(! (*b1 == *(rhs.b1)) ) + return false; + if(! (*b2 == *(rhs.b2)) ) + return false; + return true; +} + +#endif // BOOST_SERIALIZATION_TEST_D_HPP diff --git a/deal.II/contrib/boost/libs/serialization/test/J.hpp b/deal.II/contrib/boost/libs/serialization/test/J.hpp new file mode 100644 index 0000000000..7b4c2f8425 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/J.hpp @@ -0,0 +1,51 @@ +#ifndef BOOST_SERIALIZATION_TEST_J_HPP +#define BOOST_SERIALIZATION_TEST_J_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 +// J.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 + +#include "A.hpp" + +/////////////////////////////////////////////////////// +// class with a member which refers to itself +class J : public A +{ +private: + friend class boost::serialization::access; + template + void serialize( + Archive &ar, + const unsigned int /* file_version */ + ){ + ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(A); + ar & BOOST_SERIALIZATION_NVP(j); + } +public: + bool operator==(const J &rhs) const; + J *j; + J(J *_j) : j(_j) {} + J() : j(NULL){} +}; + +BOOST_CLASS_VERSION(J, 6) + +bool J::operator==(const J &rhs) const +{ + return static_cast(*this) == static_cast(rhs); +} + +#endif // BOOST_SERIALIZATION_TEST_J_HPP diff --git a/deal.II/contrib/boost/libs/serialization/test/Jamfile.v2 b/deal.II/contrib/boost/libs/serialization/test/Jamfile.v2 new file mode 100644 index 0000000000..b3cd598190 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/Jamfile.v2 @@ -0,0 +1,160 @@ +# Boost serialization Library test Jamfile + +# (C) Copyright Robert Ramey 2002-2004. +# Use, modification, and distribution are 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) +# + +project libs/serialization/test + : id serialization_test + ; + +# import rules from the boost serialization test +# import ../util/test : test-bsl-run-no-lib ; +import ../util/test : + run-template + run-invoke + run-winvoke + test-bsl-run-no-lib + test-bsl-run + test-bsl-run_archive + test-bsl-run_files + test-bsl-run_polymorphic_archive +; + +BOOST_ARCHIVE_LIST = [ modules.peek : BOOST_ARCHIVE_LIST ] ; + +lib dll_a_lib + : + dll_a.cpp + ../build//boost_serialization + : + shared + ; + +lib dll_base_lib + : + dll_base.cpp + ../build//boost_serialization + : + shared + ; + +lib dll_derived2_lib + : + dll_derived2.cpp + dll_base_lib + ../build//boost_serialization + : + shared + ; + +lib dll_polymorphic_derived2_lib + : + polymorphic_derived2.cpp + ../build//boost_serialization + : + shared + ; + +test-suite "serialization" : + [ test-bsl-run_files test_array : A ] + [ test-bsl-run_files test_binary ] + [ test-bsl-run_files test_bitset ] + [ test-bsl-run_files test_complex ] + [ test-bsl-run_files test_contained_class : A ] + [ test-bsl-run_files test_cyclic_ptrs : A ] + [ test-bsl-run_files test_delete_pointer ] + [ test-bsl-run_files test_deque : A ] + [ test-bsl-run_files test_derived ] + [ test-bsl-run_files test_derived_class : A ] + [ test-bsl-run_files test_derived_class_ptr : A ] + [ test-bsl-run_files test_diamond ] + [ test-bsl-run_files test_exported : polymorphic_base ] + [ test-bsl-run_files test_class_info_load ] + [ test-bsl-run_files test_class_info_save ] + [ test-bsl-run_files test_object ] + [ test-bsl-run_files test_primitive ] + [ test-bsl-run_files test_list : A ] + [ test-bsl-run_files test_list_ptrs : A ] + [ 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_multiple_inheritance ] + [ test-bsl-run_files test_no_rtti : polymorphic_base polymorphic_derived1 ] + [ test-bsl-run_files test_non_intrusive ] + [ test-bsl-run_files test_non_default_ctor ] + [ test-bsl-run_files test_non_default_ctor2 ] + [ test-bsl-run_files test_null_ptr ] + [ test-bsl-run_files test_nvp : A ] + [ test-bsl-run_files test_recursion : A ] + [ test-bsl-run_files test_registered ] + [ test-bsl-run_files test_set : A ] + [ test-bsl-run_files test_simple_class : A ] + [ test-bsl-run_files test_simple_class_ptr : A ] + [ test-bsl-run_files test_split ] + [ test-bsl-run_files test_tracking ] + [ test-bsl-run_files test_unregistered ] + [ test-bsl-run_files test_valarray ] + [ test-bsl-run_files test_variant : A ] + [ test-bsl-run_files test_vector : A ] + [ test-bsl-run_files test_new_operator : A ] + [ test-bsl-run_files test_optional ] + [ test-bsl-run_files test_shared_ptr ] + [ test-bsl-run_files test_shared_ptr_multi_base ] + [ test-bsl-run_files test_shared_ptr_132 ] + [ test-bsl-run_polymorphic_archive test_polymorphic : test_polymorphic_A A ] + [ test-bsl-run_polymorphic_archive test_polymorphic2 : test_polymorphic2imp ] + ; + +if ! $(BOOST_ARCHIVE_LIST) { + test-suite "serialization2" : + [ test-bsl-run test_dll_exported : : dll_polymorphic_derived2_lib : shared ] + [ test-bsl-run test_dll_simple : : dll_a_lib : shared ] + [ compile test_dll_plugin.cpp ] + [ test-bsl-run test_private_ctor ] + [ test-bsl-run test_reset_object_address : A ] + [ test-bsl-run test_void_cast ] + [ test-bsl-run test_mult_archive_types ] + + [ test-bsl-run-no-lib test_iterators ] + [ test-bsl-run-no-lib test_iterators_base64 ] + [ test-bsl-run-no-lib test_inclusion ] + [ test-bsl-run-no-lib test_smart_cast ] + + [ test-bsl-run-no-lib test_utf8_codecvt + : ../src/utf8_codecvt_facet + : ../../config/test/all//BOOST_NO_STD_WSTREAMBUF + ] + [ test-bsl-run-no-lib test_codecvt_null + : ../src/codecvt_null + : ../../config/test/all//BOOST_NO_STD_WSTREAMBUF + ] + + # should fail compilation + [ compile-fail test_not_serializable.cpp ] + [ compile-fail test_traits_fail.cpp ] + [ compile-fail test_const_load_fail1.cpp ] + [ compile-fail test_const_load_fail2.cpp ] + [ compile-fail test_const_load_fail3.cpp ] + [ compile-fail test_const_load_fail1_nvp.cpp ] + [ compile-fail test_const_load_fail2_nvp.cpp ] + [ compile-fail test_const_load_fail3_nvp.cpp ] + [ compile-fail test_check.cpp ] + + # should compile with a warning message + [ compile test_static_warning.cpp ] + [ compile test_const_save_warn1.cpp ] + [ compile test_const_save_warn2.cpp ] + [ compile test_const_save_warn3.cpp ] + # note - library unable to detect these errors for now + #[ compile test_const_save_warn1_nvp.cpp ] + #[ compile test_const_save_warn2_nvp.cpp ] + #[ compile test_const_save_warn3_nvp.cpp ] + + # should compile + [ compile test_traits_pass.cpp ] + [ compile test_const_pass.cpp ] + ; +} diff --git a/deal.II/contrib/boost/libs/serialization/test/base.hpp b/deal.II/contrib/boost/libs/serialization/test/base.hpp new file mode 100644 index 0000000000..38c69f7618 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/base.hpp @@ -0,0 +1,46 @@ +#ifndef BOOST_SERIALIZATION_TEST_BASE_HPP +#define BOOST_SERIALIZATION_TEST_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 +// 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 +#include +#include + +#include "test_decl.hpp" + +#if defined(BASE_IMPORT) + #define DLL_DECL IMPORT_DECL +#elif defined(BASE_EXPORT) + #define DLL_DECL EXPORT_DECL +#else + #define DLL_DECL(x) +#endif + +class DLL_DECL(BOOST_PP_EMPTY()) base +{ + friend class boost::serialization::access; + template + void serialize(Archive & /* ar */, const unsigned int /* file_version */); +public: + virtual ~base(){}; +}; + +BOOST_SERIALIZATION_ASSUME_ABSTRACT(base) + +#undef DLL_DECL + +#endif // BOOST_SERIALIZATION_TEST_BASE_HPP diff --git a/deal.II/contrib/boost/libs/serialization/test/binary_archive.hpp b/deal.II/contrib/boost/libs/serialization/test/binary_archive.hpp new file mode 100644 index 0000000000..b4dc63eacb --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/binary_archive.hpp @@ -0,0 +1,24 @@ +// (C) Copyright 2002-4 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. +// (C) Copyright 2002-4 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. + +// binary_archive +#include +typedef boost::archive::binary_oarchive test_oarchive; +typedef std::ofstream test_ostream; + +#include +typedef boost::archive::binary_iarchive test_iarchive; +typedef std::ifstream test_istream; + +//#define TEST_STREAM_FLAGS (std::ios::binary | std::ios::in | std::ios::out) +#define TEST_STREAM_FLAGS (std::ios::binary) diff --git a/deal.II/contrib/boost/libs/serialization/test/binary_warchive.hpp b/deal.II/contrib/boost/libs/serialization/test/binary_warchive.hpp new file mode 100644 index 0000000000..929f3a37db --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/binary_warchive.hpp @@ -0,0 +1,14 @@ +// (C) Copyright 2002-4 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. +// binary_warchive +#include +typedef boost::archive::binary_woarchive test_oarchive; +typedef std::wofstream test_ostream; +#include +typedef boost::archive::binary_wiarchive test_iarchive; +typedef std::wifstream test_istream; +#define TEST_STREAM_FLAGS std::wios::binary diff --git a/deal.II/contrib/boost/libs/serialization/test/derived2.hpp b/deal.II/contrib/boost/libs/serialization/test/derived2.hpp new file mode 100644 index 0000000000..58a65a9e79 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/derived2.hpp @@ -0,0 +1,50 @@ +#ifndef BOOST_SERIALIZATION_TEST_DERIVED2_HPP +#define BOOST_SERIALIZATION_TEST_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 +// derived2.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 +#include + +#define BASE_IMPORT +#include "base.hpp" + +#include "test_decl.hpp" + +#if defined(DERIVED2_IMPORT) + #define DLL_DECL IMPORT_DECL +#elif defined(DERIVED2_EXPORT) + #define DLL_DECL EXPORT_DECL +#else + #define DLL_DECL(x) +#endif + +class DLL_DECL(BOOST_PP_EMPTY()) derived2 : + public base +{ + friend class boost::serialization::access; + template + void serialize(Archive &ar, const unsigned int /* file_version */); +public: + ~derived2(){} +}; + +#undef DLL_DECL + +// MWerks users can do this to make their code work +BOOST_SERIALIZATION_MWERKS_BASE_AND_DERIVED(base, derived2) + +#endif // BOOST_SERIALIZATION_TEST_DERIVED2_HPP diff --git a/deal.II/contrib/boost/libs/serialization/test/dll_a.cpp b/deal.II/contrib/boost/libs/serialization/test/dll_a.cpp new file mode 100644 index 0000000000..33c6dc3b09 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/dll_a.cpp @@ -0,0 +1,48 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// dll_a.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) + +// Build a dll which contains the serialization for a class A +// used in testing distribution of serialization code in DLLS + +#define A_EXPORT +#include "A.hpp" +#include "A.ipp" +#include "A.cpp" + +// instantiate code for text archives + +#include +#include + +template +EXPORT_DECL(void) A::serialize( + boost::archive::text_oarchive &ar, + const unsigned int /* file_version */ +); +template +EXPORT_DECL(void) A::serialize( + boost::archive::text_iarchive &ar, + const unsigned int /* file_version */ +); + +// instantiate code for polymorphic archives + +#include +#include + +template +EXPORT_DECL(void) A::serialize( + boost::archive::polymorphic_oarchive &ar, + const unsigned int /* file_version */ +); +template +EXPORT_DECL(void) A::serialize( + boost::archive::polymorphic_iarchive &ar, + const unsigned int /* file_version */ +); + diff --git a/deal.II/contrib/boost/libs/serialization/test/dll_base.cpp b/deal.II/contrib/boost/libs/serialization/test/dll_base.cpp new file mode 100644 index 0000000000..e33fa5dee5 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/dll_base.cpp @@ -0,0 +1,55 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// dll_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) + +// Build a dll which contains the serialization for a class A +// used in testing distribution of serialization code in DLLS +#include + +#define BASE_EXPORT +#include "base.hpp" + +template +void base::serialize( + Archive &ar, + const unsigned int /* file_version */){ +} + +// for some reason this is required at least by MSVC +// given that its declared virtual .. = 0; This +// seems wrong to me but here it is. +//polymorphic_base::~polymorphic_base(){} + +// instantiate code for text archives +#include +#include + +// instantiate code for polymorphic archives +#include +#include + +// note: BOOST_CLASS_EXPORT cannot be used to instantiate +// serialization code for an abstract base class. So use +// explicit instantiation in this case. +//BOOST_CLASS_EXPORT(polymorphic_base) + +template EXPORT_DECL(void) base::serialize( + boost::archive::text_oarchive & ar, + const unsigned int version +); +template EXPORT_DECL(void) base::serialize( + boost::archive::text_iarchive & ar, + const unsigned int version +); +template EXPORT_DECL(void) base::serialize( + boost::archive::polymorphic_oarchive & ar, + const unsigned int version +); +template EXPORT_DECL(void) base::serialize( + boost::archive::polymorphic_iarchive & ar, + const unsigned int version +); diff --git a/deal.II/contrib/boost/libs/serialization/test/dll_derived2.cpp b/deal.II/contrib/boost/libs/serialization/test/dll_derived2.cpp new file mode 100644 index 0000000000..4065c3d234 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/dll_derived2.cpp @@ -0,0 +1,54 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// dll_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) + +// Build a dll which contains the serialization for a class A +// used in testing distribution of serialization code in DLLS + +#include + +#define DERIVED2_EXPORT +#include "derived2.hpp" + +template +void derived2::serialize( + Archive &ar, + const unsigned int /* file_version */ +){ + ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(base); +} + +// instantiate code for text archives +#include +#include + +template EXPORT_DECL(void) derived2::serialize( + boost::archive::text_oarchive & ar, + const unsigned int version +); +template EXPORT_DECL(void) derived2::serialize( + boost::archive::text_iarchive & ar, + const unsigned int version +); + +#include +#include + +template EXPORT_DECL(void) derived2::serialize( + boost::archive::polymorphic_oarchive & ar, + const unsigned int version +); +template EXPORT_DECL(void) derived2::serialize( + boost::archive::polymorphic_iarchive & ar, + const unsigned int version +); + +// note: export has to be AFTER #includes for all archive classes + +#include +BOOST_SERIALIZATION_FACTORY_0(derived2) +BOOST_CLASS_EXPORT(derived2) diff --git a/deal.II/contrib/boost/libs/serialization/test/polymorphic_array_binary_archive.hpp b/deal.II/contrib/boost/libs/serialization/test/polymorphic_array_binary_archive.hpp new file mode 100644 index 0000000000..5097433aaa --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/polymorphic_array_binary_archive.hpp @@ -0,0 +1,13 @@ +// (C) Copyright 2002-4 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 +typedef boost::archive::polymorphic_binary_oarchive test_oarchive; +typedef std::ofstream test_ostream; +#include +typedef boost::archive::polymorphic_binary_iarchive test_iarchive; +typedef std::ifstream test_istream; +#define TEST_STREAM_FLAGS std::ios::binary diff --git a/deal.II/contrib/boost/libs/serialization/test/polymorphic_base.cpp b/deal.II/contrib/boost/libs/serialization/test/polymorphic_base.cpp new file mode 100644 index 0000000000..ffe8b16b93 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/polymorphic_base.cpp @@ -0,0 +1,21 @@ +/////////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 +#include "polymorphic_base.hpp" + +BOOST_CLASS_EXPORT_IMPLEMENT(polymorphic_base) + +const char * polymorphic_base::get_key() const{ + return + boost::serialization::type_info_implementation< + polymorphic_base + >::type::get_const_instance().get_key(); +} diff --git a/deal.II/contrib/boost/libs/serialization/test/polymorphic_base.hpp b/deal.II/contrib/boost/libs/serialization/test/polymorphic_base.hpp new file mode 100644 index 0000000000..b1493cfc34 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/polymorphic_base.hpp @@ -0,0 +1,51 @@ +#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 +#include +#include +#include +#include + +class polymorphic_base +{ + friend class boost::serialization::access; + template + void serialize( + Archive & /* ar */, + const unsigned int /* file_version */ + ){} +public: + // note that since this class uses the "no_rtti" + // extended_type_info implementation, it MUST + // implement this function + virtual const char * get_key() const = 0; + virtual ~polymorphic_base(){}; +}; + +BOOST_SERIALIZATION_ASSUME_ABSTRACT(polymorphic_base) + +// the no_rtti system requires this !!! +BOOST_CLASS_EXPORT_KEY(polymorphic_base) + +BOOST_CLASS_TYPE_INFO( + polymorphic_base, + boost::serialization::extended_type_info_no_rtti +) + +#endif // POLYMORPHIC_BASE_HPP diff --git a/deal.II/contrib/boost/libs/serialization/test/polymorphic_binary_archive.hpp b/deal.II/contrib/boost/libs/serialization/test/polymorphic_binary_archive.hpp new file mode 100644 index 0000000000..5097433aaa --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/polymorphic_binary_archive.hpp @@ -0,0 +1,13 @@ +// (C) Copyright 2002-4 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 +typedef boost::archive::polymorphic_binary_oarchive test_oarchive; +typedef std::ofstream test_ostream; +#include +typedef boost::archive::polymorphic_binary_iarchive test_iarchive; +typedef std::ifstream test_istream; +#define TEST_STREAM_FLAGS std::ios::binary diff --git a/deal.II/contrib/boost/libs/serialization/test/polymorphic_derived1.cpp b/deal.II/contrib/boost/libs/serialization/test/polymorphic_derived1.cpp new file mode 100644 index 0000000000..202f444563 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/polymorphic_derived1.cpp @@ -0,0 +1,23 @@ +/////////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 +#include + +#include "polymorphic_derived1.hpp" + +const char * polymorphic_derived1::get_key() const { + return + boost::serialization::type_info_implementation< + polymorphic_derived1 + >::type::get_const_instance().get_key(); +} + +BOOST_CLASS_EXPORT_IMPLEMENT(polymorphic_derived1) diff --git a/deal.II/contrib/boost/libs/serialization/test/polymorphic_derived1.hpp b/deal.II/contrib/boost/libs/serialization/test/polymorphic_derived1.hpp new file mode 100644 index 0000000000..f4c83b2efa --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/polymorphic_derived1.hpp @@ -0,0 +1,45 @@ +#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 +#include +#include +#include +#include + +#include "polymorphic_base.hpp" + +class polymorphic_derived1 : public polymorphic_base +{ + friend class boost::serialization::access; + template + 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_EXPORT_KEY(polymorphic_derived1) + +BOOST_CLASS_TYPE_INFO( + polymorphic_derived1, + extended_type_info_no_rtti +) + +#endif // POLYMORPHIC_DERIVED1_HPP diff --git a/deal.II/contrib/boost/libs/serialization/test/polymorphic_derived2.cpp b/deal.II/contrib/boost/libs/serialization/test/polymorphic_derived2.cpp new file mode 100644 index 0000000000..e7c6a15b61 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/polymorphic_derived2.cpp @@ -0,0 +1,65 @@ +/////////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 +#include +#include + +#define POLYMORPHIC_DERIVED2_EXPORT +#include "polymorphic_derived2.hpp" + +template +void polymorphic_derived2::serialize( + Archive &ar, + const unsigned int /* file_version */ +){ + ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(polymorphic_base); +} + +// instantiate code for text archives +#include +#include + +template EXPORT_DECL(void) polymorphic_derived2::serialize( + boost::archive::text_oarchive & ar, + const unsigned int version +); +template EXPORT_DECL(void) polymorphic_derived2::serialize( + boost::archive::text_iarchive & ar, + const unsigned int version +); + +// instantiate code for polymorphic archives +#include +#include + +template EXPORT_DECL(void) polymorphic_derived2::serialize( + boost::archive::polymorphic_oarchive & ar, + const unsigned int version +); +template EXPORT_DECL(void) polymorphic_derived2::serialize( + boost::archive::polymorphic_iarchive & ar, + const unsigned int version +); + +// MWerks users can do this to make their code work +BOOST_SERIALIZATION_MWERKS_BASE_AND_DERIVED(polymorphic_base, polymorphic_derived2) + +// note: export has to be AFTER #includes for all archive classes +BOOST_CLASS_EXPORT_IMPLEMENT(polymorphic_derived2) + +#if 0 +#include +BOOST_SERIALIZATION_FACTORY_0(polymorphic_derived2) + +template +EXPORT_DECL(polymorphic_derived2 *) +boost::serialization::factory(std::va_list ap); +#endif diff --git a/deal.II/contrib/boost/libs/serialization/test/polymorphic_derived2.hpp b/deal.II/contrib/boost/libs/serialization/test/polymorphic_derived2.hpp new file mode 100644 index 0000000000..47982e3935 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/polymorphic_derived2.hpp @@ -0,0 +1,69 @@ +#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_derived2.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 +#include +#include +#include +#include + +#include + +#include "polymorphic_base.hpp" + +#include "test_decl.hpp" + +#if defined(POLYMORPHIC_DERIVED2_IMPORT) + #define DLL_DECL IMPORT_DECL +#elif defined(POLYMORPHIC_DERIVED2_EXPORT) + #define DLL_DECL EXPORT_DECL +#else + #define DLL_DECL(x) +#endif + +class DLL_DECL(BOOST_PP_EMPTY()) polymorphic_derived2 : + public polymorphic_base +{ + friend class boost::serialization::access; + template + void serialize( + Archive &ar, + const unsigned int /* file_version */ + ); + virtual const char * get_key() const { + return "polymorphic_derived2"; + } +}; + +// we use this because we want to assign a key to this type +// but we don't want to explicitly instantiate code every time +// we do so!!!. If we don't do this, we end up with the same +// code in BOTH the DLL which implements polymorphic_derived2 +// as well as the main program. +BOOST_CLASS_EXPORT_KEY(polymorphic_derived2) + +// note the mixing of type_info systems is supported. +BOOST_CLASS_TYPE_INFO( + polymorphic_derived2, + boost::serialization::extended_type_info_typeid +) + +#undef DLL_DECL + +#endif // POLYMORPHIC_DERIVED2_HPP + diff --git a/deal.II/contrib/boost/libs/serialization/test/polymorphic_text_archive.hpp b/deal.II/contrib/boost/libs/serialization/test/polymorphic_text_archive.hpp new file mode 100644 index 0000000000..adf2e00dc5 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/polymorphic_text_archive.hpp @@ -0,0 +1,12 @@ +// (C) Copyright 2002-4 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 +typedef boost::archive::polymorphic_text_oarchive test_oarchive; +typedef std::ofstream test_ostream; +#include +typedef boost::archive::polymorphic_text_iarchive test_iarchive; +typedef std::ifstream test_istream; diff --git a/deal.II/contrib/boost/libs/serialization/test/polymorphic_text_warchive.hpp b/deal.II/contrib/boost/libs/serialization/test/polymorphic_text_warchive.hpp new file mode 100644 index 0000000000..7bca23bf96 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/polymorphic_text_warchive.hpp @@ -0,0 +1,17 @@ +// (C) Copyright 2002-4 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 +#ifdef BOOST_NO_STD_WSTREAMBUF +#error "wide char i/o not supported on this platform" +#else +#include +typedef boost::archive::polymorphic_text_woarchive test_oarchive; +typedef std::wofstream test_ostream; +#include +typedef boost::archive::polymorphic_text_wiarchive test_iarchive; +typedef std::wifstream test_istream; +#endif diff --git a/deal.II/contrib/boost/libs/serialization/test/polymorphic_xml_archive.hpp b/deal.II/contrib/boost/libs/serialization/test/polymorphic_xml_archive.hpp new file mode 100644 index 0000000000..163cb101dc --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/polymorphic_xml_archive.hpp @@ -0,0 +1,12 @@ +// (C) Copyright 2002-4 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 +typedef boost::archive::polymorphic_xml_oarchive test_oarchive; +typedef std::ofstream test_ostream; +#include +typedef boost::archive::polymorphic_xml_iarchive test_iarchive; +typedef std::ifstream test_istream; diff --git a/deal.II/contrib/boost/libs/serialization/test/polymorphic_xml_warchive.hpp b/deal.II/contrib/boost/libs/serialization/test/polymorphic_xml_warchive.hpp new file mode 100644 index 0000000000..581ec16384 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/polymorphic_xml_warchive.hpp @@ -0,0 +1,12 @@ +// (C) Copyright 2002-4 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 +typedef boost::archive::polymorphic_xml_woarchive test_oarchive; +typedef std::wofstream test_ostream; +#include +typedef boost::archive::polymorphic_xml_wiarchive test_iarchive; +typedef std::wifstream test_istream; diff --git a/deal.II/contrib/boost/libs/serialization/test/portable_binary_archive.hpp b/deal.II/contrib/boost/libs/serialization/test/portable_binary_archive.hpp new file mode 100644 index 0000000000..ce91331617 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/portable_binary_archive.hpp @@ -0,0 +1,31 @@ +// (C) Copyright 2002-4 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. +// file includes for testing a custom archive. +// as an example this tests the portable binary archive + +#include + +// #include output archive header +#include "../example/portable_binary_oarchive.hpp" +// define output archive class to be used +typedef portable_binary_oarchive test_oarchive; +// and corresponding stream +typedef std::ofstream test_ostream; + +// repeat the above for correspondng input archive +#include "../example/portable_binary_iarchive.hpp" +typedef portable_binary_iarchive test_iarchive; +typedef std::ifstream test_istream; + +// since this archive class isn't compiled into the +// boost serialization library, include this here +// so that things get instantiated +#include "../example/portable_binary_oarchive.cpp" +#include "../example/portable_binary_iarchive.cpp" + +// and stream open flags +#define TEST_STREAM_FLAGS std::ios::binary diff --git a/deal.II/contrib/boost/libs/serialization/test/test_array.cpp b/deal.II/contrib/boost/libs/serialization/test/test_array.cpp new file mode 100644 index 0000000000..49a58c1bc9 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_array.cpp @@ -0,0 +1,124 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_array.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) + +// should pass compilation and execution + +#include +#include + +#include // remove +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::remove; +} +#endif + +#include "test_tools.hpp" +#include +#include +#include + +#include "A.hpp" +#include "A.ipp" + +struct array_equal_to //: public std::binary_function +{ +template + bool operator()(const T & _Left, const U & _Right) const + { + // consider alignment + int count_left = sizeof(_Left) / ( + static_cast(static_cast(&_Left[1])) + - static_cast(static_cast(&_Left[0])) + ); + int count_right = sizeof(_Right) / ( + static_cast(static_cast(&_Right[1])) + - static_cast(static_cast(&_Right[0])) + ); + if(count_right != count_left) + return false; + while(count_left-- > 0){ + if(_Left[count_left] == _Right[count_left]) + continue; + return false; + } + return true; + } +}; + +template +int test_array(T) +{ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + + // test array of objects + const T a_array[10]={T(),T(),T(),T(),T(),T(),T(),T(),T(),T()}; + const T b_array[2][3]={{T(),T(),T()},{T(),T(),T()}}; + const boost::array c_array = boost::array(); + { + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + oa << boost::serialization::make_nvp("a_array", a_array); + oa << boost::serialization::make_nvp("b_array", b_array); + oa << boost::serialization::make_nvp("c_array", c_array); + } + { + T a_array1[10]; + T b_array1[2][3]; + boost::array c_array1; + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + ia >> boost::serialization::make_nvp("a_array", a_array1); + ia >> boost::serialization::make_nvp("b_array", b_array1); + ia >> boost::serialization::make_nvp("c_array", c_array1); + + array_equal_to/**/ Compare; + BOOST_CHECK(Compare(a_array, a_array1)); + BOOST_CHECK(Compare(b_array[0], b_array1[0])); + BOOST_CHECK(Compare(b_array[1], b_array1[1])); + BOOST_CHECK(Compare(c_array, c_array1)); + } + { + T a_array1[9]; + test_istream is(testfile, TEST_STREAM_FLAGS); + BOOST_TRY { + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + bool exception_invoked = false; + BOOST_TRY { + ia >> boost::serialization::make_nvp("a_array", a_array1); + } + BOOST_CATCH (boost::archive::archive_exception ae){ + BOOST_CHECK( + boost::archive::archive_exception::array_size_too_short + == ae.code + ); + exception_invoked = true; + } + BOOST_CATCH_END + BOOST_CHECK(exception_invoked); + } + BOOST_CATCH (boost::archive::archive_exception ae){} + BOOST_CATCH_END + } + std::remove(testfile); + return EXIT_SUCCESS; +} + + +int test_main( int /* argc */, char* /* argv */[] ) +{ + int res = test_array(A()); + // test an int array for which optimized versions should be available + if (res == EXIT_SUCCESS) + res = test_array(0); + return res; +} + +// EOF diff --git a/deal.II/contrib/boost/libs/serialization/test/test_binary.cpp b/deal.II/contrib/boost/libs/serialization/test/test_binary.cpp new file mode 100644 index 0000000000..a7a4aed037 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_binary.cpp @@ -0,0 +1,157 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_simple_class.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) + +// should pass compilation and execution + +#include // for rand(), NULL, size_t + +#include +#include + +#include // remove +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::rand; + using ::remove; +} +#endif + +#include "test_tools.hpp" + +#include +#include + +class A { + friend class boost::serialization::access; + char data[150]; + // note: from an aesthetic perspective, I would much prefer to have this + // defined out of line. Unfortunately, this trips a bug in the VC 6.0 + // compiler. So hold our nose and put it her to permit running of tests. + template + void serialize(Archive & ar, const unsigned int /* file_version */){ + ar & boost::serialization::make_nvp( + "data", + boost::serialization::make_binary_object(data, sizeof(data)) + ); + } + +public: + A(); + bool operator==(const A & rhs) const; +}; + +A::A(){ + int i = sizeof(data); + while(i-- > 0) + data[i] = static_cast(0xff & std::rand()); +} + +bool A::operator==(const A & rhs) const { + int i = sizeof(data); + while(i-- > 0) + if(data[i] != rhs.data[i]) + return false; + return true; +} + +int test_main( int /* argc */, char* /* argv */[] ) +{ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + + const A a; + char s1[] = "a"; + char s2[] = "ab"; + char s3[] = "abc"; + char s4[] = "abcd"; + const int i = 12345; + A a1; + char s1_1[10]; + char s1_2[10]; + char s1_3[10]; + char s1_4[10]; + int i1 = 34790; + { + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + boost::serialization::make_nvp( + "s1", + boost::serialization::make_binary_object( + s1, + sizeof(s1) + ) + ); + oa << boost::serialization::make_nvp( + "s2", + boost::serialization::make_binary_object( + s2, + sizeof(s2) + ) + ); + oa << boost::serialization::make_nvp( + "s3", + boost::serialization::make_binary_object( + s3, + sizeof(s3) + ) + ); + oa << boost::serialization::make_nvp( + "s4", + boost::serialization::make_binary_object( + s4, + sizeof(s4) + ) + ); + oa << BOOST_SERIALIZATION_NVP(a); + // note: add a little bit on the end of the archive to detect + // failure of text mode binary. + oa << BOOST_SERIALIZATION_NVP(i); + } + { + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + boost::serialization::make_nvp( + "s1", + boost::serialization::make_binary_object( + s1_1, + sizeof(s1) + ) + ); + ia >> boost::serialization::make_nvp( + "s2", + boost::serialization::make_binary_object( + s1_2, + sizeof(s2) + ) + ); + ia >> boost::serialization::make_nvp( + "s3", + boost::serialization::make_binary_object( + s1_3, + sizeof(s3) + ) + ); + ia >> boost::serialization::make_nvp( + "s4", + boost::serialization::make_binary_object( + s1_4, + sizeof(s4) + ) + ); + ia >> BOOST_SERIALIZATION_NVP(a1); + // note: add a little bit on the end of the archive to detect + // failure of text mode binary. + ia >> BOOST_SERIALIZATION_NVP(i1); + } + BOOST_CHECK(i == i1); + BOOST_CHECK(a == a1); + std::remove(testfile); + return EXIT_SUCCESS; +} + +// EOF diff --git a/deal.II/contrib/boost/libs/serialization/test/test_bitset.cpp b/deal.II/contrib/boost/libs/serialization/test/test_bitset.cpp new file mode 100644 index 0000000000..db91829c4a --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_bitset.cpp @@ -0,0 +1,64 @@ +// (C) Copyright 2009 Brian Ravnsgaard and Kenneth Riddile +// Use, modification and distribution are 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 most recent version including documentation. + +// Test that serialization of std::bitset works. +// Should pass compilation and execution +// 16.09.2004, updated 04.03.2009 + +#include // NULL +#include // remove +#include + +#include + +#if defined( BOOST_NO_STDC_NAMESPACE ) +namespace std +{ + using ::remove; +} +#endif + +#include "test_tools.hpp" + +#include +#include + +int test_main( int /* argc */, char* /* argv */[] ) +{ + const char* testfile = boost::archive::tmpnam( NULL ); + BOOST_REQUIRE( NULL != testfile ); + + std::bitset<8> bitsetA; + bitsetA.set( 0, false ); + bitsetA.set( 1, true ); + bitsetA.set( 2, false ); + bitsetA.set( 3, true ); + bitsetA.set( 4, false ); + bitsetA.set( 5, false ); + bitsetA.set( 6, true ); + bitsetA.set( 7, true ); + + { + test_ostream os( testfile, TEST_STREAM_FLAGS ); + test_oarchive oa( os ); + oa << boost::serialization::make_nvp( "bitset", bitsetA ); + } + + std::bitset<8> bitsetB; + { + test_istream is( testfile, TEST_STREAM_FLAGS ); + test_iarchive ia( is ); + ia >> boost::serialization::make_nvp( "bitset", bitsetB ); + } + + BOOST_CHECK( bitsetA == bitsetB ); + + std::remove( testfile ); + return EXIT_SUCCESS; +} + +// EOF diff --git a/deal.II/contrib/boost/libs/serialization/test/test_check.cpp b/deal.II/contrib/boost/libs/serialization/test/test_check.cpp new file mode 100644 index 0000000000..5da30cedc2 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_check.cpp @@ -0,0 +1,142 @@ +// (C) Copyright 2009 Robert Ramey +// Use, modification and distribution are 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 most recent version including documentation. + +// note: this is a compile only test. +#include +#include // BOOST_STATIC_CONST + +#include +#include +#include +#include +#include + +#include +#include + +// track_selectivly with class information in the archive +// is unsafe when used with a pointer and should trigger a warning +struct check1 { + template + void serialize(Archive & ar, const unsigned int version); +}; + +BOOST_CLASS_IMPLEMENTATION(check1, boost::serialization::object_serializable) +BOOST_CLASS_TRACKING(check1, boost::serialization::track_selectively) + +// the combination of versioning + no class information +// should trigger a warning +struct check2 { + template + void serialize(Archive & ar, const unsigned int version); +}; + +BOOST_CLASS_IMPLEMENTATION(check2, boost::serialization::object_serializable) +BOOST_CLASS_VERSION(check2, 1) +// use track always to turn off warning tested above +BOOST_CLASS_TRACKING(check2, boost::serialization::track_always) + +// serializing a type marked as "track_never" through a pointer +// is likely an error +struct check3 { + template + void serialize(Archive & ar, const unsigned int version); +}; + +BOOST_CLASS_TRACKING(check3, boost::serialization::track_never) + +template +int f(){ + BOOST_STATIC_WARNING(T::value); + BOOST_STATIC_ASSERT(T::value); + return 0; +} + +///////////////////////////////////////////////////////////////////////// +// compilation of this program should show a total of 10 warning messages +int main(int /* argc */, char * /* argv */[]){ + std::stringstream s; + { + boost::archive::text_oarchive oa(s); + + check1 const c1_out; + oa << c1_out; + + check1 c1_non_const_out; + oa << c1_non_const_out; // warn check_object_tracking + + check1 * const c1_ptr_out = 0; + oa << c1_ptr_out; // warn check_pointer_level + + check2 const * c2_ptr_out; + oa << c2_ptr_out; // error check_object_versioning + + check3 * const c3_ptr_out = 0; + oa << c3_ptr_out; // warning check_pointer_tracking + + check2 const c2_out; + oa << c2_out; // error check_object_versioning + } + { + boost::archive::text_iarchive ia(s); + + check1 const c1_in; + ia >> c1_in; // check_const_loading + + check1 * c1_ptr_in = 0; + ia >> c1_ptr_in; // warn check_pointer_level + + check2 * c2_ptr_in; + ia >> c2_ptr_in; // error check_object_versioning + + check3 * c3_ptr_in = 0; + ia >> c3_ptr_in; // warning check_pointer_tracking + + check2 c2_in; + ia >> c2_in; // error check_object_versioning + } + { + boost::archive::text_oarchive oa(s); + + check1 const c1_out; + oa << BOOST_SERIALIZATION_NVP(c1_out); + + check1 c1_non_const_out; + oa << BOOST_SERIALIZATION_NVP(c1_non_const_out); // warn check_object_tracking + + check1 * const c1_ptr_out = 0; + oa << BOOST_SERIALIZATION_NVP(c1_ptr_out); // warn check_pointer_level + + check2 const * c2_ptr_out; + oa << BOOST_SERIALIZATION_NVP(c2_ptr_out); // error check_object_versioning + + check3 * const c3_ptr_out = 0; + oa << BOOST_SERIALIZATION_NVP(c3_ptr_out); // warning check_pointer_tracking + + check2 const c2_out; + oa << BOOST_SERIALIZATION_NVP(c2_out); // error check_object_versioning + } + { + boost::archive::text_iarchive ia(s); + + check1 const c1_in; + ia >> BOOST_SERIALIZATION_NVP(c1_in); // check_const_loading + + check1 * c1_ptr_in = 0; + ia >> BOOST_SERIALIZATION_NVP(c1_ptr_in); // warn check_pointer_level + + check2 * c2_ptr_in; + ia >> BOOST_SERIALIZATION_NVP(c2_ptr_in); // error check_object_versioning + + check3 * c3_ptr_in = 0; + ia >> BOOST_SERIALIZATION_NVP(c3_ptr_in); // warning check_pointer_tracking + + check2 c2_in; + ia >> BOOST_SERIALIZATION_NVP(c2_in); // error check_object_versioning + } + return 0; +} diff --git a/deal.II/contrib/boost/libs/serialization/test/test_class_info_load.cpp b/deal.II/contrib/boost/libs/serialization/test/test_class_info_load.cpp new file mode 100644 index 0000000000..af15329447 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_class_info_load.cpp @@ -0,0 +1,92 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_class_info_load.cpp: test implementation level trait + +// (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) + +// test implementation level "object_class_info" +// should pass compilation and execution + +#include +#include + +#include +#include +#include "test_tools.hpp" + +#include +#include +#include +#include +#include + +class A +{ + friend class boost::serialization::access; + template + void serialize(Archive & /*ar*/, const unsigned int file_version){ + // class that don't save class info always have a version number of 0 + BOOST_CHECK(file_version == 0); + BOOST_STATIC_ASSERT(0 == ::boost::serialization::version::value); + ++count; + } +public: + unsigned int count; + A() : count(0) {} +}; + +BOOST_CLASS_IMPLEMENTATION(A, ::boost::serialization::object_serializable) +BOOST_CLASS_TRACKING(A, ::boost::serialization::track_never) + +// second case : serialize WITH class information +class B +{ + friend class boost::serialization::access; + template + void serialize(Archive & /*ar*/, const unsigned int file_version){ + // verify at execution that the version number corresponds to the saved + // one + BOOST_CHECK(file_version == 2); + ++count; + } +public: + unsigned int count; + B() : count(0) {} +}; + +BOOST_CLASS_IMPLEMENTATION(B, ::boost::serialization::object_class_info) +BOOST_CLASS_TRACKING(B, ::boost::serialization::track_never) +BOOST_CLASS_VERSION(B, 4) + +void in(const char *testfile, A & a, B & b) +{ + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + ia >> BOOST_SERIALIZATION_NVP(a); + ia >> BOOST_SERIALIZATION_NVP(a); + BOOST_CHECK(a.count == 2); // no tracking => redundant loads + ia >> BOOST_SERIALIZATION_NVP(b); + ia >> BOOST_SERIALIZATION_NVP(b); + // note: archive was saved with tracking so that is what determines + // whether tracking is perform on load - regardless of the latest + // tracking setting. + BOOST_CHECK(b.count == 1); +} + +int +test_main( int /* argc */, char* /* argv */[] ) +{ + A a; + B b; + std::string filename; + filename += boost::archive::tmpdir(); + filename += '/'; + filename += BOOST_PP_STRINGIZE(testfile_); + filename += BOOST_PP_STRINGIZE(BOOST_ARCHIVE_TEST); + in(filename.c_str(), a, b); + return EXIT_SUCCESS; +} + +// EOF diff --git a/deal.II/contrib/boost/libs/serialization/test/test_class_info_save.cpp b/deal.II/contrib/boost/libs/serialization/test/test_class_info_save.cpp new file mode 100644 index 0000000000..dabd8faa4c --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_class_info_save.cpp @@ -0,0 +1,97 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_class_info_save.cpp: test implementation level trait + +// (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) + +// test implementation level "object_class_info" +// should pass compilation and execution + +#include +#include + +#include +#include +#include +#include "test_tools.hpp" + +#include +#include +#include +#include + +// first case : serialize WITHOUT class information +class A +{ + friend class boost::serialization::access; + template + void serialize(Archive & /*ar*/, const unsigned int file_version){ + // class that don't save class info always have a version number of 0 + BOOST_CHECK(file_version == 0); + BOOST_STATIC_ASSERT(0 == ::boost::serialization::version::value); + ++count; + } +public: + unsigned int count; + A() : count(0) {} +}; + +BOOST_CLASS_IMPLEMENTATION(A, ::boost::serialization::object_serializable) +BOOST_CLASS_TRACKING(A, ::boost::serialization::track_never) + +// second case : serialize WITH class information +// note: GCC compile fails if this is after the class declaration +class B; +BOOST_CLASS_VERSION(B, 2) + +class B +{ + friend class boost::serialization::access; + template + void serialize(Archive & /*ar*/, const unsigned int file_version){ + // verify at execution that correct version number is passed on save + BOOST_CHECK(file_version == ::boost::serialization::version::value); + ++count; + } +public: + unsigned int count; + B() : count(0) {} +}; + +BOOST_CLASS_IMPLEMENTATION(B, ::boost::serialization::object_class_info) +BOOST_CLASS_TRACKING(B, boost::serialization::track_always) + +#include + +void out(const char *testfile, const A & a, const B & b) +{ + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + // write object twice to check tracking + oa << BOOST_SERIALIZATION_NVP(a); + oa << BOOST_SERIALIZATION_NVP(a); + BOOST_CHECK(a.count == 2); // no tracking => redundant saves + std::cout << "a.count=" << a.count << '\n' ; + oa << BOOST_SERIALIZATION_NVP(b); + oa << BOOST_SERIALIZATION_NVP(b); + BOOST_CHECK(b.count == 1); // tracking => no redundant saves + std::cout << "b.count=" << b.count << '\n' ; +} + +int +test_main( int /* argc */, char* /* argv */[] ) +{ + A a; + B b; + std::string filename; + filename += boost::archive::tmpdir(); + filename += '/'; + filename += BOOST_PP_STRINGIZE(testfile_); + filename += BOOST_PP_STRINGIZE(BOOST_ARCHIVE_TEST); + out(filename.c_str(), a, b); + return EXIT_SUCCESS; +} + +// EOF diff --git a/deal.II/contrib/boost/libs/serialization/test/test_codecvt_null.cpp b/deal.II/contrib/boost/libs/serialization/test/test_codecvt_null.cpp new file mode 100644 index 0000000000..d8ecdf8a01 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_codecvt_null.cpp @@ -0,0 +1,136 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_codecvt_null.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) + +// should pass compilation and execution. Note: compilation with compilers +// which use wchar_t as 2 byte objects will emit warnings. These should be +// ignored. + +#include +#include +#include +#include +#include +#include +#include // remove +#include // NULL, size_t + +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::remove; +} +#endif + +#include "test_tools.hpp" + +#include +#include +#include +#include + +template +struct test_data +{ + static wchar_t wchar_encoding[]; +}; + +template<> +wchar_t test_data<2>::wchar_encoding[] = { + 0x0001, + 0x007f, + 0x0080, + 0x07ff, + 0x0800, + 0x7fff +}; + +template<> +wchar_t test_data<4>::wchar_encoding[] = { + 0x00000001, + 0x0000007f, + 0x00000080, + 0x000007ff, + 0x00000800, + 0x0000ffff, + 0x00010000, + 0x0010ffff, + 0x001fffff, + 0x00200000, + 0x03ffffff, + 0x04000000, + 0x7fffffff +}; + +#include + +int test_main( int /* argc */, char* /* argv */[] ) { + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + + std::locale old_loc; + std::locale * null_locale = + boost::archive::add_facet(old_loc, new boost::archive::codecvt_null); + + typedef test_data td; + { + std::wofstream ofs; + ofs.imbue(*null_locale); + ofs.open(testfile, std::ios::binary); + std::copy( + td::wchar_encoding, + #if ! defined(__BORLANDC__) + // borland 5.60 complains about this + td::wchar_encoding + sizeof(td::wchar_encoding)/sizeof(wchar_t), + #else + // so use this instead + td::wchar_encoding + 6, + #endif + boost::archive::iterators::ostream_iterator(ofs) + ); + } + bool ok = false; + { + std::wifstream ifs; + ifs.imbue(*null_locale); + ifs.open(testfile, std::ios::binary); + ok = std::equal( + td::wchar_encoding, + #if ! defined(__BORLANDC__) + // borland 5.60 complains about this + td::wchar_encoding + sizeof(td::wchar_encoding)/sizeof(wchar_t), + #else + // so use this instead + td::wchar_encoding + 6, + #endif + boost::archive::iterators::istream_iterator(ifs) + ); + } + + BOOST_CHECK(ok); + { + std::wofstream ofs("testfile2"); + ofs.imbue(*null_locale); + int i = 10; + ofs << i; + ofs.close(); + + std::wifstream ifs("testfile2"); + ifs.imbue(*null_locale); + int i2; + ifs >> i2; + std::cout << "i=" << i << std::endl; + std::cout << "i2=" << i2 << std::endl; + BOOST_CHECK(i == i2); + ifs.close(); + } + + delete null_locale; + std::remove(testfile); + return EXIT_SUCCESS; +} + diff --git a/deal.II/contrib/boost/libs/serialization/test/test_complex.cpp b/deal.II/contrib/boost/libs/serialization/test/test_complex.cpp new file mode 100644 index 0000000000..7182db1e0b --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_complex.cpp @@ -0,0 +1,70 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_complex.cpp + +// (C) Copyright 2005 Matthias Troyer . +// 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) + +// should pass compilation and execution + +#include + +#include // NULL +#include // rand +#include +#include + +#include // remove +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::remove; +#ifndef UNDER_CE + using ::numeric_limits; +#endif +} +#endif + +#include "test_tools.hpp" +#include +#include BOOST_PP_STRINGIZE(BOOST_ARCHIVE_TEST) + +#include + +int test_main( int /* argc */, char* /* argv */[] ) +{ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + + // test array of objects + std::complex a( + static_cast(std::rand()), + static_cast(std::rand()) + ); + std::complex b( + static_cast(std::rand()), + static_cast(std::rand()) + ); + { + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os); + oa << boost::serialization::make_nvp("afloatcomplex", a); + oa << boost::serialization::make_nvp("adoublecomplex", b); + } + std::complex a1; + std::complex b1; + { + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is); + ia >> boost::serialization::make_nvp("afloatcomplex", a1); + ia >> boost::serialization::make_nvp("adoublecomplex", b1); + } + + BOOST_CHECK(std::abs(a-a1) <= 2.*std::numeric_limits::round_error()); + BOOST_CHECK(std::abs(b-b1) <= 2.*std::numeric_limits::round_error()); + + std::remove(testfile); + return EXIT_SUCCESS; +} + +// EOF diff --git a/deal.II/contrib/boost/libs/serialization/test/test_const_load_fail1.cpp b/deal.II/contrib/boost/libs/serialization/test/test_const_load_fail1.cpp new file mode 100644 index 0000000000..3c5c0304e5 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_const_load_fail1.cpp @@ -0,0 +1,23 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_const.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) + +// compile only + +#include + +using namespace boost::archive; + +struct A { + template + void serialize(Archive & ar, unsigned int version) { + } +}; + +void f1(text_iarchive & ia, const A & a){ + ia >> a; +} diff --git a/deal.II/contrib/boost/libs/serialization/test/test_const_load_fail1_nvp.cpp b/deal.II/contrib/boost/libs/serialization/test/test_const_load_fail1_nvp.cpp new file mode 100644 index 0000000000..f9ba9b3d6a --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_const_load_fail1_nvp.cpp @@ -0,0 +1,24 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_const.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) + +// compile only + +#include +#include + +using namespace boost::archive; + +struct A { + template + void serialize(Archive & ar, unsigned int version) { + } +}; + +void f1(text_iarchive & ia, const A & a){ + ia >> BOOST_SERIALIZATION_NVP(a); +} diff --git a/deal.II/contrib/boost/libs/serialization/test/test_const_load_fail2.cpp b/deal.II/contrib/boost/libs/serialization/test/test_const_load_fail2.cpp new file mode 100644 index 0000000000..7d9b976a7c --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_const_load_fail2.cpp @@ -0,0 +1,23 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_const.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) + +// compile only + +#include + +using namespace boost::archive; + +struct A { + template + void serialize(Archive & ar, unsigned int version) { + } +}; + +void f2(text_iarchive & ia, A * const & a){ + ia >> a; +} diff --git a/deal.II/contrib/boost/libs/serialization/test/test_const_load_fail2_nvp.cpp b/deal.II/contrib/boost/libs/serialization/test/test_const_load_fail2_nvp.cpp new file mode 100644 index 0000000000..600461c084 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_const_load_fail2_nvp.cpp @@ -0,0 +1,25 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_const.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) + +// compile only + +#include +#include + +using namespace boost::archive; + +struct A { + template + void serialize(Archive & ar, unsigned int version) { + } +}; + +void f2(text_iarchive & ia, A * const & a){ + ia >> BOOST_SERIALIZATION_NVP(a); +} + diff --git a/deal.II/contrib/boost/libs/serialization/test/test_const_load_fail3.cpp b/deal.II/contrib/boost/libs/serialization/test/test_const_load_fail3.cpp new file mode 100644 index 0000000000..4f385eb031 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_const_load_fail3.cpp @@ -0,0 +1,22 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_const.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) + +// compile only + +#include +using namespace boost::archive; + +struct A { + template + void serialize(Archive & ar, unsigned int version) { + } +}; + +void f2(text_iarchive & ia, const A * const & a){ + ia >> a; +} diff --git a/deal.II/contrib/boost/libs/serialization/test/test_const_load_fail3_nvp.cpp b/deal.II/contrib/boost/libs/serialization/test/test_const_load_fail3_nvp.cpp new file mode 100644 index 0000000000..e8ef913d87 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_const_load_fail3_nvp.cpp @@ -0,0 +1,24 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_const.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) + +// compile only + +#include +#include + +using namespace boost::archive; + +struct A { + template + void serialize(Archive & ar, unsigned int version) { + } +}; + +void f2(text_iarchive & ia, const A * const & a){ + ia >> BOOST_SERIALIZATION_NVP(a); +} diff --git a/deal.II/contrib/boost/libs/serialization/test/test_const_pass.cpp b/deal.II/contrib/boost/libs/serialization/test/test_const_pass.cpp new file mode 100644 index 0000000000..211ffdd47b --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_const_pass.cpp @@ -0,0 +1,54 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_const.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) + +// compile only + +#include +#include +#include + +struct A { + template + void serialize(Archive & ar, unsigned int version) { + } +}; + +// should compile w/o problem +void f1(boost::archive::text_oarchive & oa, const A & a){ + oa & a; + oa & BOOST_SERIALIZATION_NVP(a); + oa << a; + oa << BOOST_SERIALIZATION_NVP(a); +} +void f2(boost::archive::text_oarchive & oa, const A * const & a){ + oa & a; + oa & BOOST_SERIALIZATION_NVP(a); + oa << a; + oa << BOOST_SERIALIZATION_NVP(a); +} +void f3(boost::archive::text_iarchive & ia, A & a){ + ia & a; + ia & BOOST_SERIALIZATION_NVP(a); + ia >> a; + ia >> BOOST_SERIALIZATION_NVP(a); +} +void f4(boost::archive::text_iarchive & ia, A * & a){ + ia & a; + ia & BOOST_SERIALIZATION_NVP(a); + ia >> a; + ia >> BOOST_SERIALIZATION_NVP(a); +} +#if 0 +void f5(boost::archive::text_oarchive & oa, const A * & a){ + oa & a; + oa & BOOST_SERIALIZATION_NVP(a); + oa << a; + oa << BOOST_SERIALIZATION_NVP(a); +} +#endif + diff --git a/deal.II/contrib/boost/libs/serialization/test/test_const_save_warn1.cpp b/deal.II/contrib/boost/libs/serialization/test/test_const_save_warn1.cpp new file mode 100644 index 0000000000..185f00734d --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_const_save_warn1.cpp @@ -0,0 +1,25 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_const.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) + +// compile only + +#include + +using namespace boost::archive; + +struct A { + template + void serialize(Archive & ar, unsigned int version) { + } +}; + +// should fail to compile +void f1(text_oarchive & oa, A & a){ + oa << a; +} + diff --git a/deal.II/contrib/boost/libs/serialization/test/test_const_save_warn1_nvp.cpp b/deal.II/contrib/boost/libs/serialization/test/test_const_save_warn1_nvp.cpp new file mode 100644 index 0000000000..19e7c277d7 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_const_save_warn1_nvp.cpp @@ -0,0 +1,26 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_const.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) + +// compile only + +#include +#include +#include + +using namespace boost::archive; + +struct A { + template + void serialize(Archive & ar, unsigned int version) { + } +}; + +void f1(text_oarchive & oa, A & a){ + oa << BOOST_SERIALIZATION_NVP(a); +} + diff --git a/deal.II/contrib/boost/libs/serialization/test/test_const_save_warn2.cpp b/deal.II/contrib/boost/libs/serialization/test/test_const_save_warn2.cpp new file mode 100644 index 0000000000..0a77b7207f --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_const_save_warn2.cpp @@ -0,0 +1,24 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_const.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) + +// compile only + +#include + +using namespace boost::archive; + +struct A { + template + void serialize(Archive & ar, unsigned int version) { + } +}; + +void f2(text_oarchive & oa, A * & a){ + oa << a; +} + diff --git a/deal.II/contrib/boost/libs/serialization/test/test_const_save_warn2_nvp.cpp b/deal.II/contrib/boost/libs/serialization/test/test_const_save_warn2_nvp.cpp new file mode 100644 index 0000000000..7b887c5d1e --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_const_save_warn2_nvp.cpp @@ -0,0 +1,25 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_const.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) + +// compile only + +#include +#include + +using namespace boost::archive; + +struct A { + template + void serialize(Archive & ar, unsigned int version) { + } +}; + +void f2(text_oarchive & oa, A * & a){ + oa << BOOST_SERIALIZATION_NVP(a); +} + diff --git a/deal.II/contrib/boost/libs/serialization/test/test_const_save_warn3.cpp b/deal.II/contrib/boost/libs/serialization/test/test_const_save_warn3.cpp new file mode 100644 index 0000000000..19c149675c --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_const_save_warn3.cpp @@ -0,0 +1,24 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_const.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) + +// compile only + +#include + +using namespace boost::archive; + +struct A { + template + void serialize(Archive & ar, unsigned int version) { + } +}; + +void f3(text_oarchive & oa, const A * & a){ + oa << a; +} + diff --git a/deal.II/contrib/boost/libs/serialization/test/test_const_save_warn3_nvp.cpp b/deal.II/contrib/boost/libs/serialization/test/test_const_save_warn3_nvp.cpp new file mode 100644 index 0000000000..7571b3c696 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_const_save_warn3_nvp.cpp @@ -0,0 +1,25 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_const.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) + +// compile only + +#include +#include + +using namespace boost::archive; + +struct A { + template + void serialize(Archive & ar, unsigned int version) { + } +}; + +void f3(text_oarchive & oa, const A * & a){ + oa << BOOST_SERIALIZATION_NVP(a); +} + diff --git a/deal.II/contrib/boost/libs/serialization/test/test_const_save_warn4.cpp b/deal.II/contrib/boost/libs/serialization/test/test_const_save_warn4.cpp new file mode 100644 index 0000000000..c9599aaac6 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_const_save_warn4.cpp @@ -0,0 +1,37 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_const.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) + +// compile only + +#include +#include + +using namespace boost::archive; + +struct A { + template + void serialize(Archive & ar, unsigned int version) { + } +}; + +// comment out this test case as a reminder not to keep inserting it !!! +// we don't trap this as an error in order to permit things like +// X * xptr; +// save(..){ +// ar << xptr; +// } +// +// for rational - consider the following example from demo.cpp +// std::list > schedule +// its not obvious to me how this can be cast to: +// std::list > schedule + +void f4(text_oarchive & oa, A * const & a){ + oa << a; +} + diff --git a/deal.II/contrib/boost/libs/serialization/test/test_const_save_warn4_nvp.cpp b/deal.II/contrib/boost/libs/serialization/test/test_const_save_warn4_nvp.cpp new file mode 100644 index 0000000000..9c61db61f2 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_const_save_warn4_nvp.cpp @@ -0,0 +1,39 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_const.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) + +// compile only + +#include +#include + +using namespace boost::archive; + +struct A { + template + void serialize(Archive & ar, unsigned int version) { + } +}; + +// comment out this test case as a reminder not to keep inserting it !!! +// we don't trap this as an error in order to permit things like +// X * xptr; +// save(..){ +// ar << xptr; +// } +// +// for rational - consider the following example from demo.cpp +// +// std::list > schedule +// +// its not obvious to me how this can be cast to: +// +// std::list > schedule + +void f4(text_oarchive & oa, A * const & a){ + oa << BOOST_SERIALIZATION_NVP(a); +} diff --git a/deal.II/contrib/boost/libs/serialization/test/test_contained_class.cpp b/deal.II/contrib/boost/libs/serialization/test/test_contained_class.cpp new file mode 100644 index 0000000000..5dc15e2f4e --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_contained_class.cpp @@ -0,0 +1,69 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_contained_class.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) + +// should pass compilation and execution + +#include +#include + +#include // remove +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::remove; +} +#endif + +#include "test_tools.hpp" +#include + +#include "B.hpp" +#include "A.ipp" + +/////////////////////////////////////////////////////// +// Contained class +class C +{ +private: + friend class boost::serialization::access; + template + void serialize(Archive & ar, const unsigned int /* file_version */){ + ar & BOOST_SERIALIZATION_NVP(b); + } + B b; +public: + bool operator==(const C &rhs) const + { + return b == rhs.b; + } + C(){} +}; + +int test_main( int /* argc */, char* /* argv */[] ) +{ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + + const C c; + C c1; + { + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + oa << boost::serialization::make_nvp("c", c); + } + { + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + ia >> boost::serialization::make_nvp("c", c1); + } + BOOST_CHECK(c == c1); + std::remove(testfile); + return EXIT_SUCCESS; +} + +// EOF diff --git a/deal.II/contrib/boost/libs/serialization/test/test_cyclic_ptrs.cpp b/deal.II/contrib/boost/libs/serialization/test/test_cyclic_ptrs.cpp new file mode 100644 index 0000000000..cecd0d1eb3 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_cyclic_ptrs.cpp @@ -0,0 +1,153 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_cyclic_ptrs.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) + +// should pass compilation and execution + +#include // NULL +#include + +#include // remove +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::remove; +} +#endif + + +#include "test_tools.hpp" +#include + +#include +#include +#include + +#include "A.hpp" +#include "A.ipp" + +/////////////////////////////////////////////////////// +// class with a member which refers to itself +class J : public A +{ +private: + friend class boost::serialization::access; + template + void serialize(Archive &ar, const unsigned int /* file_version */){ + ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(A); + ar & BOOST_SERIALIZATION_NVP(j); + } +public: + bool operator==(const J &rhs) const; + J *j; + J(J *_j) : j(_j) {} + J() : j(NULL){} +}; + +BOOST_CLASS_VERSION(J, 6) + +bool J::operator==(const J &rhs) const +{ + return static_cast(*this) == static_cast(rhs); +} + +/////////////////////////////////////////////////////// +// class with members that refer to each other +// this is an example of a class that, as written, cannot +// be serialized with this system. The problem is that the +// serialization of the first member - j1 , provokes serialization +// of those objects which it points to either directly or indirectly. +// When those objects are subsequently serialized, it is discovered +// that have already been serialized through pointers. This is +// detected by the system and an exception - pointer_conflict - +// is thrown. Permiting this to go undetected would result in the +// creation of multiple equal objects rather than the original +// structure. +class K +{ + J j1; + J j2; + J j3; + friend class boost::serialization::access; + template + void serialize( + Archive &ar, + const unsigned int /* file_version */ + ){ + ar & BOOST_SERIALIZATION_NVP(j1); + ar & BOOST_SERIALIZATION_NVP(j2); + ar & BOOST_SERIALIZATION_NVP(j3); + } +public: + bool operator==(const K &rhs) const; + K(); +}; + +K::K() +: j1(&j2), j2(&j3), j3(&j1) +{ +} + +bool K::operator==(const K &rhs) const +{ + return + j1.j == & j2 + && j2.j == & j3 + && j3.j == & j1 + && j1 == rhs.j1 + && j2 == rhs.j2 + && j3 == rhs.j3 + ; +} + +int test_main( int /* argc */, char* /* argv */[] ) +{ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + + K k; + boost::archive::archive_exception exception( + boost::archive::archive_exception::no_exception + ); + { + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + BOOST_TRY { + oa << BOOST_SERIALIZATION_NVP(k); + } + BOOST_CATCH (boost::archive::archive_exception ae){ + exception = ae; + } + BOOST_CATCH_END + BOOST_CHECK( + exception.code == boost::archive::archive_exception::pointer_conflict + ); + } + // if exception wasn't invoked + if(exception.code == boost::archive::archive_exception::no_exception){ + // try to read the archive + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + exception = boost::archive::archive_exception( + boost::archive::archive_exception::no_exception + ); + BOOST_TRY { + ia >> BOOST_SERIALIZATION_NVP(k); + } + BOOST_CATCH (boost::archive::archive_exception ae){ + exception = ae; + } + BOOST_CATCH_END + BOOST_CHECK( + exception.code == boost::archive::archive_exception::pointer_conflict + ); + } + std::remove(testfile); + return EXIT_SUCCESS; +} + +// EOF diff --git a/deal.II/contrib/boost/libs/serialization/test/test_decl.hpp b/deal.II/contrib/boost/libs/serialization/test/test_decl.hpp new file mode 100644 index 0000000000..9c5b274de6 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_decl.hpp @@ -0,0 +1,74 @@ +#ifndef BOOST_TEST_DECL_HPP +#define BOOST_TEST_DECL_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 +// test_decl.hpp +// +// (c) Copyright Robert Ramey 2004 +// 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 library home page at http://www.boost.org/libs/serialization +// export if this is our own source, otherwise import: + +// usage: +// +// class header declarations should look something like: +// +// #include "test_decl.hpp" +// #if defined(A_CPP) +// #define DLL_DECL IMPORT_DECL(BOOST_PP_EMPTY()) +// #else +// #define DLL_DECL EXPORT_DECL(BOOST_PP_EMPTY()) +// #endif +// +// class DLL_DECL A { +// ... +// }; +// +// #undef DLL_DECL +// +// code which includes such headers should look something like: +// +// #include "A.hpp" +// +// code which builds dll should like like +// +// #define A_CPP +// #include "A.hpp" +// +// A::A(){ +// ... +// } +// ... +// + +#include + +#ifdef BOOST_HAS_DECLSPEC // defined in config system + #if ! defined(EXPORT_DECL) + #if defined(__BORLANDC__) + #define EXPORT_DECL(T) T __export + #else + #define EXPORT_DECL(T) __declspec(dllexport) T + #endif + #endif + #if ! defined(IMPORT_DECL) + #if defined(__BORLANDC__) + #define IMPORT_DECL(T) T __import + #else + #define IMPORT_DECL(T) __declspec(dllimport) T + #endif + #endif +#else + #define IMPORT_DECL(T) T + #define EXPORT_DECL(T) T +#endif // BOOST_HAS_DECLSPEC + +#endif // BOOST_TEST_DECL_HPP diff --git a/deal.II/contrib/boost/libs/serialization/test/test_delete_pointer.cpp b/deal.II/contrib/boost/libs/serialization/test/test_delete_pointer.cpp new file mode 100644 index 0000000000..aaff38213f --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_delete_pointer.cpp @@ -0,0 +1,129 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_delete_pointer.cpp + +// (C) Copyright 2002 Vahan Margaryan. +// 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) +// + +#include // NULL +#include + +#include // remove +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::remove; +} +#endif + +#include "test_tools.hpp" +#include +#include + +#include +#include +#include + +//A holds a pointer to another A, but doesn't own the pointer. +//objCount +class A +{ + friend class boost::serialization::access; + template + void save(Archive &ar, const unsigned int /* file_version */) const + { + ar << BOOST_SERIALIZATION_NVP(next_); + } + template + void load(Archive & ar, const unsigned int /* file_version */) + { + static int i = 0; + ar >> BOOST_SERIALIZATION_NVP(next_); + if(++i == 3) + boost::serialization::throw_exception(boost::archive::archive_exception( + boost::archive::archive_exception::no_exception + )); + } + BOOST_SERIALIZATION_SPLIT_MEMBER() +public: + A() + { + next_ = 0; + ++objcount; + } + A(const A& a) + { + next_ = a.next_; ++objcount; + } + ~A() + { + --objcount; + } + A* next_; + static int objcount; +}; + + +int A::objcount = 0; + +int +test_main( int /* argc */, char* /* argv */[] ) +{ + std::vector vec; + A* a = new A; + a->next_ = 0; + vec.push_back(a); + + //fill the vector with chained A's. The vector is assumed + //to own the objects - we will destroy the objects through this vector. + unsigned int i; + for(i = 1; i < 10; ++i) + { + a = new A; + vec[i - 1]->next_ = a; + a->next_ = 0; + vec.push_back(a); + } + + const char * testfile = boost::archive::tmpnam(0); + BOOST_REQUIRE(NULL != testfile); + + //output the vector + { + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + oa << BOOST_SERIALIZATION_NVP(vec); + } + + //erase the objects + for(i = 0; i < vec.size(); ++i) + delete vec[i]; + vec.clear(); + + //read the vector back + { + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + BOOST_TRY { + ia >> BOOST_SERIALIZATION_NVP(vec); + } + BOOST_CATCH (...){ + ia.delete_created_pointers(); + vec.clear(); + } + BOOST_CATCH_END + } + + //delete the objects + for(i = 0; i < vec.size(); ++i) + delete vec[i]; + vec.clear(); + + //identify the leaks + BOOST_CHECK(A::objcount == 0); + std::remove(testfile); + return EXIT_SUCCESS; +} + diff --git a/deal.II/contrib/boost/libs/serialization/test/test_deque.cpp b/deal.II/contrib/boost/libs/serialization/test/test_deque.cpp new file mode 100644 index 0000000000..ba8bc54c7b --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_deque.cpp @@ -0,0 +1,53 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_deque.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) + +// should pass compilation and execution + +#include +#include + +#include // remove +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::remove; +} +#endif + +#include +#include "test_tools.hpp" + +#include + +#include "A.hpp" +#include "A.ipp" + +int test_main( int /* argc */, char* /* argv */[] ) +{ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + + // test array of objects + std::deque adeque, adeque1; + { + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + oa << boost::serialization::make_nvp("adeque",adeque); + } + { + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + ia >> boost::serialization::make_nvp("adeque",adeque1); + } + BOOST_CHECK(adeque == adeque1); + + std::remove(testfile); + return EXIT_SUCCESS; +} + +// EOF diff --git a/deal.II/contrib/boost/libs/serialization/test/test_derived.cpp b/deal.II/contrib/boost/libs/serialization/test/test_derived.cpp new file mode 100644 index 0000000000..6a9aee874a --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_derived.cpp @@ -0,0 +1,148 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_derived.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) + +// should pass compilation and execution + +#include // NULL +#include + +#include // remove +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::remove; +} +#endif + +#include +#include "test_tools.hpp" + +#include +#include + +class base +{ + friend class boost::serialization::access; + template + void serialize(Archive & /* ar */, const unsigned int /* file_version */){ + } +protected: + virtual ~base(){}; +}; + +class derived1 : public base +{ + friend class boost::serialization::access; + template + void serialize(Archive &ar, const unsigned int /* file_version */){ + ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(base); + } +}; + +class derived2 : public base +{ + friend class boost::serialization::access; + template + void serialize(Archive &ar, const unsigned int /* file_version */){ + ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(base); + } +}; + +// save non-polymorphic classes through a base class pointer +void save_derived(const char *testfile) +{ + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + + // registration not necessary when serializing the most derived pointer + derived1 *d1 = new derived1; + derived2 *d2 = new derived2; + oa << BOOST_SERIALIZATION_NVP(d1) << BOOST_SERIALIZATION_NVP(d2); + + // upcasting non-polymorphic pointers may not lead to the expected + // result. In the current type id system + base *b1 = d1; + base *b2 = d2; + + // Warning, the current type id system does not yield true + // type id for non-polymorphic types + const boost::serialization::extended_type_info & this_type + = boost::serialization::type_info_implementation::type + ::get_const_instance(); + // retrieve the true type of the object pointed to + const boost::serialization::extended_type_info & true_type + = * boost::serialization::type_info_implementation::type + ::get_const_instance().get_derived_extended_type_info(*b1); + + BOOST_WARN_MESSAGE( + !(this_type == true_type), + "current type id system does not support non-polymorphic types" + ); + + oa << BOOST_SERIALIZATION_NVP(b1); + oa << BOOST_SERIALIZATION_NVP(b2); + + delete d1; + delete d2; +} + +// save non-polymorphic classes through a base class pointer +void load_derived(const char *testfile) +{ + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + + // registration not necessary when serializing the most derived pointer + derived1 *d1 = NULL; + derived2 *d2 = NULL; + ia >> BOOST_SERIALIZATION_NVP(d1) >> BOOST_SERIALIZATION_NVP(d2); + + // upcasting non-polymorphic pointers may not lead to the expected + // result. In the current type id system + base *b1 = NULL; + base *b2 = NULL; + + // note: this will produce incorrect results for non-polymorphic classes + ia >> BOOST_SERIALIZATION_NVP(b1); + ia >> BOOST_SERIALIZATION_NVP(b2); + + // Warning, the current type id system does not yield true + // type id for non-polymorphic types + const boost::serialization::extended_type_info & this_type + = boost::serialization::type_info_implementation::type + ::get_const_instance(); + // retrieve the true type of the object pointed to + const boost::serialization::extended_type_info & true_type + = * boost::serialization::type_info_implementation::type + ::get_const_instance().get_derived_extended_type_info(*b1); + + BOOST_WARN_MESSAGE( + ! (this_type == true_type), + "current type id system does fails for non-polymorphic types" + ); + + BOOST_CHECK(b1 == static_cast(d1)); + BOOST_CHECK(b2 == static_cast(d2)); + + delete d1; + delete d2; +} + +int +test_main( int /* argc */, char* /* argv */[] ) +{ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + + save_derived(testfile); + load_derived(testfile); + std::remove(testfile); + return EXIT_SUCCESS; +} + +// EOF diff --git a/deal.II/contrib/boost/libs/serialization/test/test_derived_class.cpp b/deal.II/contrib/boost/libs/serialization/test/test_derived_class.cpp new file mode 100644 index 0000000000..f123c92ce6 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_derived_class.cpp @@ -0,0 +1,49 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_derived_class.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) + +// should pass compilation and execution + +#include + +#include // remove +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::remove; +} +#endif + +#include "test_tools.hpp" + +#include "B.hpp" +#include "A.ipp" + +int test_main( int /*argc*/, char* /*argv*/[] ) +{ + const char * testfile = boost::archive::tmpnam(NULL); + + BOOST_REQUIRE(NULL != testfile); + + B b, b1; + + { + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + oa << boost::serialization::make_nvp("b", b); + } + { + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + ia >> boost::serialization::make_nvp("b1", b1); + } + BOOST_CHECK(b == b1); + std::remove(testfile); + return EXIT_SUCCESS; +} + +// EOF diff --git a/deal.II/contrib/boost/libs/serialization/test/test_derived_class_ptr.cpp b/deal.II/contrib/boost/libs/serialization/test/test_derived_class_ptr.cpp new file mode 100644 index 0000000000..07cf4385d9 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_derived_class_ptr.cpp @@ -0,0 +1,51 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_deriviec_class_.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) + +// should pass compilation and execution + +#include // NULL +#include + +#include // remove +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::remove; +} +#endif + +#include "test_tools.hpp" + +#include "B.hpp" +#include "A.ipp" + +int test_main( int /* argc */, char* /* argv */[] ) +{ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + + B * tb = new B; + B * tb1 = NULL; + + { + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + oa << boost::serialization::make_nvp("tb", tb); + } + { + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + ia >> boost::serialization::make_nvp("tb",tb1); + } + BOOST_CHECK(tb != tb1); + BOOST_CHECK(*tb == *tb1); + std::remove(testfile); + return EXIT_SUCCESS; +} + +// EOF diff --git a/deal.II/contrib/boost/libs/serialization/test/test_diamond.cpp b/deal.II/contrib/boost/libs/serialization/test/test_diamond.cpp new file mode 100644 index 0000000000..15a4ae7b77 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_diamond.cpp @@ -0,0 +1,204 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_diamond.cpp + +// (C) Copyright 2002-2009 Vladimir Prus and Robert Ramey. +// 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) + +// test of serialization library for diamond inheritence situations + +#include // NULL +#include +#include + +#include +#include // remove +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::remove; +} +#endif + +#include "test_tools.hpp" + +#include +#include +#include +#include +#include +#include +#include + +int save_count = 0; // used to detect when base class is saved multiple times +int load_count = 0; // used to detect when base class is loaded multiple times + +class base { +public: + base() : i(0) {} + base(int i) : i(i) + { + m[i] = "text"; + } + + template + void save(Archive &ar, const unsigned int /* file_version */) const + { + std::cout << "Saving base\n"; + ar << BOOST_SERIALIZATION_NVP(i); + ar << BOOST_SERIALIZATION_NVP(m); + ++save_count; + } + + template + void load(Archive & ar, const unsigned int /* file_version */) + { + std::cout << "Restoring base\n"; + ar >> BOOST_SERIALIZATION_NVP(i); + ar >> BOOST_SERIALIZATION_NVP(m); + ++load_count; + } + + BOOST_SERIALIZATION_SPLIT_MEMBER() + + bool operator==(const base& another) const + { + return i == another.i && m == another.m; + } + // make polymorphic by marking at least one function virtual + virtual ~base() {}; +private: + int i; + std::map m; +}; + +// note: the default is for object tracking to be performed if and only +// if and object of the corresponding class is anywhere serialized +// through a pointer. In this example, that doesn't occur so +// by default, the shared base object wouldn't normally be tracked. +// This would leave to multiple save/load operation of the data in +// this shared base class. This wouldn't cause an error, but it would +// be a waste of time. So set the tracking behavior trait of the base +// class to always track serialized objects of that class. This permits +// the system to detect and elminate redundent save/load operations. +// (It is concievable that this might someday be detected automatically +// but for now, this is not done so we have to rely on the programmer +// to specify this trait) +BOOST_CLASS_TRACKING(base, track_always) + +class derived1 : virtual public base { +public: + template + void save(Archive &ar, const unsigned int /* file_version */) const + { + std::cout << "Saving derived1\n"; + ar << BOOST_SERIALIZATION_BASE_OBJECT_NVP(base); + } + + template + void load(Archive & ar, const unsigned int /* file_version */) + { + std::cout << "Restoring derived1\n"; + ar >> BOOST_SERIALIZATION_BASE_OBJECT_NVP(base); + } + + BOOST_SERIALIZATION_SPLIT_MEMBER() +}; + +class derived2 : virtual public base { +public: + template + void save(Archive &ar, const unsigned int /* file_version */) const + { + std::cout << "Saving derived2\n"; + ar << BOOST_SERIALIZATION_BASE_OBJECT_NVP(base); + } + + template + void load(Archive & ar, const unsigned int /* file_version */) + { + std::cout << "Restoring derived2\n"; + ar >> BOOST_SERIALIZATION_BASE_OBJECT_NVP(base); + } + + BOOST_SERIALIZATION_SPLIT_MEMBER() +}; + +class final : public derived1, public derived2 { +public: + final() {} + final(int i) : base(i) {} + + template + void save(Archive &ar, const unsigned int /* file_version */) const + { + std::cout << "Saving final\n"; + ar << BOOST_SERIALIZATION_BASE_OBJECT_NVP(derived1); + ar << BOOST_SERIALIZATION_BASE_OBJECT_NVP(derived2); + } + + template + void load(Archive & ar, const unsigned int /* file_version */) + { + std::cout << "Restoring final\n"; + ar >> BOOST_SERIALIZATION_BASE_OBJECT_NVP(derived1); + ar >> BOOST_SERIALIZATION_BASE_OBJECT_NVP(derived2); + } + + BOOST_SERIALIZATION_SPLIT_MEMBER() +}; + +BOOST_CLASS_EXPORT(final) + +int +test_main( int /* argc */, char* /* argv */[] ) +{ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + + const final b(3); + { + test_ostream ofs(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(ofs); + oa << boost::serialization::make_nvp("b", b); + } + + final b2; + { + test_istream ifs(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(ifs); + ia >> boost::serialization::make_nvp("b2", b2); + } + BOOST_CHECK(1 == save_count); + BOOST_CHECK(1 == load_count); + BOOST_CHECK(b2 == b); + std::remove(testfile); + + // do the same test with pointers + testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + + save_count = 0; + load_count = 0; + + const base* bp = new final( 3 ); + { + test_ostream ofs(testfile); + test_oarchive oa(ofs); + oa << BOOST_SERIALIZATION_NVP(bp); + } + + base* bp2; + { + test_istream ifs(testfile); + test_iarchive ia(ifs); + ia >> BOOST_SERIALIZATION_NVP(bp2); + } + + BOOST_CHECK(1 == save_count); + BOOST_CHECK(1 == load_count); + BOOST_CHECK(*bp2 == *bp); + std::remove(testfile); + + return EXIT_SUCCESS; +} diff --git a/deal.II/contrib/boost/libs/serialization/test/test_dll_exported.cpp b/deal.II/contrib/boost/libs/serialization/test/test_dll_exported.cpp new file mode 100644 index 0000000000..7b4c8e530f --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_dll_exported.cpp @@ -0,0 +1,148 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_dll_exported.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) + +// should pass compilation and execution + +// This is an overly complex test. The purpose of this test is to +// demostrate and test the ability to serialize a hiarchy of class +// through a base class pointer even though those class might be +// implemente in different dlls and use different extended type info +// systems. +// +// polymorphic_ base is locally declared and defined. It use the +// "no_rtti" extended type info system. + +// polymorphic_derived1 is locally declared and defined. It uses +// the default "type_id" extended type info system + +// polymorphic_derived2 is declared in polymorphic_derived.hpp +// and defined in dll_polymorphic_derived2. It uses the typeid +// system. + +#include // NULL +#include + +#include // remove +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::remove; +} +#endif + +// for now, only test with simple text archive +#define BOOST_ARCHIVE_TEST text_archive.hpp +#include "test_tools.hpp" + +#include + +#include +#include +#include + +#include "polymorphic_base.hpp" + +class polymorphic_derived1 : public polymorphic_base +{ + friend class boost::serialization::access; + template + void serialize(Archive &ar, const unsigned int /* file_version */){ + ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(polymorphic_base); + } + virtual const char * get_key() const { + return "polymorphic_derived1"; + } +public: + virtual ~polymorphic_derived1(){} +}; + +BOOST_CLASS_EXPORT(polymorphic_derived1) + +// MWerks users can do this to make their code work +BOOST_SERIALIZATION_MWERKS_BASE_AND_DERIVED(polymorphic_base, polymorphic_derived1) + +#define POLYMORPHIC_DERIVED2_IMPORT +#include "polymorphic_derived2.hpp" + +// save exported polymorphic class +void save_exported(const char *testfile) +{ + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + + polymorphic_base *rb1 = new polymorphic_derived1; + polymorphic_base *rb2 = new polymorphic_derived2; + polymorphic_derived2 *rd21 = new polymorphic_derived2; + + // export will permit correct serialization + // through a pointer to a base class + oa << BOOST_SERIALIZATION_NVP(rb1); + oa << BOOST_SERIALIZATION_NVP(rb2); + oa << BOOST_SERIALIZATION_NVP(rd21); + + delete rb1; + delete rb2; +} + +// save exported polymorphic class +void load_exported(const char *testfile) +{ + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + + polymorphic_base *rb1 = NULL; + polymorphic_base *rb2 = NULL; + polymorphic_derived2 *rd21 = NULL; + + // export will permit correct serialization + // through a pointer to a base class + ia >> BOOST_SERIALIZATION_NVP(rb1); + BOOST_CHECK_MESSAGE( + boost::serialization::type_info_implementation + ::type::get_const_instance() + == + * boost::serialization::type_info_implementation + ::type::get_const_instance().get_derived_extended_type_info(*rb1), + "restored pointer b1 not of correct type" + ); + ia >> BOOST_SERIALIZATION_NVP(rb2); + BOOST_CHECK_MESSAGE( + boost::serialization::type_info_implementation + ::type::get_const_instance() + == + * boost::serialization::type_info_implementation + ::type::get_const_instance().get_derived_extended_type_info(*rb2), + "restored pointer b2 not of correct type" + ); + ia >> BOOST_SERIALIZATION_NVP(rd21); + BOOST_CHECK_MESSAGE( + boost::serialization::type_info_implementation + ::type::get_const_instance() + == + * boost::serialization::type_info_implementation + ::type::get_const_instance().get_derived_extended_type_info(*rd21), + "restored pointer d2 not of correct type" + ); + delete rb1; + delete rb2; + delete rd21; +} + +int +test_main( int /* argc */, char* /* argv */[] ) +{ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + + save_exported(testfile); + load_exported(testfile); + std::remove(testfile); + return EXIT_SUCCESS; +} + +// EOF diff --git a/deal.II/contrib/boost/libs/serialization/test/test_dll_plugin.cpp b/deal.II/contrib/boost/libs/serialization/test/test_dll_plugin.cpp new file mode 100644 index 0000000000..19dd603bfe --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_dll_plugin.cpp @@ -0,0 +1,206 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_plugin.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) + +// should pass compilation and execution + +// Note this test creates, serializes, and destroys +// a class instance while knowing nothing more than its +// exported class ID (GUID) and a base class from which +// it is derived. This is referred to as a "plugin" +// since the same program could, without recompilation, +// manipulate any number of derived types - even those +// which have not been yet been created. + +#include + +#include // remove +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::remove; +} +#endif + +#include + +// for now, only test with simple text and polymorphic archive +#include "test_tools.hpp" + +#include +#include +#include +#include +#include +#include + +#include "polymorphic_base.hpp" + +// declare and implement a derived class in our own executable +class polymorphic_derived1 : public polymorphic_base +{ + friend class boost::serialization::access; + template + void serialize(Archive &ar, const unsigned int /* file_version */){ + ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(polymorphic_base); + } + const char * get_key() const{ + return + boost::serialization::type_info_implementation< + polymorphic_derived1 + >::type::get_const_instance().get_key(); + } +public: + virtual ~polymorphic_derived1(){} +}; + +// This class is derived from polymorphic_base which uses the no_rtti system +// rather than the typeid system. This system uses the exported name as the +// type identifier key. This MUST be exported!!! +BOOST_CLASS_EXPORT(polymorphic_derived1) + +// MWerks users can do this to make their code work +BOOST_SERIALIZATION_MWERKS_BASE_AND_DERIVED(polymorphic_base, polymorphic_derived1) + +// save exported polymorphic class +void save_exported(const char *testfile) +{ + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + + polymorphic_base *rb1 = new polymorphic_derived1; + + // get the eti record for the exported type "polymorphic_derived2" + boost::serialization::extended_type_info const * const d2_eti = + boost::serialization::extended_type_info::find( + "polymorphic_derived2" + ); + assert(NULL != d2_eti); + + // create a new instance of the type referred to by this record. + // in this example, we happen to know that the class constructor + // takes no arguments. + void const * const rd2 = d2_eti->construct(); + assert(NULL != rd2); + + // transform the pointer to a pointer to the base class + polymorphic_base const * const rb2 + = static_cast( + boost::serialization::void_upcast( + * d2_eti, + boost::serialization::type_info_implementation + ::type::get_const_instance(), + rd2 + ) + ); + + // export will permit correct serialization + // through a pointer to a base class + oa << BOOST_SERIALIZATION_NVP(rb1); + oa << BOOST_SERIALIZATION_NVP(rb2); + + // don't need these any more - don't leak memory + delete rb1; + // note delete original handle - not runtime cast one !!! + //delete rb2; + d2_eti->destroy(rd2); +} + +// save exported polymorphic class +void load_exported(const char *testfile) +{ + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + + polymorphic_base *rb1 = NULL; + polymorphic_base *rb2 = NULL; + + // export will permit correct serialization + // through a pointer to a base class + ia >> BOOST_SERIALIZATION_NVP(rb1); + + BOOST_CHECK_MESSAGE( + boost::serialization::type_info_implementation + ::type::get_const_instance() + == + * boost::serialization::type_info_implementation + ::type::get_const_instance().get_derived_extended_type_info(*rb1), + "restored pointer b1 not of correct type" + ); + ia >> BOOST_SERIALIZATION_NVP(rb2); + + // get the eti record for the exported type "polymorphic_derived2" + boost::serialization::extended_type_info const * const d2_eti = + boost::serialization::extended_type_info::find( + "polymorphic_derived2" + ); + assert(NULL != d2_eti); + + BOOST_CHECK_MESSAGE( + * d2_eti + == + * boost::serialization::type_info_implementation + ::type::get_const_instance().get_derived_extended_type_info(*rb2), + "restored pointer b2 not of correct type" + ); + + delete rb1; + delete rb2; +} + +#ifdef BOOST_WINDOWS + +#define WIN32_LEAN_AND_MEAN +#include + +int +test_main( int /* argc */, char* /* argv */[] ) +{ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + + HINSTANCE hDLL; // Handle to DLL + hDLL = LoadLibrary("plugin_polymorphic_derived2.dll"); + BOOST_CHECK_MESSAGE((0 != hDLL), "Failed to find/load plugin_polymorphic_derived2" ); + if(0 == hDLL) + return EXIT_FAILURE; + + save_exported(testfile); + load_exported(testfile); + FreeLibrary(hDLL); + + std::remove(testfile); + return EXIT_SUCCESS; +} + +#else // presume *nix + +#include + +int +test_main( int /* argc */, char* /* argv */[] ) +{ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + + void * hDLL; // Handle to DLL + hDLL = dlopen("plugin_polymorphic_derived2.so", RTLD_NOW | RTLD_GLOBAL); + BOOST_CHECK_MESSAGE((0 != hDLL), "Failed to find/load plugin_polymorphic_derived2" ); + if(0 == hDLL) + return EXIT_FAILURE; + + save_exported(testfile); + load_exported(testfile); + dlclose(hDLL); + + std::remove(testfile); + return EXIT_SUCCESS; +} + +#endif + +// EOF diff --git a/deal.II/contrib/boost/libs/serialization/test/test_dll_simple.cpp b/deal.II/contrib/boost/libs/serialization/test/test_dll_simple.cpp new file mode 100644 index 0000000000..dd7f98bc7f --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_dll_simple.cpp @@ -0,0 +1,247 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_dll_simple.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) + +// should pass compilation and execution + +// invoke header for a custom archive test. + +#include // NULL +#include + +#include // remove +#include + +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::remove; +} +#endif + +// for now, only test with simple text and polymorphic archive +#include "test_tools.hpp" +#include "text_archive.hpp" + +#include +#include + +#define A_IMPORT +#include "A.hpp" + +// simple class with text archive compiled in dll +void +test1(){ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + + const A a; + A a1; + { + test_ostream os(testfile, TEST_STREAM_FLAGS); + boost::archive::text_oarchive oa(os, TEST_ARCHIVE_FLAGS); + oa << boost::serialization::make_nvp("a", a); + } + { + test_istream is(testfile, TEST_STREAM_FLAGS); + boost::archive::text_iarchive ia(is, TEST_ARCHIVE_FLAGS); + ia >> boost::serialization::make_nvp("a", a1); + } + BOOST_CHECK_EQUAL(a, a1); + + std::remove(testfile); +} + +// simple class with polymorphic archive compiled in dll +void +test2(){ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + + const A a; + A a1; + { + test_ostream os(testfile, TEST_STREAM_FLAGS); + boost::archive::polymorphic_text_oarchive oa(os, TEST_ARCHIVE_FLAGS); + boost::archive::polymorphic_oarchive & poa(oa); + poa << boost::serialization::make_nvp("a", a); + } + { + test_istream is(testfile, TEST_STREAM_FLAGS); + boost::archive::polymorphic_text_iarchive ia(is, TEST_ARCHIVE_FLAGS); + boost::archive::polymorphic_iarchive & pia(ia); + pia >> boost::serialization::make_nvp("a", a1); + } + BOOST_CHECK_EQUAL(a, a1); + + std::remove(testfile); +} + +// simple class pointer with text archive compiled in dll +void +test3(){ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + + const A *a = new A; + A *a1; + { + test_ostream os(testfile, TEST_STREAM_FLAGS); + boost::archive::text_oarchive oa(os, TEST_ARCHIVE_FLAGS); + oa << boost::serialization::make_nvp("a", a); + } + { + test_istream is(testfile, TEST_STREAM_FLAGS); + boost::archive::text_iarchive ia(is, TEST_ARCHIVE_FLAGS); + ia >> boost::serialization::make_nvp("a", a1); + } + BOOST_CHECK_EQUAL(*a, *a1); + + std::remove(testfile); + delete a; +} + +// simple class pointer with polymorphic archive compiled in dll +void +test4(){ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + + const A *a = new A; + A *a1; + { + test_ostream os(testfile, TEST_STREAM_FLAGS); + boost::archive::polymorphic_text_oarchive oa(os, TEST_ARCHIVE_FLAGS); + boost::archive::polymorphic_oarchive & poa(oa); + poa << boost::serialization::make_nvp("a", a); + } + { + test_istream is(testfile, TEST_STREAM_FLAGS); + boost::archive::polymorphic_text_iarchive ia(is, TEST_ARCHIVE_FLAGS); + boost::archive::polymorphic_iarchive & pia(ia); + pia >> boost::serialization::make_nvp("a", a1); + } + BOOST_CHECK_EQUAL(*a, *a1); + + std::remove(testfile); + delete a; +} + +#include "B.hpp" + +// derived class with base text archive compiled in dll +void +test5(){ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + + const B b; + B b1; + { + test_ostream os(testfile, TEST_STREAM_FLAGS); + boost::archive::text_oarchive oa(os, TEST_ARCHIVE_FLAGS); + oa << boost::serialization::make_nvp("b", b); + } + { + test_istream is(testfile, TEST_STREAM_FLAGS); + boost::archive::text_iarchive ia(is, TEST_ARCHIVE_FLAGS); + ia >> boost::serialization::make_nvp("b", b1); + } + BOOST_CHECK_EQUAL(b, b1); + + std::remove(testfile); +} + +// derived class with base base compiled with polymorphic archive in dll +void +test6(){ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + + const B b; + B b1; + { + test_ostream os(testfile, TEST_STREAM_FLAGS); + boost::archive::polymorphic_text_oarchive oa(os, TEST_ARCHIVE_FLAGS); + boost::archive::polymorphic_oarchive & poa(oa); + poa << boost::serialization::make_nvp("b", b); + } + { + test_istream is(testfile, TEST_STREAM_FLAGS); + boost::archive::polymorphic_text_iarchive ia(is, TEST_ARCHIVE_FLAGS); + boost::archive::polymorphic_iarchive & pia(ia); + pia >> boost::serialization::make_nvp("b", b1); + } + BOOST_CHECK_EQUAL(b, b1); + + std::remove(testfile); +} + +// derived class pointer with base text archive compiled in dll +void +test7(){ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + + const B *b = new B; + B *b1; + { + test_ostream os(testfile, TEST_STREAM_FLAGS); + boost::archive::text_oarchive oa(os, TEST_ARCHIVE_FLAGS); + oa << boost::serialization::make_nvp("b", b); + } + { + test_istream is(testfile, TEST_STREAM_FLAGS); + boost::archive::text_iarchive ia(is, TEST_ARCHIVE_FLAGS); + ia >> boost::serialization::make_nvp("b", b1); + } + BOOST_CHECK_EQUAL(*b, *b1); + + std::remove(testfile); + delete b; +} + +// derived class pointer with base polymorphic archive compiled in dll +void +test8(){ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + + const B *b = new B; + B *b1; + { + test_ostream os(testfile, TEST_STREAM_FLAGS); + boost::archive::polymorphic_text_oarchive oa(os, TEST_ARCHIVE_FLAGS); + boost::archive::polymorphic_oarchive & poa(oa); + poa << boost::serialization::make_nvp("b", b); + } + { + test_istream is(testfile, TEST_STREAM_FLAGS); + boost::archive::polymorphic_text_iarchive ia(is, TEST_ARCHIVE_FLAGS); + boost::archive::polymorphic_iarchive & pia(ia); + pia >> boost::serialization::make_nvp("b", b1); + } + BOOST_CHECK_EQUAL(*b, *b1); + + std::remove(testfile); + delete b; +} + + +int +test_main( int /* argc */, char* /* argv */[] ) +{ + test1(); + test2(); + test3(); + test4(); + test5(); + test6(); + test7(); + test8(); + return EXIT_SUCCESS; +} + diff --git a/deal.II/contrib/boost/libs/serialization/test/test_exported.cpp b/deal.II/contrib/boost/libs/serialization/test/test_exported.cpp new file mode 100644 index 0000000000..7db68c2104 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_exported.cpp @@ -0,0 +1,143 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_exported.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) + +// should pass compilation and execution + +#include +#include + +#include +#include // remove +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::remove; +} +#endif + +#include +#include +#include +#include + +#include + +#include +#include "test_tools.hpp" + +#include "polymorphic_base.hpp" + +class polymorphic_derived1 : + public polymorphic_base +{ + friend class boost::serialization::access; + template + void serialize(Archive & ar, const unsigned int /* file_version */){ + ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(polymorphic_base); + } + virtual const char * get_key() const { + return "polymorphic_derived1"; + } +public: + ~polymorphic_derived1(){} +}; + +BOOST_CLASS_EXPORT(polymorphic_derived1) + +// MWerks users can do this to make their code work +BOOST_SERIALIZATION_MWERKS_BASE_AND_DERIVED(polymorphic_base, polymorphic_derived1) + +#include "polymorphic_derived2.hpp" + +// MWerks users can do this to make their code work +BOOST_SERIALIZATION_MWERKS_BASE_AND_DERIVED(polymorphic_base, polymorphic_derived2) + +template +void polymorphic_derived2::serialize( + Archive &ar, + const unsigned int /* file_version */ +){ + ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(polymorphic_base); +} + +BOOST_CLASS_EXPORT_IMPLEMENT(polymorphic_derived2) + +template EXPORT_DECL(void) polymorphic_derived2::serialize( + test_oarchive & ar, + const unsigned int version +); +template EXPORT_DECL(void) polymorphic_derived2::serialize( + test_iarchive & ar, + const unsigned int version +); + +// save exported polymorphic class +void save_exported(const char *testfile) +{ + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + + polymorphic_base *rb1 = new polymorphic_derived1; + polymorphic_base *rb2 = new polymorphic_derived2; + + // export will permit correct serialization + // through a pointer to a base class + oa << BOOST_SERIALIZATION_NVP(rb1); + oa << BOOST_SERIALIZATION_NVP(rb2); + + delete rb1; + delete rb2; +} + +// save exported polymorphic class +void load_exported(const char *testfile) +{ + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + + polymorphic_base *rb1 = NULL; + polymorphic_base *rb2 = NULL; + + // export will permit correct serialization + // through a pointer to a base class + ia >> BOOST_SERIALIZATION_NVP(rb1); + BOOST_CHECK_MESSAGE( + boost::serialization::type_info_implementation + ::type::get_const_instance() + == + * boost::serialization::type_info_implementation + ::type::get_const_instance().get_derived_extended_type_info(*rb1), + "restored pointer b1 not of correct type" + ); + + ia >> BOOST_SERIALIZATION_NVP(rb2); + BOOST_CHECK_MESSAGE( + boost::serialization::type_info_implementation + ::type::get_const_instance() + == + * boost::serialization::type_info_implementation + ::type::get_const_instance().get_derived_extended_type_info(*rb2), + "restored pointer b2 not of correct type" + ); + + delete rb1; + delete rb2; +} + +int +test_main( int /* argc */, char* /* argv */[] ) +{ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + + save_exported(testfile); + load_exported(testfile); + std::remove(testfile); + return EXIT_SUCCESS; +} + +// EOF diff --git a/deal.II/contrib/boost/libs/serialization/test/test_inclusion.cpp b/deal.II/contrib/boost/libs/serialization/test/test_inclusion.cpp new file mode 100644 index 0000000000..d258cb6aa7 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_inclusion.cpp @@ -0,0 +1,42 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_const.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) + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +struct foo +{ + int x; +private: + friend class boost::serialization::access; + + template + void serialize(Archive & ar, const unsigned int version) + { + // In compilers implementing 2-phase lookup, the call to + // make_nvp is resolved even if foo::serialize() is never + // instantiated. + ar & boost::serialization::make_nvp("x",x); + } +}; + +int +main(int /*argc*/, char * /*argv*/[]){ + return 0; +} diff --git a/deal.II/contrib/boost/libs/serialization/test/test_iterators.cpp b/deal.II/contrib/boost/libs/serialization/test/test_iterators.cpp new file mode 100644 index 0000000000..cc096dab2c --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_iterators.cpp @@ -0,0 +1,213 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_iterators.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) + +#include +#include +#include // for rand +#include +#include // used to test stream iterators + +#include +#ifdef BOOST_NO_STDC_NAMESPACE +namespace std{ + using ::rand; +} +#endif + +#include +#if BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1) +#include +#endif + +#ifndef BOOST_NO_CWCHAR +#include +#include +#endif +#include +#include +#include +#include +#include + +#include "test_tools.hpp" + +#ifndef BOOST_NO_CWCHAR + +void test_wchar_from_mb(const wchar_t *la, const char * a, const unsigned int size){ + typedef boost::archive::iterators::wchar_from_mb translator; + BOOST_CHECK(( + std::equal( + translator(BOOST_MAKE_PFTO_WRAPPER(a)), + translator(BOOST_MAKE_PFTO_WRAPPER(a + size)), + la + ) + )); +} + +void test_mb_from_wchar(const char * a, const wchar_t *la, const unsigned int size){ + typedef boost::archive::iterators::mb_from_wchar translator; + BOOST_CHECK( + std::equal( + translator(BOOST_MAKE_PFTO_WRAPPER(la)), + translator(BOOST_MAKE_PFTO_WRAPPER(la + size)), + a + ) + ); +} + +#endif + +template +void test_xml_escape( + const CharType * xml_escaped, + const CharType * xml, + unsigned int size +){ + typedef boost::archive::iterators::xml_escape translator; + + BOOST_CHECK( + std::equal( + translator(BOOST_MAKE_PFTO_WRAPPER(xml)), + translator(BOOST_MAKE_PFTO_WRAPPER(xml + size)), + xml_escaped + ) + ); +} + +template +void test_xml_unescape( + const CharType * xml, + const CharType * xml_escaped, + unsigned int size +){ + + // test xml_unescape + typedef boost::archive::iterators::xml_unescape translator; + + BOOST_CHECK( + std::equal( + translator(BOOST_MAKE_PFTO_WRAPPER(xml_escaped)), + translator(BOOST_MAKE_PFTO_WRAPPER(xml_escaped + size)), + xml + ) + ); +} + +template +void test_transform_width(unsigned int size){ + // test transform_width + char rawdata[8]; + + char * rptr; + for(rptr = rawdata + 6; rptr-- > rawdata;) + *rptr = static_cast(0xff & std::rand()); + + // convert 8 to 6 bit characters + typedef boost::archive::iterators::transform_width< + char *, BitsOut, BitsIn + > translator1; + + std::vector v6; + + std::copy( + translator1(BOOST_MAKE_PFTO_WRAPPER(static_cast(rawdata))), + translator1(BOOST_MAKE_PFTO_WRAPPER(rawdata + size)), + std::back_inserter(v6) + ); + + // check to see we got the expected # of characters out + if(0 == size) + BOOST_CHECK(v6.size() == 0); + else + BOOST_CHECK(v6.size() == (size * BitsIn - 1 ) / BitsOut + 1); + + typedef boost::archive::iterators::transform_width< + std::vector::iterator, BitsIn, BitsOut + > translator2; + + BOOST_CHECK( + std::equal( + rawdata, + rawdata + size, + translator2(BOOST_MAKE_PFTO_WRAPPER(v6.begin())) + ) + ); + +} + +template +void test_stream_iterators( + const CharType * test_data, + unsigned int size +){ + std::basic_stringstream ss; + boost::archive::iterators::ostream_iterator osi = + boost::archive::iterators::ostream_iterator(ss); + std::copy(test_data, test_data + size, osi); + + BOOST_CHECK(size == ss.str().size()); + + boost::archive::iterators::istream_iterator isi = + boost::archive::iterators::istream_iterator(ss); + BOOST_CHECK(std::equal(test_data, test_data + size,isi)); +} + +int +test_main(int /* argc */, char* /* argv */ [] ) +{ + const char xml[] = "<+>+&+\"+'"; + const char xml_escaped[] = "<+>+&+"+'"; + test_xml_escape( + xml_escaped, + xml, + sizeof(xml) / sizeof(char) - 1 + ); + test_xml_unescape( + xml, + xml_escaped, + sizeof(xml_escaped) / sizeof(char) - 1 + ); + + const char a[] = "abcdefghijklmnopqrstuvwxyz"; + + #ifndef BOOST_NO_CWCHAR + const wchar_t wxml[] = L"<+>+&+\"+'"; + const wchar_t wxml_escaped[] = L"<+>+&+"+'"; + test_xml_escape( + wxml_escaped, + wxml, + sizeof(wxml) / sizeof(wchar_t) - 1 + ); + test_xml_unescape( + wxml, + wxml_escaped, + sizeof(wxml_escaped) / sizeof(wchar_t) - 1 + ); + + const wchar_t la[] = L"abcdefghijklmnopqrstuvwxyz"; + + test_wchar_from_mb(la, a, sizeof(a) / sizeof(char) - 1); + test_mb_from_wchar(a, la, sizeof(la) / sizeof(wchar_t) - 1); + + test_stream_iterators(la, sizeof(la)/sizeof(wchar_t) - 1); + #endif + + test_stream_iterators(a, sizeof(a) - 1); + + test_transform_width<6, 8>(0); + test_transform_width<6, 8>(1); + test_transform_width<6, 8>(2); + test_transform_width<6, 8>(3); + test_transform_width<6, 8>(4); + test_transform_width<6, 8>(5); + test_transform_width<6, 8>(6); + test_transform_width<6, 8>(7); + test_transform_width<6, 8>(8); + + return EXIT_SUCCESS; +} diff --git a/deal.II/contrib/boost/libs/serialization/test/test_iterators_base64.cpp b/deal.II/contrib/boost/libs/serialization/test/test_iterators_base64.cpp new file mode 100644 index 0000000000..a3ebaa71e6 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_iterators_base64.cpp @@ -0,0 +1,100 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_iterators.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) + +#include +#include + +#if (defined _MSC_VER) && (_MSC_VER == 1200) +# pragma warning (disable : 4786) // too long name, harmless warning +#endif + +#include +#include // size_t + +#include +#ifdef BOOST_NO_STDC_NAMESPACE +namespace std{ + using ::rand; + using ::size_t; +} +#endif + +#include + +#include +#include +#include +#include +#include + +#include "test_tools.hpp" + +#include + +template +void test_base64(){ + CharType rawdata[150]; + std::size_t size = sizeof(rawdata) / sizeof(CharType); + CharType * rptr; + for(rptr = rawdata + size; rptr-- > rawdata;) + *rptr = static_cast(std::rand()); + + // convert to base64 + typedef std::list text_base64_type; + text_base64_type text_base64; + + typedef + boost::archive::iterators::insert_linebreaks< + boost::archive::iterators::base64_from_binary< + boost::archive::iterators::transform_width< + CharType * + ,6 + ,sizeof(CharType) * 8 + > + > + ,72 + > + translate_out; + + std::copy( + translate_out(BOOST_MAKE_PFTO_WRAPPER(static_cast(rawdata))), + translate_out(BOOST_MAKE_PFTO_WRAPPER(rawdata + size)), + std::back_inserter(text_base64) + ); + + // convert from base64 to binary and compare with the original + typedef + boost::archive::iterators::transform_width< + boost::archive::iterators::binary_from_base64< + boost::archive::iterators::remove_whitespace< + BOOST_DEDUCED_TYPENAME text_base64_type::iterator + > + >, + sizeof(CharType) * 8, + 6 + > translate_in; + + BOOST_CHECK( + std::equal( + rawdata, + rawdata + size, + translate_in(BOOST_MAKE_PFTO_WRAPPER(text_base64.begin())) + ) + ); + +} + +int +test_main( int /*argc*/, char* /*argv*/[] ) +{ + test_base64(); + #ifndef BOOST_NO_CWCHAR + test_base64(); + #endif + return EXIT_SUCCESS; +} diff --git a/deal.II/contrib/boost/libs/serialization/test/test_list.cpp b/deal.II/contrib/boost/libs/serialization/test/test_list.cpp new file mode 100644 index 0000000000..861f8eea28 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_list.cpp @@ -0,0 +1,77 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_list.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) + +// should pass compilation and execution + +#include // NULL +#include + +#include +#include // remove +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::remove; +} +#endif + +#include +#include "test_tools.hpp" + +#include +#ifdef BOOST_HAS_SLIST +#include +#endif + +#include "A.hpp" +#include "A.ipp" + +int test_main( int /* argc */, char* /* argv */[] ) +{ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + + std::list alist; + alist.push_back(A()); + alist.push_back(A()); + { + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + oa << boost::serialization::make_nvp("alist",alist); + } + + std::list alist1; + { + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + ia >> boost::serialization::make_nvp("alist",alist1); + } + BOOST_CHECK(alist == alist1); + + #ifdef BOOST_HAS_SLIST + BOOST_STD_EXTENSION_NAMESPACE::slist aslist; + aslist.push_front(A()); + aslist.push_front(A()); + { + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + oa << boost::serialization::make_nvp("aslist", aslist); + } + BOOST_STD_EXTENSION_NAMESPACE::slist aslist1;{ + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + ia >> boost::serialization::make_nvp("aslist", aslist1); + } + BOOST_CHECK(aslist == aslist1); + + #endif + std::remove(testfile); + return EXIT_SUCCESS; +} + +// EOF + diff --git a/deal.II/contrib/boost/libs/serialization/test/test_list_ptrs.cpp b/deal.II/contrib/boost/libs/serialization/test/test_list_ptrs.cpp new file mode 100644 index 0000000000..9a36a39feb --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_list_ptrs.cpp @@ -0,0 +1,130 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_list.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) + +// should pass compilation and execution + +#include +#include + +#include +#include // remove +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::remove; +} +#endif + +#include +#include +#include + +#include +#include "test_tools.hpp" + +#include +#ifdef BOOST_HAS_SLIST +#include +#endif +#include + +#include "A.hpp" +#include "A.ipp" + +template +struct ptr_equal_to : public std::binary_function +{ + BOOST_STATIC_ASSERT(::boost::is_pointer::value); + bool operator()(T const _Left, T const _Right) const + { + if(NULL == _Left && NULL == _Right) + return true; + if(typeid(*_Left) != typeid(*_Right)) + return false; + return *_Left == *_Right; + } +}; + +int test_main( int /* argc */, char* /* argv */[] ) +{ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + + std::list alist; + { + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + A * free_a_ptr = new A; + alist.push_back(free_a_ptr); + alist.push_back(new A); + // verify that first element is the same as the free pointer + BOOST_CHECK((*alist.begin()) == free_a_ptr); + oa << boost::serialization::make_nvp("alist", alist); + oa << boost::serialization::make_nvp("free_a_ptr", free_a_ptr); + } + std::list alist1; + { + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + A * free_a_ptr1; + ia >> boost::serialization::make_nvp("alist", alist1); + ia >> boost::serialization::make_nvp("free_a_ptr", free_a_ptr1); + BOOST_CHECK( + alist.size() == alist1.size() + && std::equal(alist.begin(),alist.end(),alist1.begin(),ptr_equal_to()) + ); + // verify that first element is the same as the free pointer + BOOST_CHECK((*alist1.begin()) == free_a_ptr1); + } + + std::for_each( + alist.begin(), + alist.end(), + boost::checked_deleter() + ); + std::for_each( + alist1.begin(), + alist1.end(), + boost::checked_deleter() + ); + + #ifdef BOOST_HAS_SLIST + std::list aslist; + { + aslist.push_back(new A); + aslist.push_back(new A); + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + aslist.push_back(new A); + aslist.push_back(new A); + oa << boost::serialization::make_nvp("aslist", aslist); + } + std::list aslist1; + { + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + ia >> boost::serialization::make_nvp("aslist", aslist1); + BOOST_CHECK(aslist.size() == aslist1.size() && + std::equal(aslist.begin(),aslist.end(),aslist1.begin(),ptr_equal_to()) + ); + } + std::for_each( + aslist.begin(), + aslist.end(), + boost::checked_deleter() + ); + std::for_each( + aslist1.begin(), + aslist1.end(), + boost::checked_deleter() + ); + #endif + std::remove(testfile); + return EXIT_SUCCESS; +} + +// EOF diff --git a/deal.II/contrib/boost/libs/serialization/test/test_map.cpp b/deal.II/contrib/boost/libs/serialization/test/test_map.cpp new file mode 100644 index 0000000000..7ae442691b --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_map.cpp @@ -0,0 +1,229 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_map.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) + +// should pass compilation and execution + +#include +#include +#include +#include // size_t, NULL + +#include +#include + +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::rand; + using ::size_t; +} +#endif + +#include "test_tools.hpp" + +#include +#include + +#include "A.hpp" +#include "A.ipp" + +/////////////////////////////////////////////////////// +// a key value initialized with a random value for use +// in testing STL map serialization +struct random_key { + friend class boost::serialization::access; + template + void serialize( + Archive & ar, + const unsigned int /* file_version */ + ){ + ar & boost::serialization::make_nvp("random_key", m_i); + } + int m_i; + random_key() : m_i(std::rand()){}; + bool operator<(const random_key &rhs) const { + return m_i < rhs.m_i; + } + bool operator==(const random_key &rhs) const { + return m_i == rhs.m_i; + } + operator std::size_t () const { // required by hash_map + return m_i; + } +}; + +BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(random_key) + +void +test_map(){ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + + BOOST_MESSAGE("map"); + // test map of objects + std::map amap; + amap.insert(std::make_pair(random_key(), A())); + amap.insert(std::make_pair(random_key(), A())); + { + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + oa << boost::serialization::make_nvp("amap", amap); + } + std::map amap1; + { + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + ia >> boost::serialization::make_nvp("amap", amap1); + } + BOOST_CHECK(amap == amap1); + std::remove(testfile); +} + +void +test_map_2(){ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + + BOOST_MESSAGE("map_2"); + std::pair a(11, 22); + std::map b; + b[0] = 0; + b[-1] = -1; + b[1] = 1; + { + test_ostream os(testfile, TEST_STREAM_FLAGS); + std::pair * const pa = &a; + std::map * const pb = &b; + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + oa << BOOST_SERIALIZATION_NVP(pb); + oa << BOOST_SERIALIZATION_NVP(pa); + } + { + test_istream is(testfile, TEST_STREAM_FLAGS); + std::pair *pa = 0; + std::map *pb = 0; + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + ia >> BOOST_SERIALIZATION_NVP(pb); + ia >> BOOST_SERIALIZATION_NVP(pa); + delete pa; + delete pb; + } + std::remove(testfile); +} + +void +test_multimap(){ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + + BOOST_MESSAGE("multimap"); + std::multimap amultimap; + amultimap.insert(std::make_pair(random_key(), A())); + amultimap.insert(std::make_pair(random_key(), A())); + { + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + oa << boost::serialization::make_nvp("amultimap", amultimap); + } + std::multimap amultimap1; + { + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + ia >> boost::serialization::make_nvp("amultimap", amultimap1); + } + BOOST_CHECK(amultimap == amultimap1); + std::remove(testfile); +} + +#ifdef BOOST_HAS_HASH +#include + +namespace BOOST_STD_EXTENSION_NAMESPACE { + template<> + struct hash{ + std::size_t operator()(const random_key& r) const { + return (std::size_t)r; + } + }; +} // namespace BOOST_STD_EXTENSION_NAMESPACE + +void +test_hash_map(){ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + + BOOST_CHECKPOINT("hash_map"); + // test hash_map of objects + BOOST_STD_EXTENSION_NAMESPACE::hash_map ahash_map; + ahash_map.insert(std::make_pair(random_key(), A())); + ahash_map.insert(std::make_pair(random_key(), A())); + { + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + oa << boost::serialization::make_nvp("ahashmap",ahash_map); + } + BOOST_STD_EXTENSION_NAMESPACE::hash_map ahash_map1; + { + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + ia >> boost::serialization::make_nvp("ahashmap",ahash_map1); + } + + std::vector< std::pair > tvec, tvec1; + std::copy(ahash_map.begin(), ahash_map.end(), std::back_inserter(tvec)); + std::sort(tvec.begin(), tvec.end()); + std::copy(ahash_map1.begin(), ahash_map1.end(), std::back_inserter(tvec1)); + std::sort(tvec1.begin(), tvec1.end()); + BOOST_CHECK(tvec == tvec1); + + std::remove(testfile); +} + +void +test_hash_multimap(){ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + + BOOST_CHECKPOINT("hash_multimap"); + BOOST_STD_EXTENSION_NAMESPACE::hash_multimap ahash_multimap; + ahash_multimap.insert(std::make_pair(random_key(), A())); + ahash_multimap.insert(std::make_pair(random_key(), A())); + { + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + oa << boost::serialization::make_nvp("ahash_multimap", ahash_multimap); + } + BOOST_STD_EXTENSION_NAMESPACE::hash_multimap ahash_multimap1; + { + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + ia >> boost::serialization::make_nvp("ahash_multimap", ahash_multimap1); + } + std::vector< std::pair > tvec, tvec1; + tvec.clear(); + tvec1.clear(); + std::copy(ahash_multimap.begin(), ahash_multimap.end(), std::back_inserter(tvec)); + std::sort(tvec.begin(), tvec.end()); + std::copy(ahash_multimap1.begin(), ahash_multimap1.end(), std::back_inserter(tvec1)); + std::sort(tvec1.begin(), tvec1.end()); + BOOST_CHECK(tvec == tvec1); + std::remove(testfile); +} +#endif + +int test_main( int /* argc */, char* /* argv */[] ) +{ + test_map(); + test_map_2(); + test_multimap(); + #ifdef BOOST_HAS_HASH + test_hash_map(); + test_hash_multimap(); + #endif + return EXIT_SUCCESS; +} diff --git a/deal.II/contrib/boost/libs/serialization/test/test_mi.cpp b/deal.II/contrib/boost/libs/serialization/test/test_mi.cpp new file mode 100644 index 0000000000..22e6454d86 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_mi.cpp @@ -0,0 +1,135 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_mi.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) + +// test of serialization of base classes with multiple inheritance +// contributed by Peter Dimov + +#include +#include +#include + +#include +#include // remove +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::remove; +} +#endif + +#include "test_tools.hpp" + +#include +#include + +class A +{ +private: + friend class boost::serialization::access; + int x; + template + void serialize(Archive &ar, const unsigned int /* file_version */){ + ar & BOOST_SERIALIZATION_NVP(x); + } +public: + explicit A(int x = 0): x(x) {} + virtual ~A(); // = 0; + int get_x() const + { + return x; + } +}; + +inline A::~A() +{ +} + +class B +{ +private: + int y; + friend class boost::serialization::access; + template + void serialize(Archive &ar, const unsigned int /* file_version */){ + ar & BOOST_SERIALIZATION_NVP(y); + } +public: + explicit B(int y = 0): y(y) {} + virtual ~B(){} + int get_y() const + { + return y; + } +}; + +class C: public A, public B +{ +private: + friend class boost::serialization::access; + template + void serialize(Archive &ar, const unsigned int /* file_version */){ + ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(A); + ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(B); + } +public: + C(){} + C(int x, int y): A(x), B(y){} +}; + +int +test_main( int /* argc */, char* /* argv */[] ) +{ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + + C * pc = new C(1, 2); + A * pa = pc; + B * pb = pc; + + BOOST_CHECK(pa == pc); + BOOST_CHECK(pb == pc); + + int x = pa->get_x(); + int y = pb->get_y(); + + std::cout << "pa->get_x(): " << pa->get_x() << std::endl; + std::cout << "pb->get_y(): " << pb->get_y() << std::endl; + + { + test_ostream ofs(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(ofs); + oa << BOOST_SERIALIZATION_NVP(pc); + oa << BOOST_SERIALIZATION_NVP(pa); + oa << BOOST_SERIALIZATION_NVP(pb); + } + + delete pc; + pc = NULL; + pa = NULL; + pb = NULL; + + { + test_istream ifs(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(ifs); + ia >> BOOST_SERIALIZATION_NVP(pc); + ia >> BOOST_SERIALIZATION_NVP(pa); + ia >> BOOST_SERIALIZATION_NVP(pb); + } + + BOOST_CHECK(pa == pc); + BOOST_CHECK(pb == pc); + + BOOST_CHECK(x == pa->get_x()); + BOOST_CHECK(y == pb->get_y()); + + std::cout << "pa->get_x(): " << pa->get_x() << std::endl; + std::cout << "pb->get_y(): " << pb->get_y() << std::endl; + + delete pc; + std::remove(testfile); + return EXIT_SUCCESS; +} diff --git a/deal.II/contrib/boost/libs/serialization/test/test_mult_archive_types.cpp b/deal.II/contrib/boost/libs/serialization/test/test_mult_archive_types.cpp new file mode 100644 index 0000000000..b3985ebd3d --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_mult_archive_types.cpp @@ -0,0 +1,122 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_mult_archive_types.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) + +#include +#include + +#include +#include // remove +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::remove; +} +#endif + +#include +#include +#include +#include +#include "test_tools.hpp" + +#include +#include + +// This is a simple class. It contains a counter of the number +// of objects of this class which have been instantiated. +class A +{ +private: + friend class boost::serialization::access; + int x; + template + void serialize(Archive & ar, const unsigned int /* file_version */){ + ar & BOOST_SERIALIZATION_NVP(x); + } +public: + static int count; + A(){++count;} // default constructor + virtual ~A(){--count;} // default destructor +}; + +BOOST_CLASS_EXPORT(A) + +// B is a subclass of A +class B : public A +{ +private: + friend class boost::serialization::access; + int y; + template + void serialize(Archive & ar, const unsigned int /* file_version */){ + ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(A); + } +public: + static int count; + B() : A() {}; + virtual ~B() {}; +}; + +BOOST_CLASS_EXPORT(B) + +int A::count = 0; + +// Run tests by serializing two shared_ptrs into an archive of type +// OARCH, clearing them (deleting the objects) and then reloading the +// objects back from an archive of type OARCH. +template +void test_save_and_load(A * first, A * second) +{ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + + // Save + { + std::ofstream os(testfile); + OA oa(os); + oa << BOOST_SERIALIZATION_NVP(first); + oa << BOOST_SERIALIZATION_NVP(second); + } + + // Clear the pointers, thereby destroying the objects they contain + first = NULL; + second = NULL; + + // Load + { + std::ifstream is(testfile); + IA ia(is); + ia >> BOOST_SERIALIZATION_NVP(first); + ia >> BOOST_SERIALIZATION_NVP(second); + } + BOOST_CHECK(first == second); + std::remove(testfile); +} + +using namespace boost::archive; + +// This does the tests +int test_main(int /* argc */, char * /* argv */[]) +{ + // Try to save and load pointers to As, to a text archive + A * a = new A; + A * a1 = a; + test_save_and_load(a, a1); + + // Try to save and load pointers to Bs, to a text archive + B * b = new B; + B * b1 = b; + test_save_and_load(b, b1); + + // Try to save and load pointers to As, to an xml archive + test_save_and_load(a, a1); + + // Try to save and load pointers to Bs, to an xml archive + test_save_and_load(b, b1); + + return EXIT_SUCCESS; +} diff --git a/deal.II/contrib/boost/libs/serialization/test/test_multiple_inheritance.cpp b/deal.II/contrib/boost/libs/serialization/test/test_multiple_inheritance.cpp new file mode 100644 index 0000000000..0653519514 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_multiple_inheritance.cpp @@ -0,0 +1,125 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_multiple_inheritance.cpp + +// (C) Copyright 2009 Robert Ramey. +// 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) + +// test of serialization library for multiple inheritence situations + +#include +#include + +#include +#include // remove +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::remove; +} +#endif + +#include "test_tools.hpp" + +#include +#include +#include +#include + +struct Base1 { + int m_x; + Base1(){} + Base1(int x) : m_x(1 + x) {} + virtual ~Base1() {} + bool operator==(Base1 & rhs) const { + return m_x == rhs.m_x; + } + // serialize + friend class boost::serialization::access; + template + void serialize(Archive & ar, const unsigned int /* file_version */) { + ar & BOOST_SERIALIZATION_NVP(m_x); + } +}; + +//BOOST_CLASS_EXPORT(Base1) + +struct Base2 { + int m_x; + Base2(){} + Base2(int x) : m_x(2 + x) {} + virtual ~Base2() {} + bool operator==(Base2 & rhs) const { + return m_x == rhs.m_x; + } + // serialize + friend class boost::serialization::access; + template + void serialize(Archive & ar, const unsigned int /* file_version */) { + ar & BOOST_SERIALIZATION_NVP(m_x); + } +}; + +//BOOST_CLASS_EXPORT(Base2) + +struct Sub : + public Base1, + public Base2 +{ + int m_x; + Sub(){} + Sub(int x) : + Base1(x), + Base2(x), + m_x(x) + {} + bool operator==(Sub & rhs) const { + if(! Base2::operator==(rhs)) + return false; + if(! Base1::operator==(rhs)) + return false; + return m_x == rhs.m_x; + } + virtual ~Sub() {} + + // serialize + friend class boost::serialization::access; + template + void serialize(Archive &ar, const unsigned int /* file_version */) + { + ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(Base1); + ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(Base2); + ar & BOOST_SERIALIZATION_NVP(m_x); + } +}; + +BOOST_CLASS_EXPORT(Sub) + +int +test_main( int /* argc */, char* /* argv */[] ) +{ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + Base2 * pb2; + { + // serialize + pb2 = new Sub(2); + + test_ostream ofs(testfile); + test_oarchive oa(ofs); + oa << boost::serialization::make_nvp("Base2", pb2); + } + Base2 * pb2_1; + { + // de-serialize + test_istream ifs(testfile); + test_iarchive ia(ifs); + ia >> boost::serialization::make_nvp("Base2", pb2_1); + } + Sub *s1 = dynamic_cast(pb2); + BOOST_CHECK(0 != s1); + Sub *s2 = dynamic_cast(pb2_1); + BOOST_CHECK(0 != s2); + BOOST_CHECK(*s1 == *s2); + return EXIT_SUCCESS; +} diff --git a/deal.II/contrib/boost/libs/serialization/test/test_multiple_ptrs.cpp b/deal.II/contrib/boost/libs/serialization/test/test_multiple_ptrs.cpp new file mode 100644 index 0000000000..df1e5fba90 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_multiple_ptrs.cpp @@ -0,0 +1,50 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_archive_derivation.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) + +// should pass compilation and execution + +#include +#include + +#include +#include // remove +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::remove; +} +#endif + +#include "test_tools.hpp" + +#include "D.hpp" +#include "A.ipp" + +int test_main( int /* argc */, char* /* argv */[] ) +{ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + + const A a; + A a1; + + { + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + oa << boost::serialization::make_nvp("a", a); + } + { + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + ia >> boost::serialization::make_nvp("a", a1); + } + BOOST_CHECK(a == a1); + std::remove(testfile); + return EXIT_SUCCESS; +} + +// EOF diff --git a/deal.II/contrib/boost/libs/serialization/test/test_new_operator.cpp b/deal.II/contrib/boost/libs/serialization/test/test_new_operator.cpp new file mode 100644 index 0000000000..c356b02a78 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_new_operator.cpp @@ -0,0 +1,95 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_new_operator.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) + +// should pass compilation and execution + +#include // NULL +#include // remove +#include +#include + +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::remove; +} +#endif + +#include + +#include "test_tools.hpp" + +#include "A.hpp" +#include "A.ipp" + +class ANew : public A { + friend class boost::serialization::access; + template + void serialize(Archive & ar, const unsigned /*file_version*/){ + ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(A); + } +public: + static unsigned int m_new_calls; + static unsigned int m_delete_calls; + // implement class specific new/delete in terms standard + // implementation - we're testing serialization + // not "new" here. + static void * operator new(size_t s){ + ++m_new_calls; + return ::operator new(s); + } + static void operator delete(void *p, std::size_t /*s*/){ + ++m_delete_calls; + ::operator delete(p); + } +}; + +unsigned int ANew::m_new_calls = 0; +unsigned int ANew::m_delete_calls = 0; + +int test_main( int /* argc */, char* /* argv */[] ) +{ + const char * testfile = boost::archive::tmpnam(NULL); + + BOOST_REQUIRE(NULL != testfile); + + ANew *ta = new ANew(); + + BOOST_CHECK(1 == ANew::m_new_calls); + BOOST_CHECK(0 == ANew::m_delete_calls); + + ANew *ta1 = NULL; + + { + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + oa << boost::serialization::make_nvp("ta", ta); + } + { + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + ia >> boost::serialization::make_nvp("ta", ta1); + } + BOOST_CHECK(ta != ta1); + BOOST_CHECK(*ta == *ta1); + + BOOST_CHECK(2 == ANew::m_new_calls); + BOOST_CHECK(0 == ANew::m_delete_calls); + + std::remove(testfile); + + delete ta; + delete ta1; + + BOOST_CHECK(2 == ANew::m_new_calls); + BOOST_CHECK(2 == ANew::m_delete_calls); + + return EXIT_SUCCESS; +} + +// EOF diff --git a/deal.II/contrib/boost/libs/serialization/test/test_no_rtti.cpp b/deal.II/contrib/boost/libs/serialization/test/test_no_rtti.cpp new file mode 100644 index 0000000000..99ce1f51e4 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_no_rtti.cpp @@ -0,0 +1,186 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_no_rtti.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) + +// note: this program tests the inter-operability of different +// extended typeinfo systems. In this example, one class is +// identified using the default RTTI while the other uses a custom +// system based on the export key. +// +// As this program uses RTTI for one of the types, the test will fail +// on a system for which RTTI is not enabled or not existent. + +#include +#include +#include + +#include +#include // remove +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::remove; +} +#endif + +#include +#include + +#include + +#include +#include +#include +#include + +#include "test_tools.hpp" +#include +#include BOOST_PP_STRINGIZE(BOOST_ARCHIVE_TEST) + +#include "polymorphic_base.hpp" +#include "polymorphic_derived1.hpp" +#include "polymorphic_derived2.hpp" + +template +void polymorphic_derived2::serialize( + Archive &ar, + const unsigned int /* file_version */ +){ + ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(polymorphic_base); +} + +template void polymorphic_derived2::serialize( + test_oarchive & ar, + const unsigned int version +); +template void polymorphic_derived2::serialize( + test_iarchive & ar, + const unsigned int version +); + +// save derived polymorphic class +void save_derived(const char *testfile) +{ + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os); + + polymorphic_derived1 *rd1 = new polymorphic_derived1; + polymorphic_derived2 *rd2 = new polymorphic_derived2; + + std::cout << "saving polymorphic_derived1 (no_rtti)\n"; + oa << BOOST_SERIALIZATION_NVP(rd1); + + std::cout << "saving polymorphic_derived2\n"; + oa << BOOST_SERIALIZATION_NVP(rd2); + + const polymorphic_base *rb1 = rd1; + polymorphic_base *rb2 = rd2; + std::cout << "saving polymorphic_derived1 (no_rtti) through base (no_rtti)\n"; + oa << BOOST_SERIALIZATION_NVP(rb1); + std::cout << "saving polymorphic_derived2 through base\n"; + oa << BOOST_SERIALIZATION_NVP(rb2); + + delete rd1; + delete rd2; +} + +void load_derived(const char *testfile) +{ + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is); + + polymorphic_derived1 *rd1 = NULL; + polymorphic_derived2 *rd2 = NULL; + + std::cout << "loading polymorphic_derived1 (no_rtti)\n"; + ia >> BOOST_SERIALIZATION_NVP(rd1); + BOOST_CHECK_MESSAGE( + boost::serialization::type_info_implementation< + polymorphic_derived1 + >::type::get_const_instance() + == + * boost::serialization::type_info_implementation< + polymorphic_derived1 + >::type::get_const_instance().get_derived_extended_type_info(*rd1) + , + "restored pointer d1 not of correct type" + ); + + std::cout << "loading polymorphic_derived2\n"; + ia >> BOOST_SERIALIZATION_NVP(rd2); + BOOST_CHECK_MESSAGE( + boost::serialization::type_info_implementation< + polymorphic_derived2 + >::type::get_const_instance() + == + * boost::serialization::type_info_implementation< + polymorphic_derived2 + >::type::get_const_instance().get_derived_extended_type_info(*rd2) + , + "restored pointer d2 not of correct type" + ); + polymorphic_base *rb1 = NULL; + polymorphic_base *rb2 = NULL; + + // the above opereration registers the derived classes as a side + // effect. Hence, instances can now be correctly serialized through + // a base class pointer. + std::cout << "loading polymorphic_derived1 (no_rtti) through base (no_rtti)\n"; + ia >> BOOST_SERIALIZATION_NVP(rb1); + + BOOST_CHECK_MESSAGE( + rb1 == dynamic_cast(rd1), + "serialized pointers not correctly restored" + ); + + BOOST_CHECK_MESSAGE( + boost::serialization::type_info_implementation< + polymorphic_derived1 + >::type::get_const_instance() + == + * boost::serialization::type_info_implementation< + polymorphic_base + >::type::get_const_instance().get_derived_extended_type_info(*rb1) + , + "restored pointer b1 not of correct type" + ); + std::cout << "loading polymorphic_derived2 through base (no_rtti)\n"; + ia >> BOOST_SERIALIZATION_NVP(rb2); + + BOOST_CHECK_MESSAGE( + rb2 == dynamic_cast(rd2), + "serialized pointers not correctly restored" + ); + BOOST_CHECK_MESSAGE( + boost::serialization::type_info_implementation< + polymorphic_derived2 + >::type::get_const_instance() + == + * boost::serialization::type_info_implementation< + polymorphic_base + >::type::get_const_instance().get_derived_extended_type_info(*rb2) + , + "restored pointer b2 not of correct type" + ); + delete rb1; + delete rb2; +} + +int +test_main( int /* argc */, char* /* argv */[] ) +{ + const char * testfile = boost::archive::tmpnam(NULL); + + BOOST_REQUIRE(NULL != testfile); + + save_derived(testfile); + load_derived(testfile); + + std::remove(testfile); + return EXIT_SUCCESS; +} + +// EOF diff --git a/deal.II/contrib/boost/libs/serialization/test/test_non_default_ctor.cpp b/deal.II/contrib/boost/libs/serialization/test/test_non_default_ctor.cpp new file mode 100644 index 0000000000..4c128a67ca --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_non_default_ctor.cpp @@ -0,0 +1,198 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_non_default_ctor.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) + +// should pass compilation and execution + +// this tests: +// a) non-intrusive method of implementing serialization +// b) usage of a non-default constructor + +#include // NULL +#include // remove() +#include +#include // for rand() +#include // for fabs() +#include + +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::rand; + using ::fabs; + using ::remove; +#ifndef UNDER_CE + using ::numeric_limits; +#endif +} +#endif + +#include +#include "test_tools.hpp" + +/////////////////////////////////////////////////////// +// simple class test - using non-intrusive syntax +// illustrates the usage of the non-intrusve syntax +class A +{ + friend class boost::serialization::access; + + // note const values can only be initialized with a non + // non-default constructor + const int i; + + signed char s; + unsigned char t; + signed int u; + unsigned int v; + float w; + double x; + bool operator==(const A & rhs) const; + bool operator<(const A & rhs) const; + + template + void serialize(Archive & ar,const unsigned int /* file_version */){ + ar & BOOST_SERIALIZATION_NVP(s); + ar & BOOST_SERIALIZATION_NVP(t); + ar & BOOST_SERIALIZATION_NVP(u); + ar & BOOST_SERIALIZATION_NVP(v); + ar & BOOST_SERIALIZATION_NVP(w); + ar & BOOST_SERIALIZATION_NVP(x); + } + A(const A & rhs); + A & operator=(const A & rhs); +public: + static int count; + const int & get_i() const { + return i; + } + A(int i_); + ~A(); +}; + +int A::count = 0; + +A::A(int i_) : + i(i_), + s(static_cast(0xff & std::rand())), + t(static_cast(0xff & std::rand())), + u(std::rand()), + v(std::rand()), + w((float)std::rand() / std::rand()), + x((double)std::rand() / std::rand()) +{ + ++count; +} + +A::~A(){ + --count; +} + +bool A::operator==(const A &rhs) const +{ + return + s == rhs.s + && t == rhs.t + && u == rhs.u + && v == rhs.v + && std::fabs(w - rhs.w) <= std::numeric_limits::round_error() + && std::fabs(x - rhs.x) <= std::numeric_limits::round_error() + ; +} + +bool A::operator<(const A &rhs) const +{ + if(! (s == rhs.s) ) + return s < rhs.s; + if(! (t == rhs.t) ) + return t < rhs.t; + if(! (u == rhs.u) ) + return t < rhs.u; + if(! (v == rhs.v) ) + return t < rhs.v; + if(! (std::fabs(w - rhs.w) < std::numeric_limits::round_error() ) ) + return t < rhs.w; + if(! (std::fabs(x - rhs.x) < std::numeric_limits::round_error() ) ) + return t < rhs.x; + return false; +} + +namespace boost { +namespace serialization { + +template +inline void save_construct_data( + Archive & ar, + const A * a, + const BOOST_PFTO unsigned int /* file_version */ +){ + // variable used for construction + ar << boost::serialization::make_nvp("i", a->get_i()); +} + +template +inline void load_construct_data( + Archive & ar, + A * a, + const unsigned int /* file_version */ +){ + int i; + ar >> boost::serialization::make_nvp("i", i); + ::new(a)A(i); +} + +} // serialization +} // namespace boost + +void save(const char * testfile){ + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + A a(2); + + oa << BOOST_SERIALIZATION_NVP(a); + + // save a copy pointer to this item + A *pa1 = &a; + oa << BOOST_SERIALIZATION_NVP(pa1); + + // save pointer to a new object + A *pa2 = new A(4); + oa << BOOST_SERIALIZATION_NVP(pa2); + + delete pa2; +} +void load(const char * testfile){ + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + + A a(4); + ia >> BOOST_SERIALIZATION_NVP(a); + + A *pa1; + ia >> BOOST_SERIALIZATION_NVP(pa1); + BOOST_CHECK_MESSAGE(pa1 == &a, "Copy of pointer not correctly restored"); + + A *pa2; + ia >> BOOST_SERIALIZATION_NVP(pa2); + BOOST_CHECK_MESSAGE(pa2 != &a, "Pointer not correctly restored"); + + delete pa2; +} + +int +test_main( int /* argc */, char* /* argv */[] ) +{ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + save(testfile); + load(testfile); + BOOST_CHECK(0 == A::count); + std::remove(testfile); + return EXIT_SUCCESS; +} + +// EOF diff --git a/deal.II/contrib/boost/libs/serialization/test/test_non_default_ctor2.cpp b/deal.II/contrib/boost/libs/serialization/test/test_non_default_ctor2.cpp new file mode 100644 index 0000000000..ed718382e7 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_non_default_ctor2.cpp @@ -0,0 +1,144 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_non_default_ctor2.cpp + +// (C) Copyright 2002 Martin Ecker. +// 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) + +// should pass compilation and execution + +// this tests complex usage of non-default constructor. Specifically +// the case where a constructor serializes a pointer member. + +#include + +#include + +#include "test_tools.hpp" + +class IntValueHolder +{ +public: + IntValueHolder() + : value(0) + {} + + IntValueHolder(int newvalue) + : value(newvalue) + {} + + int GetValue() const { return value; } + +private: + int value; + + friend class boost::serialization::access; + + template + void serialize(ArchiveT& ar, const unsigned int /* file_version */) + { + ar & BOOST_SERIALIZATION_NVP(value); + } +}; + +class FloatValueHolder +{ +public: + FloatValueHolder() + : value(0) + {} + + FloatValueHolder(float newvalue) + : value(newvalue) + {} + + float GetValue() const { return value; } + +private: + float value; + + friend class boost::serialization::access; + + template + void serialize(ArchiveT& ar, const unsigned int /* file_version */) + { + ar & BOOST_SERIALIZATION_NVP(value); + } +}; + +class A +{ +public: + A(const IntValueHolder& initialValue) + : value(initialValue), floatValue(new FloatValueHolder(10.0f)) + {} + + ~A() + { + delete floatValue; + } + + IntValueHolder value; + FloatValueHolder* floatValue; + +private: + friend class boost::serialization::access; + + template + void serialize(ArchiveT& ar, const unsigned int /* file_version */) + { + ar & BOOST_SERIALIZATION_NVP(floatValue); + } +}; + +namespace boost { +namespace serialization { + +template +void save_construct_data( + ArchiveT& archive, + const A* p, + const BOOST_PFTO unsigned int /*version*/ +){ + archive & boost::serialization::make_nvp("initialValue", p->value); +} + +template +void load_construct_data( + ArchiveT& archive, + A* p, + const unsigned int /*version*/ +){ + IntValueHolder initialValue; + archive & boost::serialization::make_nvp("initialValue", initialValue); + + ::new (p) A(initialValue); +} + +} // serialization +} // namespace boost + +int test_main( int /* argc */, char* /* argv */[] ) +{ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + A* a = new A(5); + + { + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + oa << BOOST_SERIALIZATION_NVP(a); + } + + A* a_new; + + { + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + ia >> BOOST_SERIALIZATION_NVP(a_new); + } + delete a; + delete a_new; + return EXIT_SUCCESS; +} diff --git a/deal.II/contrib/boost/libs/serialization/test/test_non_intrusive.cpp b/deal.II/contrib/boost/libs/serialization/test/test_non_intrusive.cpp new file mode 100644 index 0000000000..250be63a74 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_non_intrusive.cpp @@ -0,0 +1,174 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_non_intrursive.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) + +// should pass compilation and execution + +// this tests: +// a) non-intrusive method of implementing serialization +// b) usage of a non-default constructor + +#include +#include // for rand() +#include // remove +#include // for fabs() +#include + +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::rand; + using ::fabs; + using ::remove; +#ifndef UNDER_CE + using ::numeric_limits; +#endif +} +#endif + +#include +#include "test_tools.hpp" + +/////////////////////////////////////////////////////// +// simple class test - using non-intrusive syntax +// illustrates the usage of the non-intrusve syntax +class A +{ +public: + signed char s; + unsigned char t; + signed int u; + unsigned int v; + float w; + double x; + A(); + bool operator==(const A & rhs) const; + bool operator<(const A & rhs) const; +}; + +A::A() : + s(static_cast(0xff & std::rand())), + t(static_cast(0xff & std::rand())), + u(std::rand()), + v(std::rand()), + w((float)std::rand() / std::rand()), + x((double)std::rand() / std::rand()) +{ +} + +bool A::operator==(const A &rhs) const +{ + return + s == rhs.s + && t == rhs.t + && u == rhs.u + && v == rhs.v + && std::fabs(w - rhs.w) <= std::numeric_limits::round_error() + && std::fabs(x - rhs.x) <= std::numeric_limits::round_error() + ; +} + +bool A::operator<(const A &rhs) const +{ + if(! (s == rhs.s) ) + return s < rhs.s; + if(! (t == rhs.t) ) + return t < rhs.t; + if(! (u == rhs.u) ) + return t < rhs.u; + if(! (v == rhs.v) ) + return t < rhs.v; + if(! (std::fabs(w - rhs.w) < std::numeric_limits::round_error() ) ) + return t < rhs.w; + if(! (std::fabs(x - rhs.x) < std::numeric_limits::round_error() ) ) + return t < rhs.x; + return false; +} + +// note the following: + +// function specializations must be defined in the appropriate +// namespace - boost::serialization +namespace boost { +namespace serialization { + +// This first set of overrides should work with all compilers. + +// The last argument is int while the default versions +// defined in serialization.hpp have long as the last argument. +// This is part of the work around for compilers that don't +// support correct function template ordering. These functions +// are always called with 0 (i.e. an int) as the last argument. +// Our specialized versions also have int as the last argument +// while the default versions have a long as the last argument. +// This makes our specialized versions a better match than the +// default ones as no argument conversion is required to make a match +template +void serialize( + Archive & ar, + A & a, + const unsigned int /* file_version */ +){ + ar & boost::serialization::make_nvp("s", a.s); + ar & boost::serialization::make_nvp("t", a.t); + ar & boost::serialization::make_nvp("u", a.u); + ar & boost::serialization::make_nvp("v", a.v); + ar & boost::serialization::make_nvp("w", a.w); + ar & boost::serialization::make_nvp("x", a.x); +} + +} // serialization +} // namespace boost + +void save(const char * testfile){ + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + A a; + + oa << BOOST_SERIALIZATION_NVP(a); + + // save a copy pointer to this item + A *pa1 = &a; + oa << BOOST_SERIALIZATION_NVP(pa1); + + // save pointer to a new object + A *pa2 = new A(); + oa << BOOST_SERIALIZATION_NVP(pa2); + + delete pa2; +} + +void load(const char * testfile){ + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + + A a; + ia >> BOOST_SERIALIZATION_NVP(a); + + A *pa1; + ia >> BOOST_SERIALIZATION_NVP(pa1); + BOOST_CHECK_MESSAGE(pa1 == &a, "Copy of pointer not correctly restored"); + + A *pa2; + ia >> BOOST_SERIALIZATION_NVP(pa2); + BOOST_CHECK_MESSAGE(pa2 != &a, "Pointer not correctly restored"); + + delete pa2; +} + +int +test_main( int /* argc */, char* /* argv */[] ) +{ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + save(testfile); + load(testfile); + std::remove(testfile); + return EXIT_SUCCESS; +} + +// EOF diff --git a/deal.II/contrib/boost/libs/serialization/test/test_not_serializable.cpp b/deal.II/contrib/boost/libs/serialization/test/test_not_serializable.cpp new file mode 100644 index 0000000000..4833512dda --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_not_serializable.cpp @@ -0,0 +1,47 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_non_serializable.cpp: test implementation level trait + +// (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) + +// test implementation level "not_serializable" +// should fail compilation + +#include + +#include "test_tools.hpp" +#include +#include + +class A +{ +}; + +BOOST_CLASS_IMPLEMENTATION(A, boost::serialization::not_serializable) + +void out(A & a) +{ + test_ostream os("testfile", TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + oa << BOOST_SERIALIZATION_NVP(a); +} + +void in(A & a) +{ + test_istream is("testfile", TEST_STREAM_FLAGS); + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + ia >> BOOST_SERIALIZATION_NVP(a); +} + +int +test_main( int /* argc */, char* /* argv */[] ) +{ + A a; + out(a); + in(a); + return EXIT_SUCCESS; +} + +// EOF diff --git a/deal.II/contrib/boost/libs/serialization/test/test_null_ptr.cpp b/deal.II/contrib/boost/libs/serialization/test/test_null_ptr.cpp new file mode 100644 index 0000000000..e52631a895 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_null_ptr.cpp @@ -0,0 +1,89 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_null_ptr.cpp: test implementation level trait + +// (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) + +// should pass compilation and execution + +#include // NULL +#include // remove +#include + +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::remove; +} +#endif + +#include "test_tools.hpp" +#include + +class polymorphic_base +{ + friend class boost::serialization::access; + template + void serialize(Archive & /* ar */, const unsigned int /* file_version */){ + } +public: + virtual ~polymorphic_base(){}; +}; + +class polymorphic_derived1 : public polymorphic_base +{ + friend class boost::serialization::access; + template + void serialize(Archive &ar, const unsigned int /* file_version */){ + ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(polymorphic_base); + } +}; + +// save unregistered polymorphic classes +void save(const char *testfile) +{ + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + + polymorphic_base *rb1 = NULL; + polymorphic_derived1 *rd1 = NULL; + + oa << BOOST_SERIALIZATION_NVP(rb1); + oa << BOOST_SERIALIZATION_NVP(rd1); +} + +// load unregistered polymorphic classes +void load(const char *testfile) +{ + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + + polymorphic_derived1 dummy; + + polymorphic_base *rb1 = & dummy; + polymorphic_derived1 *rd1 = & dummy; + + ia >> BOOST_SERIALIZATION_NVP(rb1); + BOOST_CHECK_MESSAGE(NULL == rb1, "Null pointer not restored"); + + ia >> BOOST_SERIALIZATION_NVP(rd1); + BOOST_CHECK_MESSAGE(NULL == rd1, "Null pointer not restored"); + + delete rb1; + delete rd1; +} + +int +test_main( int /* argc */, char* /* argv */[] ) +{ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + save(testfile); + load(testfile); + std::remove(testfile); + return EXIT_SUCCESS; +} + +// EOF diff --git a/deal.II/contrib/boost/libs/serialization/test/test_nvp.cpp b/deal.II/contrib/boost/libs/serialization/test/test_nvp.cpp new file mode 100644 index 0000000000..cd546e01d0 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_nvp.cpp @@ -0,0 +1,68 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_nvp.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) + +// should pass compilation and execution + +#include // NULL +#include // remove +#include + +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::remove; +} +#endif + +#include "test_tools.hpp" + +#include + +#include "B.hpp" +#include "A.ipp" + +int +test_main( int /* argc */, char* /* argv */[] ) +{ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + + B b, b1; + + { + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + oa << BOOST_SERIALIZATION_NVP(b); + } + { + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + ia >> BOOST_SERIALIZATION_NVP(b1); + } + BOOST_CHECK(b == b1); + + B *bptr = &b; + B *bptr1; + + { + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + oa << BOOST_SERIALIZATION_NVP(bptr); + } + { + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + ia >> BOOST_SERIALIZATION_NVP(bptr1); + } + BOOST_CHECK(b == *bptr1); + + std::remove(testfile); + return EXIT_SUCCESS; +} + +// EOF diff --git a/deal.II/contrib/boost/libs/serialization/test/test_object.cpp b/deal.II/contrib/boost/libs/serialization/test/test_object.cpp new file mode 100644 index 0000000000..acf44e8c10 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_object.cpp @@ -0,0 +1,70 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_object.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) + +// test implementation level "object_serializable" +// should pass compilation and execution + +#include // NULL +#include // remove +#include + +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::remove; +} +#endif + +#include "test_tools.hpp" + +#include +#include + +class A +{ + friend class boost::serialization::access; + template + void serialize(Archive & /* ar */, const unsigned int /* file_version */){ + } +}; + +BOOST_CLASS_IMPLEMENTATION(A, boost::serialization::object_serializable) + +// note: version can be assigned only to objects whose implementation +// level is object_class_info. So, doing the following will result in +// a static assertion +// BOOST_CLASS_VERSION(A, 2); + +void out(const char *testfile, A & a) +{ + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + oa << BOOST_SERIALIZATION_NVP(a); +} + +void in(const char *testfile, A & a) +{ + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + ia >> BOOST_SERIALIZATION_NVP(a); +} + +int +test_main( int /* argc */, char* /* argv */[] ) +{ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + + A a; + out(testfile, a); + in(testfile, a); + std::remove(testfile); + return EXIT_SUCCESS; +} + +// EOF diff --git a/deal.II/contrib/boost/libs/serialization/test/test_optional.cpp b/deal.II/contrib/boost/libs/serialization/test/test_optional.cpp new file mode 100644 index 0000000000..0beb750dca --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_optional.cpp @@ -0,0 +1,62 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_optional.cpp + +// (C) Copyright 2004 Pavel Vozenilek +// 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) + +// should pass compilation and execution + +#include // NULL +#include // remove +#include + +#include + +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::remove; +} +#endif + + +#include +#include "test_tools.hpp" + +#include + +#include "A.hpp" +#include "A.ipp" + +int test_main( int /* argc */, char* /* argv */[] ) +{ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + + const boost::optional aoptional1; + const boost::optional aoptional2(123); + { + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + oa << boost::serialization::make_nvp("aoptional1",aoptional1); + oa << boost::serialization::make_nvp("aoptional2",aoptional2); + } + + boost::optional aoptional1a(999); + boost::optional aoptional2a; + + { + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + ia >> boost::serialization::make_nvp("aoptional1",aoptional1a); + ia >> boost::serialization::make_nvp("aoptional2",aoptional2a); + } + BOOST_CHECK(aoptional1 == aoptional1a); + BOOST_CHECK(aoptional2 == aoptional2a); + + std::remove(testfile); + return EXIT_SUCCESS; +} + +// EOF diff --git a/deal.II/contrib/boost/libs/serialization/test/test_pimpl.cpp b/deal.II/contrib/boost/libs/serialization/test/test_pimpl.cpp new file mode 100644 index 0000000000..7b4b19624b --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_pimpl.cpp @@ -0,0 +1,48 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_pimpl.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) + +// should pass compilation and execution + +#include // for tmpnam + +#include +#include + +#include "test_tools.hpp" + +class B; + +class A { +^ friend boost::serialization::access; +^ B *pimpl; +^ template +^ void serialize(Archive & ar, const unsigned int file_version); +}; + +int test_main( int argc, char* argv[] ) +{ + char testfile[TMP_MAX]; + std::tmpnam(testfile); +// BOOST_REQUIRE(NULL != testfile); + + A a, a1; + { + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os); + oa << BOOST_SERIALIZATION_NVP(a); + } + { + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is); + BOOST_SERIALIZATION_NVP(a1); + } +// BOOST_CHECK(a != a1); + return 0; +} + +// EOF diff --git a/deal.II/contrib/boost/libs/serialization/test/test_polymorphic.cpp b/deal.II/contrib/boost/libs/serialization/test/test_polymorphic.cpp new file mode 100644 index 0000000000..1e501c6819 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_polymorphic.cpp @@ -0,0 +1,94 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_polymorphic.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) + +// should pass compilation and execution + +#include // NULL +#include // remove +#include + +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::remove; +} +#endif + +// the following is to ensure that when one of the libraries changes +// BJAM rebuilds and relinks the test. +/* +#include "polymorphic_text_archive.hpp" +#include "polymorphic_text_warchive.hpp" +#include "polymorphic_binary_archive.hpp" +#include "polymorphic_xml_archive.hpp" +#include "polymorphic_xml_warchive.hpp" +*/ + +#include "test_tools.hpp" + +#include +#include + +#include +#include "test_polymorphic_A.hpp" + +int test_main(int /* argc */, char * /* argv */ []) +{ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + const data d; + data d1; + // test using using polymorphic interface + { + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa_implementation(os, TEST_ARCHIVE_FLAGS); + boost::archive::polymorphic_oarchive & oa_interface = oa_implementation; + oa_interface << BOOST_SERIALIZATION_NVP(d); + } + { + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia_implementation(is, TEST_ARCHIVE_FLAGS); + boost::archive::polymorphic_iarchive & ia_interface = ia_implementation; + ia_interface >> BOOST_SERIALIZATION_NVP(d1); + } + BOOST_CHECK(d == d1); + std::remove(testfile); + + // test using using polymorphic implementation. + { + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa_implementation(os, TEST_ARCHIVE_FLAGS); + oa_implementation << BOOST_SERIALIZATION_NVP(d); + } + { + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia_implementation(is, TEST_ARCHIVE_FLAGS); + ia_implementation >> BOOST_SERIALIZATION_NVP(d1); + } + BOOST_CHECK(d == d1); + std::remove(testfile); + + // test using using polymorphic implementation. + { + test_ostream os(testfile, TEST_STREAM_FLAGS); + boost::archive::polymorphic_oarchive * oa_implementation + = new test_oarchive(os, TEST_ARCHIVE_FLAGS); + *oa_implementation << BOOST_SERIALIZATION_NVP(d); + delete oa_implementation; + } + { + test_istream is(testfile, TEST_STREAM_FLAGS); + boost::archive::polymorphic_iarchive * ia_implementation + = new test_iarchive(is, TEST_ARCHIVE_FLAGS); + *ia_implementation >> BOOST_SERIALIZATION_NVP(d1); + delete ia_implementation; + } + BOOST_CHECK(d == d1); + std::remove(testfile); + return EXIT_SUCCESS; +} diff --git a/deal.II/contrib/boost/libs/serialization/test/test_polymorphic2.cpp b/deal.II/contrib/boost/libs/serialization/test/test_polymorphic2.cpp new file mode 100644 index 0000000000..52ee308209 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_polymorphic2.cpp @@ -0,0 +1,40 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_polymorphic2.cpp + +// (C) Copyright 2009 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) + +// should pass compilation and execution +#include + +#include "test_tools.hpp" + +#include "test_polymorphic2.hpp" + +int test_main(int /*argc*/, char* /*argv*/[]) +{ + A *a = new B(); + a->i = 3; + + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + { + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa_implementation(os, TEST_ARCHIVE_FLAGS); + boost::archive::polymorphic_oarchive & opa = oa_implementation; + opa << BOOST_SERIALIZATION_NVP(a); + } + A *loaded = 0; + { + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia_implementation(is, TEST_ARCHIVE_FLAGS); + boost::archive::polymorphic_iarchive & ipa = ia_implementation; + ipa >> BOOST_SERIALIZATION_NVP(loaded); + } + BOOST_CHECK(a->i == loaded->i); + delete a; + delete loaded; + return EXIT_SUCCESS; +} diff --git a/deal.II/contrib/boost/libs/serialization/test/test_polymorphic2.hpp b/deal.II/contrib/boost/libs/serialization/test/test_polymorphic2.hpp new file mode 100644 index 0000000000..a2cd4f1213 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_polymorphic2.hpp @@ -0,0 +1,43 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_polymorphic2.hpp + +// (C) Copyright 2009 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) + +// should pass compilation and execution +namespace boost { +namespace archive { + class polymorphic_oarchive; + class polymorphic_iarchive; +} +} + +struct A { +public: + A() {} + virtual ~A() {} + + void serialize( + boost::archive::polymorphic_oarchive &ar, + const unsigned int /*version*/ + ); + void serialize( + boost::archive::polymorphic_iarchive &ar, + const unsigned int /*version*/ + ); + + int i; +}; + +struct B : A { + void serialize( + boost::archive::polymorphic_oarchive &ar, + const unsigned int /*version*/ + ); + void serialize( + boost::archive::polymorphic_iarchive &ar, + const unsigned int /*version*/ + ); +}; diff --git a/deal.II/contrib/boost/libs/serialization/test/test_polymorphic2imp.cpp b/deal.II/contrib/boost/libs/serialization/test/test_polymorphic2imp.cpp new file mode 100644 index 0000000000..e0544e814d --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_polymorphic2imp.cpp @@ -0,0 +1,44 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_polymorphic2imp.cpp + +// (C) Copyright 2009 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) + +// should pass compilation and execution + +#include +#include +#include + +#include "test_polymorphic2.hpp" + +void A::serialize( + boost::archive::polymorphic_oarchive &ar, + const unsigned int /*version*/ +){ + ar & BOOST_SERIALIZATION_NVP(i); +} +void A::serialize( + boost::archive::polymorphic_iarchive &ar, + const unsigned int /*version*/ +){ + ar & BOOST_SERIALIZATION_NVP(i); +} +// note: only the most derived classes need be exported +// BOOST_CLASS_EXPORT(A) + +void B::serialize( + boost::archive::polymorphic_oarchive &ar, + const unsigned int /*version*/ +){ + ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(A); +} +void B::serialize( + boost::archive::polymorphic_iarchive &ar, + const unsigned int /*version*/ +){ + ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(A); +} +BOOST_CLASS_EXPORT(B) diff --git a/deal.II/contrib/boost/libs/serialization/test/test_polymorphic_A.cpp b/deal.II/contrib/boost/libs/serialization/test/test_polymorphic_A.cpp new file mode 100644 index 0000000000..c7c598caac --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_polymorphic_A.cpp @@ -0,0 +1,58 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_polymorphic_A.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) + +#include "test_polymorphic_A.hpp" +#include + +#include "A.hpp" +#include "A.ipp" + +data::data() : + a(new A) +{} +data::~data(){ + delete a; +} + +bool data::operator==(const data & rhs) const { + return * (a) == *(rhs.a); +} + +#if 0 // this method fails with msvc 6.0 and borland +// now we can define the serialization for class A +template +void data::serialize(Archive & ar, const unsigned int /* file_version */){ + ar & BOOST_SERIALIZATION_NVP(a); +} + +// without the explicit instantiations below, the program will +// fail to link for lack of instantiantiation of the above function +// note: the following failed to fix link errors for vc 7.0 ! +#include + +template void data::serialize( + boost::archive::polymorphic_oarchive & ar, + const unsigned int file_version +); + +#include + +template void data::serialize( + boost::archive::polymorphic_iarchive & ar, + const unsigned int file_version +); +#endif + +// so use this +void data::serialize(boost::archive::polymorphic_oarchive & ar, const unsigned int /* file_version */){ + ar & BOOST_SERIALIZATION_NVP(a); +} + +void data::serialize(boost::archive::polymorphic_iarchive & ar, const unsigned int /* file_version */){ + ar & BOOST_SERIALIZATION_NVP(a); +} diff --git a/deal.II/contrib/boost/libs/serialization/test/test_polymorphic_A.hpp b/deal.II/contrib/boost/libs/serialization/test/test_polymorphic_A.hpp new file mode 100644 index 0000000000..306d62616d --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_polymorphic_A.hpp @@ -0,0 +1,30 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_polymorphic_A.hpp + +// (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) + +// class whose declaration is hidden by a pointer +// #include + +#include +#include + +class A; + +struct data { + // class a contains a pointer to a "hidden" declaration + // borland scoped_ptr doesn't work !!! + // boost::scoped_ptr a; + A * a; +// template +// void serialize(Archive & ar, const unsigned int file_version); + void serialize(boost::archive::polymorphic_oarchive & ar, const unsigned int file_version); + void serialize(boost::archive::polymorphic_iarchive & ar, const unsigned int file_version); + data(); + ~data(); + bool operator==(const data & rhs) const; +}; + diff --git a/deal.II/contrib/boost/libs/serialization/test/test_primitive.cpp b/deal.II/contrib/boost/libs/serialization/test/test_primitive.cpp new file mode 100644 index 0000000000..aa94bd4413 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_primitive.cpp @@ -0,0 +1,64 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_primitive.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) + +// test implementation level "primitive_type" + +#include // NULL +#include + +#include "test_tools.hpp" + +#include +#include + +struct A +{ + template + void serialize(Archive &ar, const unsigned int /* file_version */){ + // note: should never fail here + BOOST_STATIC_ASSERT(0 == sizeof(Archive)); + } +}; + +std::ostream & operator<<(std::ostream &os, const A & /* a */){ return os;} +std::istream & operator>>(std::istream &is, A & /* a */){return is;} + +#ifndef BOOST_NO_STD_WSTREAMBUF +std::wostream & operator<<(std::wostream &os, const A & /* a */){ return os;} +std::wistream & operator>>(std::wistream &is, A & /* a */){return is;} +#endif + +BOOST_CLASS_IMPLEMENTATION(A, boost::serialization::primitive_type) + +void out(const char *testfile, A & a) +{ + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + oa << BOOST_SERIALIZATION_NVP(a); +} + +void in(const char *testfile, A & a) +{ + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + ia >> BOOST_SERIALIZATION_NVP(a); +} + +int +test_main( int /* argc */, char* /* argv */[] ) +{ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + + A a; + out(testfile, a); + in(testfile, a); + return EXIT_SUCCESS; +} + +// EOF diff --git a/deal.II/contrib/boost/libs/serialization/test/test_private_base.cpp b/deal.II/contrib/boost/libs/serialization/test/test_private_base.cpp new file mode 100644 index 0000000000..bb552a9b24 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_private_base.cpp @@ -0,0 +1,99 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_private_base.cpp + +// (C) Copyright 2009 Eric Moyer - 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) + +// should pass compilation and execution + +// invoke header for a custom archive test. + +#include +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::remove; +} +#endif + +#include +#include +#include + +#include "test_tools.hpp" + +class Base { + friend class boost::serialization::access; + int m_i; + template + void serialize(Archive & ar, const unsigned int version){ + ar & m_i; + } +protected: + bool operator==(const Base &rhs) const { + return m_i == rhs.m_i; + } + Base(int i = 0) : + m_i(i) + {} + virtual ~Base(); +}; + +class Derived : public Base { + friend class boost::serialization::access; +private: + template + void serialize(Archive & ar, const unsigned int version){ + ar & boost::serialization::base_object(*this); + } +public: + bool operator==(const Derived &rhs) const { + return Base::operator==(rhs); + } + Derived(int i = 0) : + Base(i) + {} +}; + +BOOST_CLASS_EXPORT(Derived) + +int +test_main( int /* argc */, char* /* argv */[] ) +{ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + + Derived a(1), a1(2); + { + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + oa << boost::serialization::make_nvp("a", a); + } + { + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + ia >> boost::serialization::make_nvp("a", a1); + } + BOOST_CHECK_EQUAL(a, a1); + std::remove(testfile); + + Base *ta = new Derived(1); + Base *ta1 = NULL; + + { + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + oa << boost::serialization::make_nvp("ta", ta); + } + { + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + ia >> boost::serialization::make_nvp("ta", ta1); + } + BOOST_CHECK(ta != ta1); + BOOST_CHECK(*static_cast(ta) == *static_cast(ta1)); + std::remove(testfile); + return 0; +} diff --git a/deal.II/contrib/boost/libs/serialization/test/test_private_ctor.cpp b/deal.II/contrib/boost/libs/serialization/test/test_private_ctor.cpp new file mode 100644 index 0000000000..72b3904fcf --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_private_ctor.cpp @@ -0,0 +1,51 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_private_ctor.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) + +#include + +#include "test_tools.hpp" + +#include + +#include +#include + +class V { + friend int test_main(int /* argc */, char * /* argv */[]); + friend class boost::serialization::access; + int m_i; + V() : + m_i(0) + {} + ~V(){} + template + void serialize(Archive& ar, unsigned /*version*/) + { + ar & m_i; + } + bool operator==(const V & v) const { + return m_i == v.m_i; + } +}; + +int test_main(int /* argc */, char * /* argv */[]) +{ + std::stringstream ss; + const V v; + { + boost::archive::text_oarchive oa(ss); + oa << v; + } + V v1; + { + boost::archive::text_iarchive ia(ss); + ia >> v1; + } + BOOST_CHECK(v == v1); + return EXIT_SUCCESS; +} diff --git a/deal.II/contrib/boost/libs/serialization/test/test_recursion.cpp b/deal.II/contrib/boost/libs/serialization/test/test_recursion.cpp new file mode 100644 index 0000000000..a44f293ca1 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_recursion.cpp @@ -0,0 +1,51 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_recurrsion.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) + +// should pass compilation and execution + +#include // NULL +#include // remove +#include + +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::remove; +} +#endif + +#include "test_tools.hpp" + +#include "J.hpp" +#include "A.ipp" + +int test_main( int /* argc */, char* /* argv */[] ) +{ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + + // test recursive structure + J j, j1; + j.j = &j; + + { + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + oa << BOOST_SERIALIZATION_NVP(j); + } + { + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + ia >> BOOST_SERIALIZATION_NVP(j1); + } + BOOST_CHECK(j == j1); + std::remove(testfile); + return EXIT_SUCCESS; +} + +// EOF diff --git a/deal.II/contrib/boost/libs/serialization/test/test_registered.cpp b/deal.II/contrib/boost/libs/serialization/test/test_registered.cpp new file mode 100644 index 0000000000..5a5ccdda15 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_registered.cpp @@ -0,0 +1,239 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_registered.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) + +// should pass compilation and execution + +#include // NULL +#include // remove +#include + +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::remove; +} +#endif + +#include +#include "test_tools.hpp" + +#include +#include + +class polymorphic_base +{ + friend class boost::serialization::access; + template + void serialize(Archive & /* ar */, const unsigned int /* file_version */){ + } +public: + virtual ~polymorphic_base(){}; +}; + +class polymorphic_derived1 : public polymorphic_base +{ + friend class boost::serialization::access; + template + void serialize(Archive &ar, const unsigned int /* file_version */){ + ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(polymorphic_base); + } +}; + +class polymorphic_derived2 : public polymorphic_base +{ + friend class boost::serialization::access; + template + void serialize(Archive &ar, const unsigned int /* file_version */){ + ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(polymorphic_base); + } +}; + +// save derived polymorphic class +void save_derived(const char *testfile) +{ + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + + polymorphic_derived1 *rd1 = new polymorphic_derived1; + polymorphic_derived2 *rd2 = new polymorphic_derived2; + + // registration IS necessary when serializing pointers of + // polymorphic classes + oa.register_type(static_cast(NULL)); + oa.register_type(static_cast(NULL)); + oa << BOOST_SERIALIZATION_NVP(rd1); + oa << BOOST_SERIALIZATION_NVP(rd2); + + // the above opereration registers the derived classes as a side + // effect. Hence, instances can now be correctly serialized through + // a base class pointer. + polymorphic_base *rb1 = rd1; + polymorphic_base *rb2 = rd2; + oa << BOOST_SERIALIZATION_NVP(rb1); + oa << BOOST_SERIALIZATION_NVP(rb2); + + delete rd1; + delete rd2; +} + +// save derived polymorphic class +void load_derived(const char *testfile) +{ + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + + polymorphic_derived1 *rd1 = NULL; + polymorphic_derived2 *rd2 = NULL; + + // registration IS necessary when serializing pointers of + // polymorphic classes + ia.register_type(static_cast(NULL)); + ia.register_type(static_cast(NULL)); + + ia >> BOOST_SERIALIZATION_NVP(rd1); + + const boost::serialization::extended_type_info * p1; + p1 = & boost::serialization::type_info_implementation + ::type::get_const_instance(); + + BOOST_CHECK(NULL != p1); + + const boost::serialization::extended_type_info * p2; + p2 = boost::serialization::type_info_implementation + ::type::get_const_instance().get_derived_extended_type_info(*rd1); + + BOOST_CHECK(NULL != p2); + + BOOST_CHECK_MESSAGE(p1 == p2, "restored pointer d1 not of correct type"); + + ia >> BOOST_SERIALIZATION_NVP(rd2); + + BOOST_CHECK_MESSAGE( + & boost::serialization::type_info_implementation + ::type::get_const_instance() + == + boost::serialization::type_info_implementation + ::type::get_const_instance().get_derived_extended_type_info(*rd2), + "restored pointer d2 not of correct type" + ); + + polymorphic_base *rb1 = NULL; + polymorphic_base *rb2 = NULL; + + // the above opereration registers the derived classes as a side + // effect. Hence, instances can now be correctly serialized through + // a base class pointer. + ia >> BOOST_SERIALIZATION_NVP(rb1); + + BOOST_CHECK_MESSAGE( + rb1 == dynamic_cast(rd1), + "serialized pointers not correctly restored" + ); + + p1 = & boost::serialization::type_info_implementation + ::type::get_const_instance(); + + BOOST_CHECK(NULL != p1); + + p2 = boost::serialization::type_info_implementation + ::type::get_const_instance().get_derived_extended_type_info(*rb1); + + BOOST_CHECK(NULL != p2); + + BOOST_CHECK_MESSAGE(p1 == p2, "restored pointer b1 not of correct type"); + + ia >> BOOST_SERIALIZATION_NVP(rb2); + + BOOST_CHECK_MESSAGE( + rb2 == dynamic_cast(rd2), + "serialized pointers not correctly restored" + ); + + BOOST_CHECK_MESSAGE( + & boost::serialization::type_info_implementation + ::type::get_const_instance() + == boost::serialization::type_info_implementation + ::type::get_const_instance().get_derived_extended_type_info(*rb2), + "restored pointer b2 not of correct type" + ); + + delete rb1; + delete rb2; +} + +// save registered polymorphic class +void save_registered(const char *testfile) +{ + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + + polymorphic_base *rb1 = new polymorphic_derived1; + polymorphic_base *rb2 = new polymorphic_derived2; + + // registration (forward declaration) will permit correct serialization + // through a pointer to a base class + oa.register_type(static_cast(NULL)); + oa.register_type(static_cast(NULL)); + oa << BOOST_SERIALIZATION_NVP(rb1) << BOOST_SERIALIZATION_NVP(rb2); + + delete rb1; + delete rb2; +} + +// save registered polymorphic class +void load_registered(const char *testfile) +{ + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + + polymorphic_base *rb1 = NULL; + polymorphic_base *rb2 = NULL; + + // registration (forward declaration) will permit correct serialization + // through a pointer to a base class + ia.register_type(static_cast(NULL)); + ia.register_type(static_cast(NULL)); + ia >> BOOST_SERIALIZATION_NVP(rb1) >> BOOST_SERIALIZATION_NVP(rb2); + + BOOST_CHECK_MESSAGE( + & boost::serialization::type_info_implementation + ::type::get_const_instance() + == boost::serialization::type_info_implementation + ::type::get_const_instance().get_derived_extended_type_info(*rb1), + "restored pointer b1 not of correct type" + ); + + BOOST_CHECK_MESSAGE( + & boost::serialization::type_info_implementation + ::type::get_const_instance() + == boost::serialization::type_info_implementation + ::type::get_const_instance().get_derived_extended_type_info(*rb2), + "restored pointer b2 not of correct type" + ); + + delete rb1; + delete rb2; +} + +int +test_main( int /* argc */, char* /* argv */[] ) +{ + const char * testfile = boost::archive::tmpnam(NULL); + + BOOST_REQUIRE(NULL != testfile); + + save_derived(testfile); + load_derived(testfile); + save_registered(testfile); + load_registered(testfile); + + std::remove(testfile); + return EXIT_SUCCESS; +} + +// EOF diff --git a/deal.II/contrib/boost/libs/serialization/test/test_reset_object_address.cpp b/deal.II/contrib/boost/libs/serialization/test/test_reset_object_address.cpp new file mode 100644 index 0000000000..b78d52f8bc --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_reset_object_address.cpp @@ -0,0 +1,412 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_reset_object_address.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) + +#include +#include +#include // for rand() +#include // size_t + +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::rand; + using ::size_t; +} +#endif + +#include "test_tools.hpp" + +#include +#include +#include +#include + +#include +#include + +// Someday, maybe all tests will be converted to the unit test framework. +// but for now use the text execution monitor to be consistent with all +// the other tests. + +// simple test of untracked value +#include "A.hpp" +#include "A.ipp" + +void test1(){ + std::stringstream ss; + const A a; + { + boost::archive::text_oarchive oa(ss); + oa << a; + } + A a1; + { + boost::archive::text_iarchive ia(ss); + // load to temporary + A a2; + ia >> a2; + BOOST_CHECK_EQUAL(a, a2); + // move to final destination + a1 = a2; + ia.reset_object_address(& a1, & a2); + } + BOOST_CHECK_EQUAL(a, a1); +} + +// simple test of tracked value +class B { + friend class boost::serialization::access; + int m_i; + template + void serialize(Archive &ar, const unsigned int /*file_version*/){ + ar & m_i; + } +public: + bool operator==(const B & rhs) const { + return m_i == rhs.m_i; + } + B() : + m_i(std::rand()) + {} +}; + +//BOOST_TEST_DONT_PRINT_LOG_VALUE( B ) + +void test2(){ + std::stringstream ss; + B const b; + B const * const b_ptr = & b; + BOOST_CHECK_EQUAL(& b, b_ptr); + { + boost::archive::text_oarchive oa(ss); + oa << b; + oa << b_ptr; + } + B b1; + B * b1_ptr; + { + boost::archive::text_iarchive ia(ss); + // load to temporary + B b2; + ia >> b2; + BOOST_CHECK_EQUAL(b, b2); + // move to final destination + b1 = b2; + ia.reset_object_address(& b1, & b2); + ia >> b1_ptr; + } + BOOST_CHECK_EQUAL(b, b1); + BOOST_CHECK_EQUAL(& b1, b1_ptr); +} + +// check that nested member values are properly moved +class D { + friend class boost::serialization::access; + template + void serialize(Archive &ar, const unsigned int /*file_version*/){ + ar & m_b; + } +public: + B m_b; + bool operator==(const D & rhs) const { + return m_b == rhs.m_b; + } + D(){} +}; + +//BOOST_TEST_DONT_PRINT_LOG_VALUE( D ) + +void test3(){ + std::stringstream ss; + D const d; + B const * const b_ptr = & d.m_b; + { + boost::archive::text_oarchive oa(ss); + oa << d; + oa << b_ptr; + } + D d1; + B * b1_ptr; + { + boost::archive::text_iarchive ia(ss); + D d2; + ia >> d2; + d1 = d2; + ia.reset_object_address(& d1, & d2); + ia >> b1_ptr; + } + BOOST_CHECK_EQUAL(d, d1); + BOOST_CHECK_EQUAL(* b_ptr, * b1_ptr); +} + +// check that data pointed to by pointer members is NOT moved +class E { + int m_i; + friend class boost::serialization::access; + template + void serialize(Archive &ar, const unsigned int /*file_version*/){ + ar & m_i; + } +public: + bool operator==(const E &rhs) const { + return m_i == rhs.m_i; + } + E() : + m_i(std::rand()) + {} + E(const E & rhs) : + m_i(rhs.m_i) + {} +}; +//BOOST_TEST_DONT_PRINT_LOG_VALUE( E ) + +// check that moves don't move stuff pointed to +class F { + friend class boost::serialization::access; + E * m_eptr; + template + void serialize(Archive &ar, const unsigned int /*file_version*/){ + ar & m_eptr; + } +public: + bool operator==(const F &rhs) const { + return *m_eptr == *rhs.m_eptr; + } + F & operator=(const F & rhs) { + * m_eptr = * rhs.m_eptr; + return *this; + } + F(){ + m_eptr = new E; + } + F(const F & rhs){ + *this = rhs; + } + ~F(){ + delete m_eptr; + } +}; + +//BOOST_TEST_DONT_PRINT_LOG_VALUE( F ) + +void test4(){ + std::stringstream ss; + const F f; + { + boost::archive::text_oarchive oa(ss); + oa << f; + } + F f1; + { + boost::archive::text_iarchive ia(ss); + F f2; + ia >> f2; + f1 = f2; + ia.reset_object_address(& f1, & f2); + } + BOOST_CHECK_EQUAL(f, f1); +} + +// check that multiple moves keep track of the correct target +class G { + friend class boost::serialization::access; + A m_a1; + A m_a2; + A *m_pa2; + template + void save(Archive &ar, const unsigned int /*file_version*/) const { + ar << m_a1; + ar << m_a2; + ar << m_pa2; + } + template + void load(Archive &ar, const unsigned int /*file_version*/){ + A a; // temporary A + ar >> a; + m_a1 = a; + ar.reset_object_address(& m_a1, & a); + ar >> a; + m_a2 = a; + ar.reset_object_address(& m_a2, & a); + ar & m_pa2; + } + BOOST_SERIALIZATION_SPLIT_MEMBER() +public: + bool operator==(const G &rhs) const { + return + m_a1 == rhs.m_a1 + && m_a2 == rhs.m_a2 + && *m_pa2 == *rhs.m_pa2; + } + G & operator=(const G & rhs) { + m_a1 = rhs.m_a1; + m_a2 = rhs.m_a2; + m_pa2 = & m_a2; + return *this; + } + G(){ + m_pa2 = & m_a2; + } + G(const G & rhs){ + *this = rhs; + } + ~G(){} +}; + +//BOOST_TEST_DONT_PRINT_LOG_VALUE( G ) + +void test5(){ + std::stringstream ss; + const G g; + { + boost::archive::text_oarchive oa(ss); + oa << g; + } + G g1; + { + boost::archive::text_iarchive ia(ss); + ia >> g1; + } + BOOST_CHECK_EQUAL(g, g1); +} + +// joaquin's test - this tests the case where rest_object_address +// is applied to an item which in fact is not tracked so that +// the call is in fact superfluous. +struct foo +{ + int x; + +private: + friend class boost::serialization::access; + + template + void serialize(Archive &,const unsigned int) + { + } +}; + +struct bar +{ + foo f[2]; + foo* pf[2]; + +private: + friend class boost::serialization::access; + BOOST_SERIALIZATION_SPLIT_MEMBER() + + template + void save(Archive& ar,const unsigned int)const + { + for(int i=0;i<2;++i){ + ar< + void load(Archive& ar,const unsigned int) + { + for(int i=0;i<2;++i){ + int x; + ar>>x; + f[i].x=x; + ar.reset_object_address(&f[i].x,&x); + ar>>f[i]; + } + for(int j=0;j<2;++j){ + ar>>pf[j]; + } + } +}; + +int test6() +{ + bar b; + b.f[0].x=0; + b.f[1].x=1; + b.pf[0]=&b.f[0]; + b.pf[1]=&b.f[1]; + + std::ostringstream oss; + { + boost::archive::text_oarchive oa(oss); + oa<(b); + } + + bar b1; + b1.pf[0]=0; + b1.pf[1]=0; + + std::istringstream iss(oss.str()); + boost::archive::text_iarchive ia(iss); + ia>>b1; + BOOST_CHECK(b1.pf[0]==&b1.f[0]&&b1.pf[1]==&b1.f[1]); + + return 0; +} + +// test one of the collections +void test7(){ + std::stringstream ss; + B const b; + B const * const b_ptr = & b; + BOOST_CHECK_EQUAL(& b, b_ptr); + { + std::list l; + l.push_back(b_ptr); + boost::archive::text_oarchive oa(ss); + oa << const_cast &>(l); + } + B b1; + { + std::list l; + boost::archive::text_iarchive ia(ss); + ia >> l; + delete l.front(); // prevent memory leak + } +} + +// test one of the collections with polymorphic archive +void test8(){ + std::stringstream ss; + B const b; + B const * const b_ptr = & b; + BOOST_CHECK_EQUAL(& b, b_ptr); + { + std::list l; + l.push_back(b_ptr); + boost::archive::polymorphic_text_oarchive oa(ss); + boost::archive::polymorphic_oarchive & poa = oa; + poa << const_cast &>(l); + } + B b1; + { + std::list l; + boost::archive::polymorphic_text_iarchive ia(ss); + boost::archive::polymorphic_iarchive & pia = ia; + pia >> l; + delete l.front(); // prevent memory leak + } +} + +int test_main(int /* argc */, char * /* argv */[]) +{ + test1(); + test2(); + test3(); + test4(); + test5(); + test6(); + test7(); + test8(); + return EXIT_SUCCESS; +} diff --git a/deal.II/contrib/boost/libs/serialization/test/test_set.cpp b/deal.II/contrib/boost/libs/serialization/test/test_set.cpp new file mode 100644 index 0000000000..370d9389d0 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_set.cpp @@ -0,0 +1,176 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_set.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) + +// should pass compilation and execution + +#include // NULLsize_t +#include // remove +#include + +#include +#include + +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::size_t; +} +#endif + +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::remove; +} +#endif + +#include + +#include "test_tools.hpp" + +#include +#include + +#include "A.hpp" +#include "A.ipp" + +void +test_set(){ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + + // test array of objects + std::set aset; + aset.insert(A()); + aset.insert(A()); + { + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + oa << boost::serialization::make_nvp("aset", aset); + } + std::set aset1; + { + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + ia >> boost::serialization::make_nvp("aset", aset1); + } + BOOST_CHECK(aset == aset1); + std::remove(testfile); +} + +void +test_multiset(){ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + + std::multiset amultiset; + amultiset.insert(A()); + amultiset.insert(A()); + { + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + oa << boost::serialization::make_nvp("amultiset", amultiset); + } + std::multiset amultiset1; + { + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + ia >> boost::serialization::make_nvp("amultiset", amultiset1); + } + BOOST_CHECK(amultiset == amultiset1); + std::remove(testfile); +} + +#ifdef BOOST_HAS_HASH + +#include + +namespace BOOST_STD_EXTENSION_NAMESPACE { + template<> + struct hash { + std::size_t operator()(const A& a) const { + return (std::size_t)a; + } + }; +} + +void +test_hash_set(){ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + + // test array of objects + BOOST_STD_EXTENSION_NAMESPACE::hash_set ahash_set; + A a, a1; + ahash_set.insert(a); + ahash_set.insert(a1); + { + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + oa << boost::serialization::make_nvp("ahash_set", ahash_set); + } + BOOST_STD_EXTENSION_NAMESPACE::hash_set ahash_set1; + { + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + ia >> boost::serialization::make_nvp("ahash_set", ahash_set1); + } + std::vector tvec, tvec1; + tvec.clear(); + tvec1.clear(); + std::copy(ahash_set.begin(), ahash_set.end(), std::back_inserter(tvec)); + std::sort(tvec.begin(), tvec.end()); + std::copy(ahash_set1.begin(), ahash_set1.end(), std::back_inserter(tvec1)); + std::sort(tvec1.begin(), tvec1.end()); + BOOST_CHECK(tvec == tvec1); + std::remove(testfile); +} + +void +test_hash_multiset(){ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + + BOOST_STD_EXTENSION_NAMESPACE::hash_multiset ahash_multiset; + ahash_multiset.insert(A()); + ahash_multiset.insert(A()); + { + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + oa << boost::serialization::make_nvp("ahash_multiset", ahash_multiset); + } + BOOST_STD_EXTENSION_NAMESPACE::hash_multiset ahash_multiset1; + { + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + ia >> boost::serialization::make_nvp("ahash_multiset", ahash_multiset1); + } + + std::vector tvec, tvec1; + tvec.clear(); + tvec1.clear(); + std::copy(ahash_multiset.begin(), ahash_multiset.end(), std::back_inserter(tvec)); + std::sort(tvec.begin(), tvec.end()); + std::copy(ahash_multiset1.begin(), ahash_multiset1.end(), std::back_inserter(tvec1)); + std::sort(tvec1.begin(), tvec1.end()); + BOOST_CHECK(tvec == tvec1); + + std::remove(testfile); +} +#endif + +int test_main( int /* argc */, char* /* argv */[] ) +{ + test_set(); + test_multiset(); + #ifdef BOOST_HAS_HASH + test_hash_set(); + test_hash_multiset(); + #endif + return EXIT_SUCCESS; +} diff --git a/deal.II/contrib/boost/libs/serialization/test/test_shared_ptr.cpp b/deal.II/contrib/boost/libs/serialization/test/test_shared_ptr.cpp new file mode 100644 index 0000000000..6d7a102555 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_shared_ptr.cpp @@ -0,0 +1,301 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_shared_ptr.cpp + +// (C) Copyright 2002 Robert Ramey- http://www.rrsd.com - David Tonge . +// 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 // NULL +#include // remove +#include + +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::remove; +} +#endif +#include + +#include +#include +#include +#include + +#include "test_tools.hpp" + +// This is a simple class. It contains a counter of the number +// of objects of this class which have been instantiated. +class A +{ +private: + friend class boost::serialization::access; + int x; + template + void serialize(Archive & ar, const unsigned int /* file_version */){ + ar & BOOST_SERIALIZATION_NVP(x); + } + A(A const & rhs); + A& operator=(A const & rhs); +public: + static int count; + bool operator==(const A & rhs) const { + return x == rhs.x; + } + A(){++count;} // default constructor + virtual ~A(){--count;} // default destructor +}; + +BOOST_SERIALIZATION_SHARED_PTR(A) + +int A::count = 0; + +// B is a subclass of A +class B : public A +{ +private: + friend class boost::serialization::access; + int y; + template + void serialize(Archive & ar, const unsigned int /* file_version */){ + ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(A); + } +public: + static int count; + B() : A() {}; + virtual ~B() {}; +}; + +// B needs to be exported because its serialized via a base class pointer +BOOST_CLASS_EXPORT(B) +BOOST_SERIALIZATION_SHARED_PTR(B) + +// test a non-polymorphic class +class C +{ +private: + friend class boost::serialization::access; + int z; + template + void serialize(Archive & ar, const unsigned int /* file_version */){ + ar & BOOST_SERIALIZATION_NVP(z); + } +public: + static int count; + bool operator==(const C & rhs) const { + return z == rhs.z; + } + C() : + z(++count) // default constructor + {} + virtual ~C(){--count;} // default destructor +}; + +int C::count = 0; + +void save(const char * testfile, const boost::shared_ptr& spa) +{ + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + oa << BOOST_SERIALIZATION_NVP(spa); +} + +void load(const char * testfile, boost::shared_ptr& spa) +{ + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + ia >> BOOST_SERIALIZATION_NVP(spa); +} + +// trivial test +void save_and_load(boost::shared_ptr& spa) +{ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + save(testfile, spa); + boost::shared_ptr spa1; + load(testfile, spa1); + + BOOST_CHECK( + (spa.get() == NULL && spa1.get() == NULL) + || * spa == * spa1 + ); + std::remove(testfile); +} + +void save2( + const char * testfile, + const boost::shared_ptr& first, + const boost::shared_ptr& second +){ + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + oa << BOOST_SERIALIZATION_NVP(first); + oa << BOOST_SERIALIZATION_NVP(second); +} + +void load2( + const char * testfile, + boost::shared_ptr& first, + boost::shared_ptr& second) +{ + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + ia >> BOOST_SERIALIZATION_NVP(first); + ia >> BOOST_SERIALIZATION_NVP(second); +} + +// Run tests by serializing two shared_ptrs into an archive, +// clearing them (deleting the objects) and then reloading the +// objects back from an archive. +void save_and_load2(boost::shared_ptr& first, boost::shared_ptr& second) +{ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + + save2(testfile, first, second); + + // Clear the pointers, thereby destroying the objects they contain + first.reset(); + second.reset(); + + load2(testfile, first, second); + + BOOST_CHECK(first == second); + std::remove(testfile); +} + +void save3( + const char * testfile, + boost::shared_ptr& first, + boost::shared_ptr& second, + boost::weak_ptr& third +){ + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + oa << BOOST_SERIALIZATION_NVP(third); + oa << BOOST_SERIALIZATION_NVP(first); + oa << BOOST_SERIALIZATION_NVP(second); +} + +void load3( + const char * testfile, + boost::shared_ptr& first, + boost::shared_ptr& second, + boost::weak_ptr& third +){ + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + // note that we serialize the weak pointer first + ia >> BOOST_SERIALIZATION_NVP(third); + // inorder to test that a temporarily solitary weak pointer + // correcttly restored. + ia >> BOOST_SERIALIZATION_NVP(first); + ia >> BOOST_SERIALIZATION_NVP(second); +} + +void save_and_load3( + boost::shared_ptr& first, + boost::shared_ptr& second, + boost::weak_ptr& third +){ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + + save3(testfile, first, second, third); + + // Clear the pointers, thereby destroying the objects they contain + first.reset(); + second.reset(); + third.reset(); + + load3(testfile, first, second, third); + + BOOST_CHECK(first == second); + BOOST_CHECK(first == third.lock()); + std::remove(testfile); +} + +void save4(const char * testfile, const boost::shared_ptr& spc) +{ + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + oa << BOOST_SERIALIZATION_NVP(spc); +} + +void load4(const char * testfile, boost::shared_ptr& spc) +{ + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + ia >> BOOST_SERIALIZATION_NVP(spc); +} + +// trivial test +void save_and_load4(boost::shared_ptr& spc) +{ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + save4(testfile, spc); + boost::shared_ptr spc1; + load4(testfile, spc1); + + BOOST_CHECK( + (spc.get() == NULL && spc1.get() == NULL) + || * spc == * spc1 + ); + std::remove(testfile); +} + +// This does the tests +int test_main(int /* argc */, char * /* argv */[]) +{ + { + boost::shared_ptr spa; + // These are our shared_ptrs + spa = boost::shared_ptr(new A); + boost::shared_ptr spa1 = spa; + spa1 = spa; + } + { + // These are our shared_ptrs + boost::shared_ptr spa; + + // trivial test 1 + save_and_load(spa); + + //trivival test 2 + spa = boost::shared_ptr(new A); + save_and_load(spa); + + // Try to save and load pointers to As + spa = boost::shared_ptr(new A); + boost::shared_ptr spa1 = spa; + save_and_load2(spa, spa1); + + // Try to save and load pointers to Bs + spa = boost::shared_ptr(new B); + spa1 = spa; + save_and_load2(spa, spa1); + + // test a weak pointer + spa = boost::shared_ptr(new A); + spa1 = spa; + boost::weak_ptr wp = spa; + save_and_load3(spa, spa1, wp); + + // obj of type B gets destroyed + // as smart_ptr goes out of scope + } + BOOST_CHECK(A::count == 0); + { + // Try to save and load pointers to Cs + boost::shared_ptr spc; + spc = boost::shared_ptr(new C); + save_and_load4(spc); + } + BOOST_CHECK(C::count == 0); + return EXIT_SUCCESS; +} diff --git a/deal.II/contrib/boost/libs/serialization/test/test_shared_ptr_132.cpp b/deal.II/contrib/boost/libs/serialization/test/test_shared_ptr_132.cpp new file mode 100644 index 0000000000..95a6e8fa3b --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_shared_ptr_132.cpp @@ -0,0 +1,234 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_shared_ptr.cpp + +// (C) Copyright 2002 Robert Ramey- http://www.rrsd.com - David Tonge . +// 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 // NULL +#include + +#include // remove +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::remove; +} +#endif + +#include "test_tools.hpp" + +#include +#include +#include +#include + +#include + +#include +#include +#include + +// This is a simple class. It contains a counter of the number +// of objects of this class which have been instantiated. +class A +{ +private: + friend class boost::serialization::access; + int x; + template + void save(Archive & ar, const unsigned int /* file_version */) const { + ar << BOOST_SERIALIZATION_NVP(x); + } + template + void load(Archive & ar, const unsigned int /* file_version */) { + ar >> BOOST_SERIALIZATION_NVP(x); + } + BOOST_SERIALIZATION_SPLIT_MEMBER() +public: + static int count; + bool operator==(const A & rhs) const { + return x == rhs.x; + } + A(){++count;} // default constructor + virtual ~A(){--count;} // default destructor +}; + +BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(A) +BOOST_SERIALIZATION_SHARED_PTR(A) + +// B is a subclass of A +class B : public A +{ +private: + friend class boost::serialization::access; + int y; + template + void save(Archive & ar, const unsigned int /* file_version */ )const { + ar << BOOST_SERIALIZATION_BASE_OBJECT_NVP(A); + } + template + void load(Archive & ar, const unsigned int /* file_version */){ + ar >> BOOST_SERIALIZATION_BASE_OBJECT_NVP(A); + } + BOOST_SERIALIZATION_SPLIT_MEMBER() +public: + static int count; + B() : A() {}; + virtual ~B() {}; +}; + +// B needs to be exported because its serialized via a base class pointer +BOOST_SHARED_POINTER_EXPORT(B) +BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(B) +BOOST_SERIALIZATION_SHARED_PTR(B) + +int A::count = 0; + +template +void save(const char * testfile, const T & spa) +{ + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + oa << BOOST_SERIALIZATION_NVP(spa); +} + +template +void load(const char * testfile, T & spa) +{ + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + ia >> BOOST_SERIALIZATION_NVP(spa); +} + +// trivial test +template +void save_and_load(const T & spa) +{ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + save(testfile, spa); + + // note that we're loading to a current version of shared_ptr + // regardless of the orignal saved type - this tests backward + // archive compatibility + boost::shared_ptr spa1; + load(testfile, spa1); + + BOOST_CHECK( + (spa.get() == NULL && spa1.get() == NULL) + || * spa == * spa1 + ); + std::remove(testfile); +} + +template +void save2( + const char * testfile, + const T & first, + const T & second +){ + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + oa << BOOST_SERIALIZATION_NVP(first); + oa << BOOST_SERIALIZATION_NVP(second); +} + +template +void load2( + const char * testfile, + T & first, + T & second) +{ + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + ia >> BOOST_SERIALIZATION_NVP(first); + ia >> BOOST_SERIALIZATION_NVP(second); +} + +// Run tests by serializing two shared_ptrs into an archive, +// clearing them (deleting the objects) and then reloading the +// objects back from an archive. +template +void save_and_load2(T & first, T & second) +{ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + + save2(testfile, first, second); + + // Clear the pointers, thereby destroying the objects they contain + first.reset(); + second.reset(); + + boost::shared_ptr first1, second1; + load2(testfile, first1, second1); + + BOOST_CHECK(first1 == second1); + std::remove(testfile); +} + +template +void save3( + const char * testfile, + const T & first, + const T & second, + const T & third +){ + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + oa << BOOST_SERIALIZATION_NVP(third); + oa << BOOST_SERIALIZATION_NVP(first); + oa << BOOST_SERIALIZATION_NVP(second); +} + +template +void load3( + const char * testfile, + T & first, + T & second, + T & third +){ + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + // note that we serialize the weak pointer first + ia >> BOOST_SERIALIZATION_NVP(third); + // inorder to test that a temporarily solitary weak pointer + // correcttly restored. + ia >> BOOST_SERIALIZATION_NVP(first); + ia >> BOOST_SERIALIZATION_NVP(second); +} + +// This does the tests +int test_main(int /* argc */, char * /* argv */[]) +{ + // These are our shared_ptrs + boost_132::shared_ptr spa; + + // trivial test 1 + save_and_load(spa); + + //trivial test 2 + spa.reset(); + spa = boost_132::shared_ptr(new A); + save_and_load(spa); + + // Try to save and load pointers to As, to a text archive + spa = boost_132::shared_ptr(new A); + boost_132::shared_ptr spa1 = spa; + save_and_load2(spa, spa1); + + // Try to save and load pointers to Bs, to a text archive + spa = boost_132::shared_ptr(new B); + save_and_load(spa); + + spa1 = spa; + save_and_load2(spa, spa1); + + // obj of type B gets destroyed + // as smart_ptr goes out of scope + return EXIT_SUCCESS; +} diff --git a/deal.II/contrib/boost/libs/serialization/test/test_shared_ptr_multi_base.cpp b/deal.II/contrib/boost/libs/serialization/test/test_shared_ptr_multi_base.cpp new file mode 100644 index 0000000000..21dbd628cb --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_shared_ptr_multi_base.cpp @@ -0,0 +1,271 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_shared_ptr_multi_base.cpp + +// (C) Copyright 2002 Robert Ramey- http://www.rrsd.com and Takatoshi Kondo. +// 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 // NULL +#include // remove +#include + +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::remove; +} +#endif +#include + +#include +#include +#include +#include + +#include "test_tools.hpp" + +struct Base1 { + Base1() {} + Base1(int x) : m_x(1 + x) {} + virtual ~Base1(){ + } + int m_x; + // serialize + friend class boost::serialization::access; + template + void serialize(Archive &ar, const unsigned int /* file_version */) + { + ar & BOOST_SERIALIZATION_NVP(m_x); + } +}; + +struct Base2 { + Base2() {} + Base2(int x) : m_x(2 + x) {} + int m_x; + virtual ~Base2(){ + } + // serialize + friend class boost::serialization::access; + template + void serialize(Archive &ar, const unsigned int /* file_version */) + { + ar & BOOST_SERIALIZATION_NVP(m_x); + } +}; + +struct Base3 { + Base3() {} + Base3(int x) : m_x(3 + x) {} + virtual ~Base3(){ + } + int m_x; + // serialize + friend class boost::serialization::access; + template + void serialize(Archive &ar, const unsigned int /* file_version */) + { + ar & BOOST_SERIALIZATION_NVP(m_x); + } +}; + +// Sub is a subclass of Base1, Base1 and Base3. +struct Sub:public Base1, public Base2, public Base3 { + static int count; + Sub() { + ++count; + } + Sub(int x) : + Base1(x), + Base2(x), + m_x(x) + { + ++count; + } + Sub(const Sub & rhs) : + m_x(rhs.m_x) + { + ++count; + } + virtual ~Sub() { + assert(0 < count); + --count; + } + int m_x; + // serialize + friend class boost::serialization::access; + template + void serialize(Archive &ar, const unsigned int /* file_version */) + { + ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(Base1); + ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(Base2); + ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(Base3); + ar & BOOST_SERIALIZATION_NVP(m_x); + } +}; + +// Sub needs to be exported because its serialized via a base class pointer +BOOST_CLASS_EXPORT(Sub) +BOOST_SERIALIZATION_SHARED_PTR(Sub) + +int Sub::count = 0; + +template +void save2( + const char * testfile, + const FIRST& first, + const SECOND& second +){ + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + oa << BOOST_SERIALIZATION_NVP(first); + oa << BOOST_SERIALIZATION_NVP(second); +} + +template +void load2( + const char * testfile, + FIRST& first, + SECOND& second) +{ + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + ia >> BOOST_SERIALIZATION_NVP(first); + ia >> BOOST_SERIALIZATION_NVP(second); +} + +// Run tests by serializing two shared_ptrs into an archive, +// clearing them (deleting the objects) and then reloading the +// objects back from an archive. + +// Serialization sequence +// First, shared_ptr +// Second, weak_ptr +template +void shared_weak( + boost::shared_ptr& first, + boost::weak_ptr& second +){ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + int firstm = first->m_x; + int secondm = second.lock()->m_x; + save2(testfile, first, second); + + // Clear the pointers, thereby destroying the objects they contain + second.reset(); + first.reset(); + + load2(testfile, first, second); + + // Check data member + BOOST_CHECK(firstm == first->m_x); + BOOST_CHECK(secondm == second.lock()->m_x); + // Check pointer to vtable + BOOST_CHECK(boost::dynamic_pointer_cast(first)); + BOOST_CHECK(boost::dynamic_pointer_cast(second.lock())); + + std::remove(testfile); +} + +// Serialization sequence +// First, weak_ptr +// Second, shared_ptr +template +void weak_shared( + boost::weak_ptr& first, + boost::shared_ptr& second +){ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + int firstm = first.lock()->m_x; + int secondm = second->m_x; + save2(testfile, first, second); + + // Clear the pointers, thereby destroying the objects they contain + first.reset(); + second.reset(); + + load2(testfile, first, second); + + // Check data member + BOOST_CHECK(firstm == first.lock()->m_x); + BOOST_CHECK(secondm == second->m_x); + // Check pointer to vtable + BOOST_CHECK(boost::dynamic_pointer_cast(first.lock())); + BOOST_CHECK(boost::dynamic_pointer_cast(second)); + + std::remove(testfile); +} + +// This does the tests +int test_main(int /* argc */, char * /* argv */[]) +{ + + // Both Sub + boost::shared_ptr tc1_sp(new Sub(10)); + boost::weak_ptr tc1_wp(tc1_sp); + shared_weak(tc1_sp, tc1_wp); + weak_shared(tc1_wp, tc1_sp); + tc1_sp.reset(); + BOOST_CHECK(0 == Sub::count); + + // Sub and Base1 + boost::shared_ptr tc2_sp(new Sub(10)); + boost::weak_ptr tc2_wp(tc2_sp); + shared_weak(tc2_sp, tc2_wp); + weak_shared(tc2_wp, tc2_sp); + tc2_sp.reset(); + BOOST_CHECK(0 == Sub::count); + + // Sub and Base2 + boost::shared_ptr tc3_sp(new Sub(10)); + boost::weak_ptr tc3_wp(tc3_sp); + shared_weak(tc3_sp, tc3_wp); + weak_shared(tc3_wp, tc3_sp); + tc3_sp.reset(); + BOOST_CHECK(0 == Sub::count); + + // Sub and Base3 + boost::shared_ptr tc4_sp(new Sub(10)); + boost::weak_ptr tc4_wp(tc4_sp); + shared_weak(tc4_sp, tc4_wp); + weak_shared(tc4_wp, tc4_sp); + tc4_sp.reset(); + BOOST_CHECK(0 == Sub::count); + + // Base1 and Base2 + boost::shared_ptr tc5_sp_tmp(new Sub(10)); + boost::shared_ptr tc5_sp(tc5_sp_tmp); + boost::weak_ptr tc5_wp(tc5_sp_tmp); + tc5_sp_tmp.reset(); + shared_weak(tc5_sp, tc5_wp); + weak_shared(tc5_wp, tc5_sp); + tc5_sp.reset(); + BOOST_CHECK(0 == Sub::count); + + // Base2 and Base3 + boost::shared_ptr tc6_sp_tmp(new Sub(10)); + boost::shared_ptr tc6_sp(tc6_sp_tmp); + boost::weak_ptr tc6_wp(tc6_sp_tmp); + tc6_sp_tmp.reset(); + shared_weak(tc6_sp, tc6_wp); + weak_shared(tc6_wp, tc6_sp); + tc6_sp.reset(); + BOOST_CHECK(0 == Sub::count); + + // Base3 and Base1 + boost::shared_ptr tc7_sp_tmp(new Sub(10)); + boost::shared_ptr tc7_sp(tc7_sp_tmp); + boost::weak_ptr tc7_wp(tc7_sp_tmp); + tc7_sp_tmp.reset(); + shared_weak(tc7_sp, tc7_wp); + weak_shared(tc7_wp, tc7_sp); + tc7_sp.reset(); + BOOST_CHECK(0 == Sub::count); + + return EXIT_SUCCESS; +} diff --git a/deal.II/contrib/boost/libs/serialization/test/test_simple_class.cpp b/deal.II/contrib/boost/libs/serialization/test/test_simple_class.cpp new file mode 100644 index 0000000000..30a9e699dc --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_simple_class.cpp @@ -0,0 +1,50 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_simple_class.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) + +// should pass compilation and execution + +// invoke header for a custom archive test. + +#include // NULL +#include // remove +#include + +#include + +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::remove; +} +#endif + +#include "test_tools.hpp" + +#include "A.hpp" +#include "A.ipp" + +int +test_main( int /* argc */, char* /* argv */[] ) +{ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + + A a, a1; + { + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + oa << boost::serialization::make_nvp("a", a); + } + { + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + ia >> boost::serialization::make_nvp("a", a1); + } + BOOST_CHECK_EQUAL(a, a1); + std::remove(testfile); + return 0; +} diff --git a/deal.II/contrib/boost/libs/serialization/test/test_simple_class_ptr.cpp b/deal.II/contrib/boost/libs/serialization/test/test_simple_class_ptr.cpp new file mode 100644 index 0000000000..721b32592e --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_simple_class_ptr.cpp @@ -0,0 +1,52 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_simple_class_ptr.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) + +// should pass compilation and execution + +#include // NULL +#include // remove +#include + +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::remove; +} +#endif + +#include "test_tools.hpp" + +#include "A.hpp" +#include "A.ipp" + +int test_main( int /* argc */, char* /* argv */[] ) +{ + const char * testfile = boost::archive::tmpnam(NULL); + + BOOST_REQUIRE(NULL != testfile); + + const A *ta = new A(); + A *ta1 = NULL; + + { + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + oa << boost::serialization::make_nvp("ta", ta); + } + { + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + ia >> boost::serialization::make_nvp("ta", ta1); + } + BOOST_CHECK(ta != ta1); + BOOST_CHECK(*ta == *ta1); + std::remove(testfile); + return EXIT_SUCCESS; +} + +// EOF diff --git a/deal.II/contrib/boost/libs/serialization/test/test_singleton.cpp b/deal.II/contrib/boost/libs/serialization/test/test_singleton.cpp new file mode 100644 index 0000000000..ef0719ba6e --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_singleton.cpp @@ -0,0 +1,35 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_singleton.cpp: test implementation of run-time casting of void pointers + +// (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) +// + +#include "test_tools.hpp" +#include + +class x { +}; + +void +test1(const x & x1, const x & x2){ + BOOST_CHECK(& x1 == & x2); +} + +int +test_main( int /* argc */, char* /* argv */[] ) +{ + const x & x1 = boost::serialization::singleton::get_const_instance(); + const x & x2 = boost::serialization::singleton::get_const_instance(); + + BOOST_CHECK(& x1 == & x2); + + test1( + boost::serialization::singleton::get_const_instance(), + boost::serialization::singleton::get_const_instance() + ); + + return EXIT_SUCCESS; +} diff --git a/deal.II/contrib/boost/libs/serialization/test/test_smart_cast.cpp b/deal.II/contrib/boost/libs/serialization/test/test_smart_cast.cpp new file mode 100644 index 0000000000..12265a0104 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_smart_cast.cpp @@ -0,0 +1,244 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_smart_cast.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) +// + +#include +#include + +#include "test_tools.hpp" +#include + +using namespace boost::serialization; + +class Base1 : public boost::noncopyable +{ + char a; +}; + +class Base2 +{ + int b; +}; + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +class Derived : public Base1, public Base2 +{ + long c; +}; + +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + +BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(Base1) +BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(Base2) +BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(Derived) + +// if compiler doesn't support TPS, the smart_cast syntax doesn't +// work for references. One has to use the smart_cast_reference +// syntax (tested below ) instead. + +void test_static_reference_cast_2(){ + Derived d; + Base1 & b1 = static_cast(d); + Base2 & b2 = static_cast(d); + + Base1 & scb1 = smart_cast(d); + Base2 & scb2 = smart_cast(d); + BOOST_CHECK_EQUAL(& b1, & scb1); + BOOST_CHECK_EQUAL(& b2, & scb2); + + // downcast +// BOOST_CHECK_EQUAL(& d, & (smart_cast(b1))); +// BOOST_CHECK_EQUAL(& d, & (smart_cast(b2))); + + // crosscast pointers fails at compiler time + // BOOST_CHECK_EQUAL(pB2,smart_cast(pB1)); + // though explicit cross cast will always work + BOOST_CHECK_EQUAL(& b2,( + & smart_cast( + smart_cast(b1) + )) + ); +} + +void test_static_reference_cast_1(){ + Derived d; + Base1 & b1 = static_cast(d); + Base2 & b2 = static_cast(d); + + Base1 & scb1 = smart_cast_reference(d); + Base2 & scb2 = smart_cast_reference(d); + BOOST_CHECK_EQUAL(& b1, & scb1); + BOOST_CHECK_EQUAL(& b2, & scb2); + + // downcast + BOOST_CHECK_EQUAL(& d, & (smart_cast_reference(b1))); + BOOST_CHECK_EQUAL(& d, & (smart_cast_reference(b2))); + + // crosscast pointers fails at compiler time + // BOOST_CHECK_EQUAL(pB2,smart_cast(pB1)); + // though explicit cross cast will always work + BOOST_CHECK_EQUAL(& b2,( + & smart_cast_reference( + smart_cast_reference(b1) + )) + ); +} + +void test_static_pointer_cast(){ + // pointers + Derived d; + Derived *pD = & d; + Base1 *pB1 = pD; + Base2 *pB2 = pD; + + // upcast + BOOST_CHECK_EQUAL(pB1, smart_cast(pD)); + BOOST_CHECK_EQUAL(pB2, smart_cast(pD)); + + // downcast + BOOST_CHECK_EQUAL(pD, smart_cast(pB1)); + BOOST_CHECK_EQUAL(pD, smart_cast(pB2)); + + // crosscast pointers fails at compiler time + // BOOST_CHECK_EQUAL(pB2, smart_cast(pB1)); + + // though explicit cross cast will always work + BOOST_CHECK_EQUAL(pB2, + smart_cast( + smart_cast(pB1) + ) + ); +} + +class VBase1 : public boost::noncopyable +{ + char a; +public: + virtual ~VBase1(){}; +}; + +class VBase2 +{ + int b; +public: + virtual ~VBase2(){}; +}; + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + +class VDerived : public VBase1, public VBase2 +{ + long c; +public: + virtual ~VDerived(){}; +}; + +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + +BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(VBase1) +BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(VBase2) +BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(VDerived) + +// see above + +void test_dynamic_reference_cast_2(){ + VDerived d; + VBase1 &b1 = dynamic_cast(d); + VBase2 &b2 = static_cast(d); + + VBase1 & vb1 = smart_cast(d); + BOOST_CHECK_EQUAL(& b1, & vb1); + BOOST_CHECK_EQUAL(& b2, (& smart_cast(d))); + + // downcast + BOOST_CHECK_EQUAL(& d, (& smart_cast(b1))); + BOOST_CHECK_EQUAL(& d, (& smart_cast(b2))); + + // crosscast + BOOST_CHECK_EQUAL(& b2, (& smart_cast(b1))); + + // explicit cross cast should always work + BOOST_CHECK_EQUAL(& b2, ( + & smart_cast( + smart_cast(b1) + )) + ); +} + +void test_dynamic_reference_cast_1(){ + VDerived d; + VBase1 &b1 = dynamic_cast(d); + VBase2 &b2 = static_cast(d); + + VBase1 & vb1 = smart_cast_reference(d); + BOOST_CHECK_EQUAL(& b1, & vb1); + BOOST_CHECK_EQUAL(& b2, (& smart_cast_reference(d))); + + // downcast + BOOST_CHECK_EQUAL(& d, (& smart_cast_reference(b1))); + BOOST_CHECK_EQUAL(& d, (& smart_cast_reference(b2))); + + // crosscast + BOOST_CHECK_EQUAL(& b2, (& smart_cast_reference(b1))); + + // explicit cross cast should always work + BOOST_CHECK_EQUAL(& b2, ( + & smart_cast_reference( + smart_cast_reference(b1) + )) + ); +} + +void test_dynamic_pointer_cast(){ + // pointers + VDerived d; + VDerived *pD = & d; + VBase1 *pB1 = pD; + VBase2 *pB2 = pD; + + // upcast + BOOST_CHECK_EQUAL(pB1, smart_cast(pD)); + BOOST_CHECK_EQUAL(pB2, smart_cast(pD)); + + // downcast + BOOST_CHECK_EQUAL(pD, smart_cast(pB1)); + BOOST_CHECK_EQUAL(pD, smart_cast(pB2)); + + // crosscast pointers fails at compiler time + BOOST_CHECK_EQUAL(pB2, smart_cast(pB1)); + // though explicit cross cast will always work + BOOST_CHECK_EQUAL(pB2, + smart_cast( + smart_cast(pB1) + ) + ); +} + +int +test_main(int /* argc */, char * /* argv */[]) +{ + test_static_reference_cast_2(); + test_static_reference_cast_1(); + test_static_pointer_cast(); + test_dynamic_reference_cast_2(); + test_dynamic_reference_cast_1(); + test_dynamic_pointer_cast(); + + return EXIT_SUCCESS; +} diff --git a/deal.II/contrib/boost/libs/serialization/test/test_split.cpp b/deal.II/contrib/boost/libs/serialization/test/test_split.cpp new file mode 100644 index 0000000000..9801505324 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_split.cpp @@ -0,0 +1,165 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_split.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) + +// should pass compilation and execution + +#include // NULL +#include // remove +#include + +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::remove; +} +#endif + +#include "test_tools.hpp" + +#include +#include + +class A +{ + friend class boost::serialization::access; + template + void save( + Archive & /* ar */, + const unsigned int /* file_version */ + ) const { + ++(const_cast(*this).count); + } + template + void load( + Archive & /* ar */, + const unsigned int /* file_version */ + ){ + --count; + } + BOOST_SERIALIZATION_SPLIT_MEMBER() + int count; +public: + A() : count(0) {} + ~A() { + BOOST_CHECK(0 == count); + } +}; + +class B +{ + friend class boost::serialization::access; + template + void save( + Archive & /* ar */, + const unsigned int /* file_version */ + ) const { + ++(const_cast(*this).count); + } + template + void load( + Archive & /* ar */, + const unsigned int /* file_version */ + ){ + --count; + } + int count; +public: + B() : count(0) {} + ~B() { + BOOST_CHECK(0 == count); + } +}; + +// function specializations must be defined in the appropriate +// namespace - boost::serialization +namespace boost { +namespace serialization { + +template +void serialize( + Archive & ar, + B & b, + const unsigned int file_version +){ + boost::serialization::split_member(ar, b, file_version); +} + +} // serialization +} // namespace boost + +class C +{ +public: + int count; + C() : count(0) {} + ~C() { + BOOST_CHECK(0 == count); + } +}; + +namespace boost { +namespace serialization { + +template +void save( + Archive & /* ar */, + const C & c, + const unsigned int /* file_version */ +){ + ++(const_cast(c).count); +} + +template +void load( + Archive & /* ar */, + C & c, + const unsigned int /* file_version */ +){ + --c.count; +} + +} // serialization +} // namespace boost + +BOOST_SERIALIZATION_SPLIT_FREE(C) + +void out(const char *testfile, A & a, B & b, C & c) +{ + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + oa << BOOST_SERIALIZATION_NVP(a); + oa << BOOST_SERIALIZATION_NVP(b); + oa << BOOST_SERIALIZATION_NVP(c); +} + +void in(const char *testfile, A & a, B & b, C & c) +{ + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + ia >> BOOST_SERIALIZATION_NVP(a); + ia >> BOOST_SERIALIZATION_NVP(b); + ia >> BOOST_SERIALIZATION_NVP(c); +} + +int +test_main( int /* argc */, char* /* argv */[] ) +{ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + + A a; + B b; + C c; + + out(testfile, a, b, c); + in(testfile, a, b, c); + std::remove(testfile); + return EXIT_SUCCESS; +} + +// EOF diff --git a/deal.II/contrib/boost/libs/serialization/test/test_static_warning.cpp b/deal.II/contrib/boost/libs/serialization/test/test_static_warning.cpp new file mode 100644 index 0000000000..642b9cf3aa --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_static_warning.cpp @@ -0,0 +1,63 @@ +// (C) Copyright Jonathan Turkanis 2004. +// Use, modification and distribution are 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 most recent version including documentation. + +// note: this is a compile only test. + +#include // BOOST_STATIC_CONST +#include +#include + +#include + +typedef char a1[2]; +typedef char a2[3]; + +class polymorphic { + virtual ~polymorphic(); +}; + +class non_polymorphic { +}; + +template +int f(){ + BOOST_STATIC_WARNING(T::value); + return 0; +} + +struct A { + BOOST_STATIC_CONSTANT(bool, value = false); +}; + +///////////////////////////////////////////////////////////////////////// +// compilation of this program should show a total of 10 warning messages + +// should show NO warning message +BOOST_STATIC_WARNING(true); + +// the following should show 5 warning message +int x = f(); // Warn +int y = f >(); // Warn. +int z = f >(); + +BOOST_STATIC_WARNING(sizeof(a1) == sizeof(a2)); // Warn. +BOOST_STATIC_WARNING(sizeof(a1) != sizeof(a1)); // Warn. +BOOST_STATIC_WARNING(! boost::is_polymorphic::value); // Warn. +BOOST_STATIC_WARNING(boost::is_polymorphic::value); // Warn. + +int main(int /* argc */, char * /* argv */[]){ + // should show NO warning message + BOOST_STATIC_WARNING(true); + + // the following should show 5 warning message + f(); + BOOST_STATIC_WARNING(sizeof(a1) == sizeof(a2)); // Warn. + BOOST_STATIC_WARNING(sizeof(a1) != sizeof(a1)); // Warn. + BOOST_STATIC_WARNING(! boost::is_polymorphic::value); // Warn. + BOOST_STATIC_WARNING(boost::is_polymorphic::value); // Warn. + return 0; +} diff --git a/deal.II/contrib/boost/libs/serialization/test/test_tools.hpp b/deal.II/contrib/boost/libs/serialization/test/test_tools.hpp new file mode 100644 index 0000000000..bf2656c981 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_tools.hpp @@ -0,0 +1,235 @@ +#ifndef BOOST_SERIALIZATION_TEST_TOOLS_HPP +#define BOOST_SERIALIZATION_TEST_TOOLS_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 +// test_tools.hpp +// +// (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 // remove, tmpnam +#include // size_t +#ifndef BOOST_NO_EXCEPTION_STD_NAMESPACE + #include +#endif +#include +#include + +#if defined(UNDER_CE) + +// Windows CE does not supply the tmpnam function in its CRT. +// Substitute a primitive implementation here. +namespace boost { +namespace archive { + const char * tmpnam(char * buffer){ + static char ibuffer [512]; + if(NULL == buffer) + buffer = ibuffer; + + static unsigned short index = 0; + std::sprintf(buffer, "\\tmpfile%05X.tmp", index++); + return buffer; + } +} // archive +} // boost + +#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) +// win32 has a brain-dead tmpnam implementation. +// which leaves temp files in root directory +// regardless of environmental settings + +#include +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::remove; + using ::strcpy; + using ::strcat; + using ::tmpnam; +} +#endif // defined(BOOST_NO_STDC_NAMESPACE) + +#include +#include + +#if defined(__COMO__) + #define chdir _chdir +#endif + +#if defined(NDEBUG) && defined(__BORLANDC__) + #define STRCPY strcpy +#else + #define STRCPY std::strcpy +#endif + +namespace boost { +namespace archive { + const char * test_filename(const char * dir = NULL, char *fname = NULL){ + static char ibuffer [512]; + std::size_t i; + ibuffer[0] = '\0'; + if(NULL == dir){ + dir = boost::archive::tmpdir(); + } + STRCPY(ibuffer, dir); + std::strcat(ibuffer, "/"); + i = std::strlen(ibuffer); + if(NULL == fname){ + char old_dir[256]; + _getcwd(old_dir, sizeof(old_dir) - 1); + chdir(dir); + std::tmpnam(ibuffer + i); + chdir(old_dir); + } + else{ + std::strcat(ibuffer, fname); + } + return ibuffer; + } + const char * tmpnam(char * buffer){ + const char * name = test_filename(NULL, NULL); + if(NULL != buffer){ + STRCPY(buffer, name); + } + return name; + } +} // archive +} // boost + +#else // defined(_WIN32) || defined(__WIN32__) || defined(WIN32) +#if defined(__hpux) +// (C) Copyright 2006 Boris Gubenko. +// HP-UX has a restriction that for multi-thread applications, (i.e. +// the ones compiled -mt) if argument to tmpnam is a NULL pointer, then, +// citing the tmpnam(3S) manpage, "the operation is not performed and a +// NULL pointer is returned". tempnam does not have this restriction, so, +// let's use tempnam instead. + +#define tmpnam(X) tempnam(NULL,X) + +namespace boost { +namespace archive { + using ::tempnam; +} // archive +} // boost + +#else // defined(__hpux) + +namespace boost { +namespace archive { + using std::tmpnam; +} // archive +} // boost + +#endif // defined(__hpux) +#endif // defined(_WIN32) || defined(__WIN32__) || defined(WIN32) + +//#include +#include + +#define BOOST_CHECK( P ) \ + BOOST_TEST( (P) ) +#define BOOST_REQUIRE( P ) \ + BOOST_TEST( (P) ) +#define BOOST_CHECK_MESSAGE( P, M ) \ + ((P)? (void)0 : ::boost::detail::error_impl( (M) , __FILE__, __LINE__, BOOST_CURRENT_FUNCTION)) +#define BOOST_REQUIRE_MESSAGE( P, M ) \ + BOOST_CHECK_MESSAGE( (P), (M) ) +#define BOOST_CHECK_EQUAL( A , B ) \ + BOOST_TEST( (A) == (B) ) + +namespace boost { namespace detail { +inline void msg_impl(char const * msg, char const * file, int line, char const * function) +{ + std::cerr << file << "(" << line << "): " << msg << " in function '" << function << "'" << std::endl; +} +} } // boost::detail + +#define BOOST_WARN_MESSAGE( P, M ) \ + ((P)? (void)0 : ::boost::detail::msg_impl( (M) , __FILE__, __LINE__, BOOST_CURRENT_FUNCTION)) +#define BOOST_MESSAGE( M ) \ + BOOST_WARN_MESSAGE( true , (M) ) + +#define BOOST_CHECKPOINT( M ) \ + BOOST_WARN_MESSAGE( true , (M) ) + +//#define BOOST_TEST_DONT_PRINT_LOG_VALUE( T ) + +#define BOOST_FAIL( M ) BOOST_REQUIRE_MESSAGE( false, (M) ) +#define EXIT_SUCCESS 0 + +int test_main(int argc, char * argv[]); + +#include + +int +main(int argc, char * argv[]){ + + boost::serialization::singleton_module::lock(); + + BOOST_TRY{ + test_main(argc, argv); + } + #ifndef BOOST_NO_EXCEPTION_STD_NAMESPACE + BOOST_CATCH(const std::exception & e){ + BOOST_ERROR(e.what()); + } + #endif + BOOST_CATCH(...){ + BOOST_ERROR("failed with uncaught exception:"); + } + BOOST_CATCH_END + + boost::serialization::singleton_module::unlock(); + + return boost::report_errors(); +} + +// the following is to ensure that when one of the libraries changes +// BJAM rebuilds and relinks the test. +/* +#include "text_archive.hpp" +#include "text_warchive.hpp" +#include "binary_archive.hpp" +#include "xml_archive.hpp" +#include "xml_warchive.hpp" +*/ + +///////////////////////////////////////////// +// invoke header for a custom archive test. + +///////////////////////////////////////////// +// invoke header for a custom archive test. +#if ! defined(BOOST_ARCHIVE_TEST) +#define BOOST_ARCHIVE_TEST text_archive.hpp +#endif + +#include +#include BOOST_PP_STRINGIZE(BOOST_ARCHIVE_TEST) + +#ifndef TEST_STREAM_FLAGS + #define TEST_STREAM_FLAGS (std::ios_base::openmode)0 +#endif + +#ifndef TEST_ARCHIVE_FLAGS + #define TEST_ARCHIVE_FLAGS 0 +#endif + +#ifndef TEST_DIRECTORY +#define TEST_DIRECTORY +#else +#define __x__ TEST_DIRECTORY +#undef TEST_DIRECTORY +#define TEST_DIRECTORY BOOST_PP_STRINGIZE(__x__) +#endif + +#endif // BOOST_SERIALIZATION_TEST_TOOLS_HPP diff --git a/deal.II/contrib/boost/libs/serialization/test/test_tracking.cpp b/deal.II/contrib/boost/libs/serialization/test/test_tracking.cpp new file mode 100644 index 0000000000..9f4b47c0d3 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_tracking.cpp @@ -0,0 +1,130 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_tracking_save.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) + +// should pass compilation and execution + +#include // NULL +#include + +#include +#include // remove +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::remove; +} +#endif + +#include "test_tools.hpp" +#include +#include + +#define TEST_CLASS(N, TRACKING) \ +class N \ +{ \ + friend class boost::serialization::access; \ + template \ + void serialize(Archive & /* ar */, const unsigned int /* file_version */){ \ + ++count; \ + } \ +public: \ + static unsigned int count; \ +}; \ +unsigned int N::count = 0;\ +BOOST_CLASS_TRACKING(N, TRACKING) + +TEST_CLASS(AN, ::boost::serialization::track_never) +TEST_CLASS(AS, ::boost::serialization::track_selectively) +TEST_CLASS(AA, ::boost::serialization::track_always) + +// test pointers +TEST_CLASS(PAN, ::boost::serialization::track_never) +TEST_CLASS(PAS, ::boost::serialization::track_selectively) +TEST_CLASS(PAA, ::boost::serialization::track_always) + +void out(const char *testfile) +{ + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + // write object twice to check tracking + AN an; + AS as; + AA aa; + oa << BOOST_SERIALIZATION_NVP(an) << BOOST_SERIALIZATION_NVP(an); + BOOST_CHECK(an.count == 2); + oa << BOOST_SERIALIZATION_NVP(as) << BOOST_SERIALIZATION_NVP(as); + BOOST_CHECK(as.count == 2); + oa << BOOST_SERIALIZATION_NVP(aa) << BOOST_SERIALIZATION_NVP(aa); + BOOST_CHECK(aa.count == 1); + + PAN *pan = new PAN; + PAS *pas = new PAS; + PAA *paa = new PAA; + oa << BOOST_SERIALIZATION_NVP(pan) << BOOST_SERIALIZATION_NVP(pan); + BOOST_CHECK(pan->count == 2); + oa << BOOST_SERIALIZATION_NVP(pas) << BOOST_SERIALIZATION_NVP(pas); + BOOST_CHECK(pas->count == 1); + oa << BOOST_SERIALIZATION_NVP(paa) << BOOST_SERIALIZATION_NVP(paa); + BOOST_CHECK(paa->count == 1); + delete pan; + delete pas; + delete paa; +} + +void in(const char *testfile) +{ + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + // read object twice to check tracking + AN an; + AS as; + AA aa; + + AN::count = 0; + AS::count = 0; + AA::count = 0; + + ia >> BOOST_SERIALIZATION_NVP(an) >> BOOST_SERIALIZATION_NVP(an); + BOOST_CHECK(an.count == 2); + ia >> BOOST_SERIALIZATION_NVP(as) >> BOOST_SERIALIZATION_NVP(as); + BOOST_CHECK(as.count == 2); + ia >> BOOST_SERIALIZATION_NVP(aa) >> BOOST_SERIALIZATION_NVP(aa); + BOOST_CHECK(aa.count == 1); + + PAN::count = 0; + PAS::count = 0; + PAA::count = 0; + + PAN *pan = NULL; + PAS *pas = NULL; + PAA *paa = NULL; + ia >> BOOST_SERIALIZATION_NVP(pan); + ia >> BOOST_SERIALIZATION_NVP(pan); + BOOST_CHECK(pan->count == 2); + ia >> BOOST_SERIALIZATION_NVP(pas); + ia >> BOOST_SERIALIZATION_NVP(pas); + BOOST_CHECK(pas->count == 1); + ia >> BOOST_SERIALIZATION_NVP(paa); + ia >> BOOST_SERIALIZATION_NVP(paa); + BOOST_CHECK(paa->count == 1); + delete pan; + delete pas; + delete paa; +} + +int +test_main( int /* argc */, char* /* argv */[] ) +{ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + + out(testfile); + in(testfile); + std::remove(testfile); + return EXIT_SUCCESS; +} + diff --git a/deal.II/contrib/boost/libs/serialization/test/test_traits_fail.cpp b/deal.II/contrib/boost/libs/serialization/test/test_traits_fail.cpp new file mode 100644 index 0000000000..2e37106276 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_traits_fail.cpp @@ -0,0 +1,40 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_traits_fail.cpp: test implementation level trait + +// (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) + +// compile test for traits +#include "test_tools.hpp" +#include +#include + +class A +{ +}; + +BOOST_CLASS_IMPLEMENTATION(A, boost::serialization::not_serializable) +// It can make no sense to assign a version number to a class that +// is not serialized with class information +BOOST_CLASS_VERSION(A, 2) // should fail during compile +// It can make no sense to assign tracking behavior to a class that +// is not serializable. Should fail during compile. +BOOST_CLASS_TRACKING(A, boost::serialization::track_never) + +class B +{ +}; + +BOOST_CLASS_IMPLEMENTATION(B, boost::serialization::object_class_info) +BOOST_CLASS_VERSION(B, 2) +BOOST_CLASS_TRACKING(B, boost::serialization::track_always) + +int +test_main( int /* argc */, char* /* argv */[] ) +{ + return boost::exit_failure; +} + +// EOF diff --git a/deal.II/contrib/boost/libs/serialization/test/test_traits_pass.cpp b/deal.II/contrib/boost/libs/serialization/test/test_traits_pass.cpp new file mode 100644 index 0000000000..2e65003470 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_traits_pass.cpp @@ -0,0 +1,30 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_traits_pass.cpp: test implementation level trait + +// (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) + +// compile test for traits +#include "test_tools.hpp" + +#include +#include +#include + +class B +{ +}; + +BOOST_CLASS_IMPLEMENTATION(B, boost::serialization::object_class_info) +BOOST_CLASS_VERSION(B, 2) +BOOST_CLASS_TRACKING(B, boost::serialization::track_always) + +int +test_main( int argc, char* argv[] ) +{ + return EXIT_SUCCESS; +} + +// EOF diff --git a/deal.II/contrib/boost/libs/serialization/test/test_unregistered.cpp b/deal.II/contrib/boost/libs/serialization/test/test_unregistered.cpp new file mode 100644 index 0000000000..60a2a620ea --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_unregistered.cpp @@ -0,0 +1,245 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_unregistered.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) + +// should pass compilation and execution + +#include + +#include // NULL +#include // remove +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::remove; +} +#endif + +#include "test_tools.hpp" + +#include +#include +#include +#include + +class polymorphic_base +{ + friend class boost::serialization::access; + template + void serialize(Archive & /* ar */, const unsigned int /* file_version */){ + } +public: + virtual ~polymorphic_base(){}; +}; + +class polymorphic_derived1 : public polymorphic_base +{ + friend class boost::serialization::access; + template + void serialize(Archive &ar, const unsigned int /* file_version */){ + ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(polymorphic_base); + } +}; + +class polymorphic_derived2 : public polymorphic_base +{ + friend class boost::serialization::access; + template + void serialize(Archive &ar, const unsigned int /* file_version */){ + ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(polymorphic_base); + } +}; + +// save unregistered polymorphic classes +void save_unregistered1(const char *testfile) +{ + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + + polymorphic_base *rb1 = new polymorphic_derived1; + + // registration IS necessary when serializing a polymorphic class + // through pointer to the base class + bool except = false; + BOOST_TRY { + oa << BOOST_SERIALIZATION_NVP(rb1); + } + BOOST_CATCH(boost::archive::archive_exception aex){ + except = true; + } + BOOST_CATCH_END + BOOST_CHECK_MESSAGE(except, "lack of registration not detected !"); + + delete rb1; +} + +// note: the corresponding save function above will not result in +// valid archive - hence, the following code which attempts to load +// and archive will fail. Leave this as a reminder not to do this +#if 0 +// load unregistered polymorphic classes +void load_unregistered1(const char *testfile) +{ + std::ifstream is(testfile); + boost::archive::iarchive ia(is); + + polymorphic_base *rb1(NULL); + + // registration IS necessary when serializing a polymorphic class + // through pointer to the base class + bool except = false; + BOOST_TRY { + ia >> BOOST_SERIALIZATION_NVP(rb1); + } + BOOST_CATCH(boost::archive::archive_exception aex){ + except = true; + BOOST_CHECK_MESSAGE( + NULL == rb1, + "failed load resulted in a non-null pointer" + ); + } + BOOST_CATCH_END + BOOST_CHECK_MESSAGE(except, "lack of registration not detected !"); + + delete rb1; +} +#endif + +// save unregistered polymorphic classes +void save_unregistered2(const char *testfile) +{ + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + + polymorphic_derived1 *rd1 = new polymorphic_derived1; + + // registration is NOT necessary when serializing a polymorphic class + // through pointer to a derived class + bool except = false; + BOOST_TRY { + oa << BOOST_SERIALIZATION_NVP(rd1); + } + BOOST_CATCH(boost::archive::archive_exception aex){ + except = true; + } + BOOST_CATCH_END + BOOST_CHECK_MESSAGE(! except, "registration not detected !"); + + delete rd1; +} + +// note: the corresponding save function above will not result in +// valid archive - hence, the following code which attempts to load +// and archive will fail. Leave this as a reminder not to do this +// load unregistered polymorphic classes +void load_unregistered2(const char *testfile) +{ + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + + polymorphic_derived1 *rd1 = NULL; + + // registration is NOT necessary when serializing a polymorphic class + // or through pointer to a derived class + bool except = false; + BOOST_TRY { + ia >> BOOST_SERIALIZATION_NVP(rd1); + } + BOOST_CATCH(boost::archive::archive_exception aex){ + except = true; + BOOST_CHECK_MESSAGE( + NULL == rd1, + "failed load resulted in a non-null pointer" + ); + } + BOOST_CATCH_END + BOOST_CHECK_MESSAGE(! except, "registration not detected !"); + + delete rd1; +} + +// save registered polymorphic class +void save_registered(const char *testfile) +{ + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + + polymorphic_base *rb1 = new polymorphic_derived1; + polymorphic_base *rb2 = new polymorphic_derived2; + + // registration (forward declaration) will permit correct serialization + // through a pointer to a base class + oa.register_type(static_cast(NULL)); + oa.register_type(static_cast(NULL)); + oa << BOOST_SERIALIZATION_NVP(rb1); + oa << BOOST_SERIALIZATION_NVP(rb2); + + delete rb1; + delete rb2; +} + +// load registered polymorphic class +void load_registered(const char *testfile) +{ + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + + polymorphic_base *rb1 = NULL; + polymorphic_base *rb2 = NULL; + + // registration (forward declaration) will permit correct serialization + // through a pointer to a base class + ia.register_type(static_cast(NULL)); + ia.register_type(static_cast(NULL)); + + ia >> BOOST_SERIALIZATION_NVP(rb1); + + BOOST_CHECK_MESSAGE(NULL != rb1, "Load resulted in NULL pointer"); + BOOST_CHECK_MESSAGE( + boost::serialization::type_info_implementation< + polymorphic_derived1 + >::type::get_const_instance() + == + * boost::serialization::type_info_implementation< + polymorphic_base + >::type::get_const_instance().get_derived_extended_type_info(*rb1), + "restored pointer b1 not of correct type" + ); + + ia >> BOOST_SERIALIZATION_NVP(rb2); + BOOST_CHECK_MESSAGE(NULL != rb2, "Load resulted in NULL pointer"); + BOOST_CHECK_MESSAGE( + boost::serialization::type_info_implementation< + polymorphic_derived2 + >::type::get_const_instance() + == + * boost::serialization::type_info_implementation< + polymorphic_base + >::type::get_const_instance().get_derived_extended_type_info(*rb2), + "restored pointer b2 not of correct type" + ); + + delete rb1; + delete rb2; +} + +int +test_main( int /* argc */, char* /* argv */[] ) +{ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + save_unregistered1(testfile); +// load_unregistered1(testfile); + save_unregistered2(testfile); + load_unregistered2(testfile); + save_registered(testfile); + load_registered(testfile); + std::remove(testfile); + return EXIT_SUCCESS; +} + +// EOF diff --git a/deal.II/contrib/boost/libs/serialization/test/test_utf8_codecvt.cpp b/deal.II/contrib/boost/libs/serialization/test/test_utf8_codecvt.cpp new file mode 100644 index 0000000000..fe2b1f81e3 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_utf8_codecvt.cpp @@ -0,0 +1,260 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_utf8_codecvt.cpp + +// (C) Copyright 2002-4 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) + +#include +#include +#include +#include +#include +#include +#include + +#include // size_t +#include +#include + +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::size_t; + using ::wcslen; +#ifndef UNDER_CE + using ::w_int; +#endif +} // namespace std +#endif + +// Note: copied from boost/iostreams/char_traits.hpp +// +// Dinkumware that comes with QNX Momentics 6.3.0, 4.0.2, incorrectly defines +// the EOF and WEOF macros to not std:: qualify the wint_t type (and so does +// Sun C++ 5.8 + STLport 4). Fix by placing the def in this scope. +// NOTE: Use BOOST_WORKAROUND? +#if (defined(__QNX__) && defined(BOOST_DINKUMWARE_STDLIB)) \ + || defined(__SUNPRO_CC) +using ::std::wint_t; +#endif + +#include "test_tools.hpp" +#include +#include + +#include +#include + +template +struct test_data +{ + static unsigned char utf8_encoding[]; + static wchar_t wchar_encoding[]; +}; + +template<> +unsigned char test_data<2>::utf8_encoding[] = { + 0x01, + 0x7f, + 0xc2, 0x80, + 0xdf, 0xbf, + 0xe0, 0xa0, 0x80, + 0xe7, 0xbf, 0xbf +}; + +template<> +wchar_t test_data<2>::wchar_encoding[] = { + 0x0001, + 0x007f, + 0x0080, + 0x07ff, + 0x0800, + 0x7fff +}; + +template<> +unsigned char test_data<4>::utf8_encoding[] = { + 0x01, + 0x7f, + 0xc2, 0x80, + 0xdf, 0xbf, + 0xe0, 0xa0, 0x80, + 0xef, 0xbf, 0xbf, + 0xf0, 0x90, 0x80, 0x80, + 0xf4, 0x8f, 0xbf, 0xbf, + 0xf7, 0xbf, 0xbf, 0xbf, + 0xf8, 0x88, 0x80, 0x80, 0x80, + 0xfb, 0xbf, 0xbf, 0xbf, 0xbf, + 0xfc, 0x84, 0x80, 0x80, 0x80, 0x80, + 0xfd, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf +}; + +template<> +wchar_t test_data<4>::wchar_encoding[] = { + 0x00000001, + 0x0000007f, + 0x00000080, + 0x000007ff, + 0x00000800, + 0x0000ffff, + 0x00010000, + 0x0010ffff, + 0x001fffff, + 0x00200000, + 0x03ffffff, + 0x04000000, + 0x7fffffff +}; + +int +test_main(int /* argc */, char * /* argv */[]) { + std::locale old_loc; + std::locale * utf8_locale + = boost::archive::add_facet( + old_loc, + new boost::archive::detail::utf8_codecvt_facet + ); + + typedef char utf8_t; + typedef test_data td; + + // Send our test UTF-8 data to file + { + std::ofstream ofs; + ofs.open("test.dat", std::ios::binary); + std::copy( + td::utf8_encoding, + #if ! defined(__BORLANDC__) + // borland 5.60 complains about this + td::utf8_encoding + sizeof(td::utf8_encoding) / sizeof(unsigned char), + #else + // so use this instead + td::utf8_encoding + 12, + #endif + boost::archive::iterators::ostream_iterator(ofs) + ); + } + + // Read the test data back in, converting to UCS-4 on the way in + std::vector from_file; + { + std::wifstream ifs; + ifs.imbue(*utf8_locale); + ifs.open("test.dat"); + + wchar_t item = 0; + // note can't use normal vector from iterator constructor because + // dinkumware doesn't have it. + for(;;){ + item = ifs.get(); + if(item == WEOF) + break; + //ifs >> item; + //if(ifs.eof()) + // break; + from_file.push_back(item); + } + } + + // compare the data read back in with the orginal + #if ! defined(__BORLANDC__) + // borland 5.60 complains about this + BOOST_CHECK(from_file.size() == sizeof(td::wchar_encoding)/sizeof(wchar_t)); + #else + // so use this instead + BOOST_CHECK(from_file.size() == 6); + #endif + + BOOST_CHECK(std::equal(from_file.begin(), from_file.end(), td::wchar_encoding)); + + // Send the UCS4_data back out, converting to UTF-8 + { + std::wofstream ofs; + ofs.imbue(*utf8_locale); + ofs.open("test2.dat"); + std::copy( + from_file.begin(), + from_file.end(), + boost::archive::iterators::ostream_iterator(ofs) + ); + } + + // Make sure that both files are the same + { + typedef boost::archive::iterators::istream_iterator is_iter; + is_iter end_iter; + + std::ifstream ifs1("test.dat"); + is_iter it1(ifs1); + std::vector data1; + std::copy(it1, end_iter, std::back_inserter(data1)); + + std::ifstream ifs2("test2.dat"); + is_iter it2(ifs2); + std::vector data2; + std::copy(it2, end_iter, std::back_inserter(data2)); + + BOOST_CHECK(data1 == data2); + } + + // some libraries have trouble that only shows up with longer strings + + wchar_t * test3_data = L"\ + \ + \ + \ + \ + 1\ + 96953204\ + 177129195\ + 1\ + 5627\ + 23010\ + 7419\ +

    16212

    \ + 4086\ + 2749\ + -33\ + 124\ + 28\ + 32225\ + 17543\ + 0.84431422\ + 1.0170664757130923\ + tjbx\ + cuwjentqpkejp\ +
    \ + \ + "; + + // Send the UCS4_data back out, converting to UTF-8 + std::size_t l = std::wcslen(test3_data); + { + std::wofstream ofs; + ofs.imbue(*utf8_locale); + ofs.open("test3.dat"); + std::copy( + test3_data, + test3_data + l, + boost::archive::iterators::ostream_iterator(ofs) + ); + } + + // Make sure that both files are the same + { + std::wifstream ifs; + ifs.imbue(*utf8_locale); + ifs.open("test3.dat"); + BOOST_CHECK( + std::equal( + test3_data, + test3_data + l, + boost::archive::iterators::istream_iterator(ifs) + ) + ); + } + + delete utf8_locale; + return EXIT_SUCCESS; +} diff --git a/deal.II/contrib/boost/libs/serialization/test/test_valarray.cpp b/deal.II/contrib/boost/libs/serialization/test/test_valarray.cpp new file mode 100644 index 0000000000..391f59f572 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_valarray.cpp @@ -0,0 +1,56 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_valarrray.cpp + +// (C) Copyright 2005 Matthias Troyer . +// 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) + +// should pass compilation and execution + +#include // NULL +#include + +#include // remove +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::remove; +} +#endif + +#include "test_tools.hpp" + +#include + +int test_main( int /* argc */, char* /* argv */[] ) +{ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + + // test array of objects + std::valarray avalarray(2); + avalarray[0] = 42; + avalarray[1] = -42; + { + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + oa << boost::serialization::make_nvp("avalarray", avalarray); + } + std::valarray avalarray1; + { + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + ia >> boost::serialization::make_nvp("avalarray", avalarray1); + } + bool equal = ( avalarray.size() == avalarray1.size() + && avalarray[0] == avalarray1[0] + && avalarray[1] == avalarray1[1] + ); + + BOOST_CHECK(equal); + std::remove(testfile); + return EXIT_SUCCESS; +} + +// EOF diff --git a/deal.II/contrib/boost/libs/serialization/test/test_variant.cpp b/deal.II/contrib/boost/libs/serialization/test/test_variant.cpp new file mode 100644 index 0000000000..f18986dcd8 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_variant.cpp @@ -0,0 +1,169 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_variant.cpp +// test of non-intrusive serialization of variant types +// +// copyright (c) 2005 +// troy d. straszheim +// http://www.resophonic.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. +// +// thanks to Robert Ramey and Peter Dimov. +// + +#include // NULL +#include // remove +#include +#include // for fabs() +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::remove; +} +#endif + +#include +#include +#include +#include + +#if defined(_MSC_VER) && (_MSC_VER <= 1020) +# pragma warning (disable : 4786) // too long name, harmless warning +#endif + +#include "test_tools.hpp" + +#include + +#include +#include + +#include "A.hpp" +#include "A.ipp" + +class are_equal + : public boost::static_visitor +{ +public: + // note extra rigamorole for compilers which don't support + // partial function template ordering - specfically msvc 6.x + struct same { + template + static bool invoke(const T & t, const U & u){ + return t == u; + } + }; + + struct not_same { + template + static bool invoke(const T &, const U &){ + return false; + } + }; + + template + bool operator()( const T & t, const U & u) const + { + typedef BOOST_DEDUCED_TYPENAME boost::mpl::eval_if, + boost::mpl::identity, + boost::mpl::identity + >::type type; + return type::invoke(t, u); + } + + bool operator()( const float & lhs, const float & rhs ) const + { + return std::fabs(lhs- rhs) < std::numeric_limits::round_error(); + } + bool operator()( const double & lhs, const double & rhs ) const + { + return std::fabs(lhs - rhs) < std::numeric_limits::round_error(); + } +}; + +template +void test_type(const T& gets_written){ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(testfile != NULL); + { + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + oa << boost::serialization::make_nvp("written", gets_written); + } + + T got_read; + { + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + ia >> boost::serialization::make_nvp("written", got_read); + } + BOOST_CHECK(boost::apply_visitor(are_equal(), gets_written, got_read)); + + std::remove(testfile); +} + +// this verifies that if you try to read in a variant from a file +// whose "which" is illegal for the one in memory (that is, you're +// reading in to a different variant than you wrote out to) the load() +// operation will throw. One could concievably add checking for +// sequence length as well, but this would add size to the archive for +// dubious benefit. +// +void do_bad_read() +{ + // Compiling this test invokes and ICE on msvc 6 + // So, we'll just to skip it for this compiler + #if defined(_MSC_VER) && (_MSC_VER <= 1020) + boost::variant big_variant; + big_variant = std::string("adrenochrome"); + + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(testfile != NULL); + { + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + oa << BOOST_SERIALIZATION_NVP(big_variant); + } + boost::variant little_variant; + { + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + bool exception_invoked = false; + BOOST_TRY { + ia >> BOOST_SERIALIZATION_NVP(little_variant); + } BOOST_CATCH (boost::archive::archive_exception e) { + BOOST_CHECK(boost::archive::archive_exception::unsupported_version == e.code); + exception_invoked = true; + } + BOOST_CATCH_END + BOOST_CHECK(exception_invoked); + } + #endif +} + +int test_main( int /* argc */, char* /* argv */[] ) +{ + { + boost::variant v; + v = false; + test_type(v); + v = 1; + test_type(v); + v = (float) 2.3; + test_type(v); + v = (double) 6.4; + test_type(v); + v = std::string("we can't stop here, this is Bat Country"); + test_type(v); + v = A(); + test_type(v); + } + do_bad_read(); + return EXIT_SUCCESS; +} + +// EOF diff --git a/deal.II/contrib/boost/libs/serialization/test/test_vector.cpp b/deal.II/contrib/boost/libs/serialization/test/test_vector.cpp new file mode 100644 index 0000000000..59cd9d275f --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_vector.cpp @@ -0,0 +1,67 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_vector.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) + +// should pass compilation and execution + +#include // NULL +#include + +#include // remove +#include +#if defined(BOOST_NO_STDC_NAMESPACE) +namespace std{ + using ::remove; +} +#endif + +#include "test_tools.hpp" + +#include + +#include "A.hpp" +#include "A.ipp" + +template +int test_vector(T) +{ + const char * testfile = boost::archive::tmpnam(NULL); + BOOST_REQUIRE(NULL != testfile); + + // test array of objects + std::vector avector; + avector.push_back(T()); + avector.push_back(T()); + { + test_ostream os(testfile, TEST_STREAM_FLAGS); + test_oarchive oa(os, TEST_ARCHIVE_FLAGS); + oa << boost::serialization::make_nvp("avector", avector); + } + std::vector avector1; + { + test_istream is(testfile, TEST_STREAM_FLAGS); + test_iarchive ia(is, TEST_ARCHIVE_FLAGS); + ia >> boost::serialization::make_nvp("avector", avector1); + } + BOOST_CHECK(avector == avector1); + std::remove(testfile); + return EXIT_SUCCESS; +} + +int test_main( int /* argc */, char* /* argv */[] ) +{ + int res = test_vector(A()); + // test an int vector for which optimized versions should be available + if (res == EXIT_SUCCESS) + res = test_vector(0); + // test a bool vector + if (res == EXIT_SUCCESS) + res = test_vector(false); + return res; +} + +// EOF diff --git a/deal.II/contrib/boost/libs/serialization/test/test_void_cast.cpp b/deal.II/contrib/boost/libs/serialization/test/test_void_cast.cpp new file mode 100644 index 0000000000..cb692969c6 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/test_void_cast.cpp @@ -0,0 +1,165 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// test_void_cast.cpp: test implementation of run-time casting of void pointers + +// (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) +// + +#include // NULL +#include "test_tools.hpp" +#include +#include +#include + +class Base1 +{ + char a; +}; + +class Base2 +{ + int b; +}; + +class Derived : public Base1, public Base2 +{ + long c; +}; + +class MostDerived : public Derived +{ + char d[32]; +}; + +template +const boost::serialization::extended_type_info & eti(){ + return boost::serialization::singleton< + boost::serialization::extended_type_info_typeid + >::get_const_instance(); +} + +int +test_main( int /* argc */, char* /* argv */[] ) +{ + MostDerived md; + MostDerived* pmd =& md; + Derived* pd = static_cast(pmd); + + Base2* pb2 = static_cast(pmd); + Base1* pb1 = static_cast(pd); + + void* vpmd = static_cast(pmd); + void* vpb1 = static_cast(pb1); + void* vpb2 = static_cast(pb2); + void* vpd = static_cast(pd); + + // simple casts only requiring table lookup + BOOST_CHECK(vpd == boost::serialization::void_downcast( + eti(), + eti(), + vpb1 + )); + BOOST_CHECK(vpb1 == boost::serialization::void_upcast( + eti(), + eti(), + vpd + )); + BOOST_CHECK(vpd == boost::serialization::void_downcast( + eti(), + eti(), + vpb2 + )); + BOOST_CHECK(vpb2 == boost::serialization::void_upcast( + eti(), + eti(), + vpd + )); + BOOST_CHECK(vpmd == boost::serialization::void_downcast( + eti(), + eti(), + vpd + )); + BOOST_CHECK(vpd == boost::serialization::void_upcast( + eti(), + eti(), + vpmd + )); + // note relationship between MostDerived and Base1 is automatically derived + BOOST_CHECK(vpmd == boost::serialization::void_downcast( + eti(), + eti(), + vpb1 + )); + BOOST_CHECK(vpb1 == boost::serialization::void_upcast( + eti(), + eti(), + vpmd + )); + + // note relationship between MostDerived and Base2 is automatically derived + BOOST_CHECK(vpmd == boost::serialization::void_downcast( + eti(), + eti(), + vpb2 + )); + BOOST_CHECK(vpb2 == boost::serialization::void_upcast( + eti(), + eti(), + vpmd + )); + + // note: currently derivations are not optimised. See void_cast.cpp + // for and explanation. These should still work though. + + // need to double check to validate speed up optimization of derivations + BOOST_CHECK(vpmd == boost::serialization::void_downcast( + eti(), + eti(), + vpb1 + )); + BOOST_CHECK(vpb1 == boost::serialization::void_upcast( + eti(), + eti(), + vpmd + )); + BOOST_CHECK(vpmd == boost::serialization::void_downcast( + eti(), + eti(), + vpb2 + )); + BOOST_CHECK(vpb2 == boost::serialization::void_upcast( + eti(), + eti(), + vpmd + )); + + // check things that should fail + BOOST_CHECK(NULL == boost::serialization::void_downcast( + eti(), + eti(), + vpb1 + )); + + // note that a fundamental feature is that derived/base pairs are created + // at compiler time so that all are registered before the main program starts + // so leave the registration here at the end to verify this. Note bogus arguments + // to workaround msvc 6 bug + boost::serialization::void_cast_register( + static_cast(NULL), + static_cast(NULL) + ); + boost::serialization::void_cast_register( + static_cast(NULL), + static_cast(NULL) + ); + boost::serialization::void_cast_register( + static_cast(NULL), + static_cast(NULL) + ); + + return EXIT_SUCCESS; +} + +// EOF diff --git a/deal.II/contrib/boost/libs/serialization/test/text_archive.hpp b/deal.II/contrib/boost/libs/serialization/test/text_archive.hpp new file mode 100644 index 0000000000..65425ce5a1 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/text_archive.hpp @@ -0,0 +1,13 @@ +// (C) Copyright 2002-4 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. +// text_archive +#include +typedef boost::archive::text_oarchive test_oarchive; +typedef std::ofstream test_ostream; +#include +typedef boost::archive::text_iarchive test_iarchive; +typedef std::ifstream test_istream; diff --git a/deal.II/contrib/boost/libs/serialization/test/text_warchive.hpp b/deal.II/contrib/boost/libs/serialization/test/text_warchive.hpp new file mode 100644 index 0000000000..8f77bf2ddf --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/text_warchive.hpp @@ -0,0 +1,13 @@ +// (C) Copyright 2002-4 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. +// text_warchive +#include +typedef boost::archive::text_woarchive test_oarchive; +typedef std::wofstream test_ostream; +#include +typedef boost::archive::text_wiarchive test_iarchive; +typedef std::wifstream test_istream; diff --git a/deal.II/contrib/boost/libs/serialization/test/xml_archive.hpp b/deal.II/contrib/boost/libs/serialization/test/xml_archive.hpp new file mode 100644 index 0000000000..c7ca3433d5 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/xml_archive.hpp @@ -0,0 +1,13 @@ +// (C) Copyright 2002-4 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. +// xml_archive +#include +typedef boost::archive::xml_oarchive test_oarchive; +typedef std::ofstream test_ostream; +#include +typedef boost::archive::xml_iarchive test_iarchive; +typedef std::ifstream test_istream; diff --git a/deal.II/contrib/boost/libs/serialization/test/xml_warchive.hpp b/deal.II/contrib/boost/libs/serialization/test/xml_warchive.hpp new file mode 100644 index 0000000000..22e4dba66b --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/test/xml_warchive.hpp @@ -0,0 +1,13 @@ +// (C) Copyright 2002-4 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. +// xml_warchive +#include +typedef boost::archive::xml_woarchive test_oarchive; +typedef std::wofstream test_ostream; +#include +typedef boost::archive::xml_wiarchive test_iarchive; +typedef std::wifstream test_istream; diff --git a/deal.II/contrib/boost/libs/serialization/util/test.jam b/deal.II/contrib/boost/libs/serialization/util/test.jam new file mode 100644 index 0000000000..24b2aedf2e --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/util/test.jam @@ -0,0 +1,188 @@ +# Boost serialization Library utility test Jamfile + +# (C) Copyright Robert Ramey 2002-2004. +# Use, modification, and distribution are 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) +# + +# the file contains Jam rules which are used in both the normal +# boost test, as well as the performance test and comprehensive +# tests. + +BOOST_ARCHIVE_LIST = [ modules.peek : BOOST_ARCHIVE_LIST ] ; + +# these are used to shorten testing while in development. It permits +# testing to be applied to just a particular type of archive +if ! $(BOOST_ARCHIVE_LIST) { + BOOST_ARCHIVE_LIST = + "text_archive.hpp" + "text_warchive.hpp" + "binary_archive.hpp" + "xml_archive.hpp" + "xml_warchive.hpp" + ; + # enable the tests which don't depend on a particular archive + BOOST_SERIALIZATION_TEST = true ; +} + +rule run-template ( test-name : sources * : requirements * ) { + return [ + run + $(sources) + : # command + : # input files + : # requirements + # toolset warnings + # gcc:"-Wno-non-virtual-dtor -Wno-ctor-dtor-privacy" + borland:"-w-8080 -w-8071 -w-8057 -w-8062 -w-8008 -w-0018 -w-8066" + gcc:all # ? + gcc:"-Wno-long-long" + msvc:all # == /W4 + msvc:_SCL_SECURE_NO_WARNINGS + msvc:_SCL_SECURE_NO_DEPRECATE + msvc:_CRT_SECURE_NO_WARNINGS + msvc:_CRT_SECURE_NO_DEPRECATE + msvc:"-wd4996" + # toolset optimizations + gcc:"-ftemplate-depth-255" + msvc:"-Gy" + $(requirements) + : # test name + $(test-name) + ] ; +} + +# Given a name of test, return the 'save' test that must be run +# before the named test, or empty string if there's no such test. +rule dependency-save-test ( test ) +{ + local m = [ MATCH (.*)load(.*) : $(test) ] ; + if $(m) + { + return $(m[1])save$(m[2]) ; + } +} + +# each of the following tests is run with each type of archive +rule run-invoke ( test-name : sources * : requirements * ) +{ + local save-test = [ dependency-save-test $(test-name) ] ; + + local tests ; + tests += [ + run-template $(test-name) + : # sources + $(sources) + ../build//boost_serialization + : # requirements + $(requirements) + BOOST_LIB_DIAGNOSTIC=1 + $(save-test) + ] ; + return $(tests) ; +} + +# each of the following tests is run with each type of archive +rule run-winvoke ( test-name : sources * : requirements * ) +{ + local save-test = [ dependency-save-test $(test-name) ] ; + + local tests ; + tests += [ + run-template $(test-name) + : # sources + $(sources) + ../build//boost_serialization + ../build//boost_wserialization + : # requirements + $(requirements) + BOOST_LIB_DIAGNOSTIC=1 + # both stlport and msvc6 define iswspace + msvc,stlport:"-force:multiple" + $(save-test) + ../../config/test/all//BOOST_NO_STD_WSTREAMBUF + ] ; + return $(tests) ; +} + +# for tests which don't use library code - usually just headers +rule test-bsl-run-no-lib ( test-name : sources * : requirements * ) +{ + local tests ; + tests += [ + run-template $(test-name) + : # sources + $(test-name).cpp $(sources).cpp + : + $(requirements) + ] ; + return $(tests) ; +} + +# for tests which are run just once rather than for every archive +rule test-bsl-run ( test-name : sources * : libs * : requirements * ) +{ + local tests ; + tests += [ + run-invoke $(test-name) + : # sources + $(test-name).cpp $(sources).cpp $(libs) + : + $(requirements) + ] ; + return $(tests) ; +} + +rule test-bsl-run_archive ( test-name : archive-name : sources * : libs * : requirements * ) { + local tests ; + switch $(archive-name) { + case "*_warchive" : + tests += [ + run-winvoke $(test-name)_$(archive-name) + : + $(sources).cpp $(libs) + : + BOOST_ARCHIVE_TEST=$(archive-name).hpp + $(requirements) + ] ; + case "*" : + tests += [ + run-invoke $(test-name)_$(archive-name) + : + $(sources).cpp $(libs) + : + BOOST_ARCHIVE_TEST=$(archive-name).hpp + $(requirements) + ] ; + } + return $(tests) ; +} + +rule test-bsl-run_files ( test-name : sources * : libs * : requirements * ) { + local tests ; + for local defn in $(BOOST_ARCHIVE_LIST) { + tests += [ + test-bsl-run_archive $(test-name) + : $(defn:LB) + : $(test-name) $(sources) + : $(libs) + : $(requirements) + ] ; + } + return $(tests) ; +} + +rule test-bsl-run_polymorphic_archive ( test-name : sources * ) { + local tests ; + for local defn in $(BOOST_ARCHIVE_LIST) { + tests += [ + test-bsl-run_archive $(test-name) + : polymorphic_$(defn:LB) + : $(test-name) $(sources) + ] ; + } + return $(tests) ; +} + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/BoostSerializationLibrary.sln b/deal.II/contrib/boost/libs/serialization/vc7ide/BoostSerializationLibrary.sln new file mode 100644 index 0000000000..d572b319a7 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/BoostSerializationLibrary.sln @@ -0,0 +1,1354 @@ +Microsoft Visual Studio Solution File, Format Version 8.00 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_map", "test_map.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_mi", "test_mi.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_multiple_ptrs", "test_multiple_ptrs.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_no_rtti", "test_no_rtti.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_non_default_ctor", "test_non_default_ctor.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_non_default_ctor2", "test_non_default_ctor2.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_non_intrusive", "test_non_intrusive.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_null_ptr", "test_null_ptr.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_nvp", "test_nvp.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_object", "test_object.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_optional", "test_optional.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_polymorphic", "test_polymorphic.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_primitive", "test_primitive.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_private_ctor", "test_private_ctor.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_recursion", "test_recursion.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_registered", "test_registered.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_set", "test_set.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_shared_ptr", "test_shared_ptr.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_simple_class_ptr", "test_simple_class_ptr.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_split", "test_split.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_static_warning", "test_static_warning.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_tracking", "test_tracking.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_traits_fail", "test_traits_fail.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_traits_pass", "test_traits_pass.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_unregistered", "test_unregistered.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_utf8_codecvt", "test_utf8_codecvt.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_vector", "test_vector.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_void_cast", "test_void_cast.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "demo_auto_ptr", "demo_auto_ptr.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "demo_exception", "demo_exception.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "demo_pimpl", "demo_pimpl.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "demo_polymorphic", "demo_polymorphic.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "demo_shared_ptr", "demo_shared_ptr.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "demo_xml", "demo_xml.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "demo_xml_load", "demo_xml_load.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "demo_xml_save", "demo_xml_save.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_not_serializable", "test_not_serializable.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_variant", "test_variant.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_derived", "test_derived.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_const_pass", "test_const_pass.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_derived_class", "test_derived_class.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_const_warn", "test_const_fail.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_shared_ptr_132", "test_shared_ptr_132.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_inclusion", "test_inclusion.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_reset_object_address", "test_reset_object_addr.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_strong_typedef", "test_strong_typedef.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LibraryW", "LibraryW.vcproj", "{30E10563-960A-11D7-9FE9-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_valarray", "test_valarray.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "demo_dll", "demo_dll.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dll_a", "dll_a.vcproj", "{CED1BD64-563F-485D-AE69-668797013AA0}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_dll_exported", "test_dll_exported.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_dll_simple", "test_dll_simple.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_dll_plugin", "test_dll_plugin.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_complex", "test_complex.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_simple_class", "test_simple_class.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_new_operator", "test_new_operator.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_bitset", "test_bitset.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_private_base", "test_private_base.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_shared_ptr_multi_base", "test_shared_ptr_multi_base.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_array", "test_array.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dll_base", "dll_base.vcproj", "{CED1BD64-563F-485D-AE69-668797013AA0}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dll_derived2", "dll_derived2.vcproj", "{CED1BD64-563F-485D-AE69-668797013AA0}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dll_polymorphic_derived2", "polymorphic_derived2.vcproj", "{CED1BD64-563F-485D-AE69-668797013AA0}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_multiple_inheritance", "test_multiple_inheritance.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_check", "test_check.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_polymorphic2", "test_polymorphic2.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_const", "test_const.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Library", "Library.vcproj", "{30E10563-960A-11D7-9FE9-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "demo_portable_archive", "demo_portable_archive.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "demo_log", "demo_log.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "demo_simple_log", "demo_simple_log.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "demo_trivial_archive", "demo_trivial_archive.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_exported", "test_exported.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "demo", "demo.vcproj", "{A7D4CC95-F2AC-11D6-9E47-525400E2CF85}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfiguration) = preSolution + Debug = Debug + Debug runtime-dynamic = Debug runtime-dynamic + Debug runtime-static = Debug runtime-static + Debug runtime-static threading-multi = Debug runtime-static threading-multi + Release = Release + Release runtime-dynamic = Release runtime-dynamic + Release runtime-static = Release runtime-static + EndGlobalSection + GlobalSection(ProjectConfiguration) = postSolution + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {30E10563-960A-11D7-9FE9-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static|Win32 + {30E10563-960A-11D7-9FE9-525400E2CF85}.Debug.Build.0 = Debug runtime-static|Win32 + {30E10563-960A-11D7-9FE9-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {30E10563-960A-11D7-9FE9-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {30E10563-960A-11D7-9FE9-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {30E10563-960A-11D7-9FE9-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {30E10563-960A-11D7-9FE9-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static|Win32 + {30E10563-960A-11D7-9FE9-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static|Win32 + {30E10563-960A-11D7-9FE9-525400E2CF85}.Release.ActiveCfg = Release runtime-static|Win32 + {30E10563-960A-11D7-9FE9-525400E2CF85}.Release.Build.0 = Release runtime-static|Win32 + {30E10563-960A-11D7-9FE9-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {30E10563-960A-11D7-9FE9-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {30E10563-960A-11D7-9FE9-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static|Win32 + {30E10563-960A-11D7-9FE9-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {CED1BD64-563F-485D-AE69-668797013AA0}.Debug.ActiveCfg = Debug runtime-static|Win32 + {CED1BD64-563F-485D-AE69-668797013AA0}.Debug.Build.0 = Debug runtime-static|Win32 + {CED1BD64-563F-485D-AE69-668797013AA0}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {CED1BD64-563F-485D-AE69-668797013AA0}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {CED1BD64-563F-485D-AE69-668797013AA0}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {CED1BD64-563F-485D-AE69-668797013AA0}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {CED1BD64-563F-485D-AE69-668797013AA0}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static|Win32 + {CED1BD64-563F-485D-AE69-668797013AA0}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static|Win32 + {CED1BD64-563F-485D-AE69-668797013AA0}.Release.ActiveCfg = Release|Win32 + {CED1BD64-563F-485D-AE69-668797013AA0}.Release.Build.0 = Release|Win32 + {CED1BD64-563F-485D-AE69-668797013AA0}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {CED1BD64-563F-485D-AE69-668797013AA0}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {CED1BD64-563F-485D-AE69-668797013AA0}.Release runtime-static.ActiveCfg = Release runtime-dynamic|Win32 + {CED1BD64-563F-485D-AE69-668797013AA0}.Release runtime-static.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {CED1BD64-563F-485D-AE69-668797013AA0}.Debug.ActiveCfg = Debug runtime-static|Win32 + {CED1BD64-563F-485D-AE69-668797013AA0}.Debug.Build.0 = Debug runtime-static|Win32 + {CED1BD64-563F-485D-AE69-668797013AA0}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {CED1BD64-563F-485D-AE69-668797013AA0}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {CED1BD64-563F-485D-AE69-668797013AA0}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {CED1BD64-563F-485D-AE69-668797013AA0}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {CED1BD64-563F-485D-AE69-668797013AA0}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static|Win32 + {CED1BD64-563F-485D-AE69-668797013AA0}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static|Win32 + {CED1BD64-563F-485D-AE69-668797013AA0}.Release.ActiveCfg = Release|Win32 + {CED1BD64-563F-485D-AE69-668797013AA0}.Release.Build.0 = Release|Win32 + {CED1BD64-563F-485D-AE69-668797013AA0}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {CED1BD64-563F-485D-AE69-668797013AA0}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {CED1BD64-563F-485D-AE69-668797013AA0}.Release runtime-static.ActiveCfg = Release runtime-dynamic|Win32 + {CED1BD64-563F-485D-AE69-668797013AA0}.Release runtime-static.Build.0 = Release runtime-dynamic|Win32 + {CED1BD64-563F-485D-AE69-668797013AA0}.Debug.ActiveCfg = Debug runtime-static|Win32 + {CED1BD64-563F-485D-AE69-668797013AA0}.Debug.Build.0 = Debug runtime-static|Win32 + {CED1BD64-563F-485D-AE69-668797013AA0}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {CED1BD64-563F-485D-AE69-668797013AA0}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {CED1BD64-563F-485D-AE69-668797013AA0}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {CED1BD64-563F-485D-AE69-668797013AA0}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {CED1BD64-563F-485D-AE69-668797013AA0}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static|Win32 + {CED1BD64-563F-485D-AE69-668797013AA0}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static|Win32 + {CED1BD64-563F-485D-AE69-668797013AA0}.Release.ActiveCfg = Release|Win32 + {CED1BD64-563F-485D-AE69-668797013AA0}.Release.Build.0 = Release|Win32 + {CED1BD64-563F-485D-AE69-668797013AA0}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {CED1BD64-563F-485D-AE69-668797013AA0}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {CED1BD64-563F-485D-AE69-668797013AA0}.Release runtime-static.ActiveCfg = Release runtime-dynamic|Win32 + {CED1BD64-563F-485D-AE69-668797013AA0}.Release runtime-static.Build.0 = Release runtime-dynamic|Win32 + {CED1BD64-563F-485D-AE69-668797013AA0}.Debug.ActiveCfg = Debug runtime-static|Win32 + {CED1BD64-563F-485D-AE69-668797013AA0}.Debug.Build.0 = Debug runtime-static|Win32 + {CED1BD64-563F-485D-AE69-668797013AA0}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {CED1BD64-563F-485D-AE69-668797013AA0}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {CED1BD64-563F-485D-AE69-668797013AA0}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {CED1BD64-563F-485D-AE69-668797013AA0}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {CED1BD64-563F-485D-AE69-668797013AA0}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static|Win32 + {CED1BD64-563F-485D-AE69-668797013AA0}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static|Win32 + {CED1BD64-563F-485D-AE69-668797013AA0}.Release.ActiveCfg = Release|Win32 + {CED1BD64-563F-485D-AE69-668797013AA0}.Release.Build.0 = Release|Win32 + {CED1BD64-563F-485D-AE69-668797013AA0}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {CED1BD64-563F-485D-AE69-668797013AA0}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {CED1BD64-563F-485D-AE69-668797013AA0}.Release runtime-static.ActiveCfg = Release runtime-dynamic|Win32 + {CED1BD64-563F-485D-AE69-668797013AA0}.Release runtime-static.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {30E10563-960A-11D7-9FE9-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static|Win32 + {30E10563-960A-11D7-9FE9-525400E2CF85}.Debug.Build.0 = Debug runtime-static|Win32 + {30E10563-960A-11D7-9FE9-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {30E10563-960A-11D7-9FE9-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {30E10563-960A-11D7-9FE9-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {30E10563-960A-11D7-9FE9-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {30E10563-960A-11D7-9FE9-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static|Win32 + {30E10563-960A-11D7-9FE9-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static|Win32 + {30E10563-960A-11D7-9FE9-525400E2CF85}.Release.ActiveCfg = Release runtime-static|Win32 + {30E10563-960A-11D7-9FE9-525400E2CF85}.Release.Build.0 = Release runtime-static|Win32 + {30E10563-960A-11D7-9FE9-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {30E10563-960A-11D7-9FE9-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {30E10563-960A-11D7-9FE9-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static|Win32 + {30E10563-960A-11D7-9FE9-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.ActiveCfg = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-dynamic.Build.0 = Debug runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.ActiveCfg = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static.Build.0 = Debug runtime-static|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.ActiveCfg = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Debug runtime-static threading-multi.Build.0 = Debug runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release.Build.0 = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.ActiveCfg = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-dynamic.Build.0 = Release runtime-dynamic|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.ActiveCfg = Release runtime-static threading-multi|Win32 + {A7D4CC95-F2AC-11D6-9E47-525400E2CF85}.Release runtime-static.Build.0 = Release runtime-static threading-multi|Win32 + EndGlobalSection + GlobalSection(SolutionItems) = postSolution + ..\test\Jamfile.v2 = ..\test\Jamfile.v2 + ..\util\test.jam = ..\util\test.jam + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + EndGlobalSection + GlobalSection(ExtensibilityAddIns) = postSolution + EndGlobalSection +EndGlobal diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/Library.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/Library.vcproj new file mode 100644 index 0000000000..7fbb62902e --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/Library.vcproj @@ -0,0 +1,833 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/LibraryW.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/LibraryW.vcproj new file mode 100644 index 0000000000..61914327ec --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/LibraryW.vcproj @@ -0,0 +1,573 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/Manual.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/Manual.vcproj new file mode 100644 index 0000000000..ed4f8c1443 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/Manual.vcproj @@ -0,0 +1,260 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/demo.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/demo.vcproj new file mode 100644 index 0000000000..7a5ca8be66 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/demo.vcproj @@ -0,0 +1,193 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/demo_auto_ptr.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/demo_auto_ptr.vcproj new file mode 100644 index 0000000000..628cbd741b --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/demo_auto_ptr.vcproj @@ -0,0 +1,193 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/demo_dll.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/demo_dll.vcproj new file mode 100644 index 0000000000..87d32c3333 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/demo_dll.vcproj @@ -0,0 +1,213 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/demo_exception.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/demo_exception.vcproj new file mode 100644 index 0000000000..c81732be27 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/demo_exception.vcproj @@ -0,0 +1,193 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/demo_fast_archive.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/demo_fast_archive.vcproj new file mode 100644 index 0000000000..4ff22a18a3 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/demo_fast_archive.vcproj @@ -0,0 +1,193 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/demo_log.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/demo_log.vcproj new file mode 100644 index 0000000000..b5120e4236 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/demo_log.vcproj @@ -0,0 +1,201 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/demo_pimpl.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/demo_pimpl.vcproj new file mode 100644 index 0000000000..cc6a90cda6 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/demo_pimpl.vcproj @@ -0,0 +1,199 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/demo_polymorphic.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/demo_polymorphic.vcproj new file mode 100644 index 0000000000..5ed6375876 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/demo_polymorphic.vcproj @@ -0,0 +1,199 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/demo_portable_archive.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/demo_portable_archive.vcproj new file mode 100644 index 0000000000..16811c0c90 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/demo_portable_archive.vcproj @@ -0,0 +1,215 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/demo_shared_ptr.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/demo_shared_ptr.vcproj new file mode 100644 index 0000000000..d7f6543bea --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/demo_shared_ptr.vcproj @@ -0,0 +1,193 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/demo_simple_log.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/demo_simple_log.vcproj new file mode 100644 index 0000000000..0925e61447 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/demo_simple_log.vcproj @@ -0,0 +1,199 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/demo_trivial_archive.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/demo_trivial_archive.vcproj new file mode 100644 index 0000000000..4d3c38a9e8 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/demo_trivial_archive.vcproj @@ -0,0 +1,196 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/demo_xml.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/demo_xml.vcproj new file mode 100644 index 0000000000..3163c4e626 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/demo_xml.vcproj @@ -0,0 +1,196 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/demo_xml_load.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/demo_xml_load.vcproj new file mode 100644 index 0000000000..65d2b2a850 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/demo_xml_load.vcproj @@ -0,0 +1,196 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/demo_xml_save.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/demo_xml_save.vcproj new file mode 100644 index 0000000000..880fd1ec2c --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/demo_xml_save.vcproj @@ -0,0 +1,196 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/dll_a.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/dll_a.vcproj new file mode 100644 index 0000000000..292e88d2bb --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/dll_a.vcproj @@ -0,0 +1,215 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/dll_base.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/dll_base.vcproj new file mode 100644 index 0000000000..95aa977100 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/dll_base.vcproj @@ -0,0 +1,306 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/dll_derived2.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/dll_derived2.vcproj new file mode 100644 index 0000000000..a2e40ce096 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/dll_derived2.vcproj @@ -0,0 +1,266 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/polymorphic_derived2.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/polymorphic_derived2.vcproj new file mode 100644 index 0000000000..5c925bb549 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/polymorphic_derived2.vcproj @@ -0,0 +1,267 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/readme.txt b/deal.II/contrib/boost/libs/serialization/vc7ide/readme.txt new file mode 100644 index 0000000000..f47ffdac81 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/readme.txt @@ -0,0 +1,29 @@ +Notes on vc 7.1 ide project files +================================= + +These project files use the directory structure created by the Boost Build system. +This means that BJAM has to have been run at least once for the directories to +be created in the expected places. Once this has been done, one should be able +to rebuild/rerun any demo or test from within the VC 7 IDE. + +There are a large number of project configurations. There is one for each permitted +boost configuration. E.G. Debug runtime-dynamic, Debug runtime-static threading-mulit, +etc. which correspond to boost build configurations. + +For tests which are designed to be run with different types of archives, the number +of project configurations is mulitplied by 5 - one for each type archive. For example, for +Debug runtime-static there exists Debug runtime-static text_archive, +Debug runtime-static text_warchive, ... Debug runtime-static xml_warchive. + +By selecting the appropriate configuration it should be possible to replicate the +behavior of the failed test from withing the IDE. This is helpful in debugging. + +After each test is built, it is run and the ouput is shown in the IDE Output window. + +Note that the fact that all configurations are not valid for all tests precludes building +the all the tests from withing the IDE in one batch. + +(C) Copyright 2008 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) diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_array.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_array.vcproj new file mode 100644 index 0000000000..03b5b8153d --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_array.vcproj @@ -0,0 +1,1828 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_binary.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_binary.vcproj new file mode 100644 index 0000000000..4172fc7ba9 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_binary.vcproj @@ -0,0 +1,193 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_bitset.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_bitset.vcproj new file mode 100644 index 0000000000..1ddbc629ea --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_bitset.vcproj @@ -0,0 +1,193 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_check.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_check.vcproj new file mode 100644 index 0000000000..f0abbbd36f --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_check.vcproj @@ -0,0 +1,192 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_class_info_load.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_class_info_load.vcproj new file mode 100644 index 0000000000..9ed49ad9a0 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_class_info_load.vcproj @@ -0,0 +1,193 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_class_info_save.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_class_info_save.vcproj new file mode 100644 index 0000000000..af08fead9b --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_class_info_save.vcproj @@ -0,0 +1,193 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_codecvt_null.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_codecvt_null.vcproj new file mode 100644 index 0000000000..031f462e76 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_codecvt_null.vcproj @@ -0,0 +1,196 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_complex.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_complex.vcproj new file mode 100644 index 0000000000..4e064eadb5 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_complex.vcproj @@ -0,0 +1,196 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_const.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_const.vcproj new file mode 100644 index 0000000000..30a52b6973 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_const.vcproj @@ -0,0 +1,192 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_const_fail.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_const_fail.vcproj new file mode 100644 index 0000000000..7d33b01dfd --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_const_fail.vcproj @@ -0,0 +1,225 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_const_pass.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_const_pass.vcproj new file mode 100644 index 0000000000..25a6eb7ea2 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_const_pass.vcproj @@ -0,0 +1,192 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_contained_class.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_contained_class.vcproj new file mode 100644 index 0000000000..3e1f688d83 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_contained_class.vcproj @@ -0,0 +1,201 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_cyclic_ptrs.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_cyclic_ptrs.vcproj new file mode 100644 index 0000000000..1bc9410921 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_cyclic_ptrs.vcproj @@ -0,0 +1,202 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_delete_pointer.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_delete_pointer.vcproj new file mode 100644 index 0000000000..9fe90a3af8 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_delete_pointer.vcproj @@ -0,0 +1,193 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_deque.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_deque.vcproj new file mode 100644 index 0000000000..50aed0ddca --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_deque.vcproj @@ -0,0 +1,202 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_derived.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_derived.vcproj new file mode 100644 index 0000000000..c2a242abf0 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_derived.vcproj @@ -0,0 +1,193 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_derived_class.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_derived_class.vcproj new file mode 100644 index 0000000000..1b7f409ffd --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_derived_class.vcproj @@ -0,0 +1,199 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_derived_class_ptr.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_derived_class_ptr.vcproj new file mode 100644 index 0000000000..4127f6d3dc --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_derived_class_ptr.vcproj @@ -0,0 +1,199 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_diamond.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_diamond.vcproj new file mode 100644 index 0000000000..1f46341ab9 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_diamond.vcproj @@ -0,0 +1,193 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_dll_exported.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_dll_exported.vcproj new file mode 100644 index 0000000000..6c1960224c --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_dll_exported.vcproj @@ -0,0 +1,203 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_dll_plugin.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_dll_plugin.vcproj new file mode 100644 index 0000000000..0ea4b796a8 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_dll_plugin.vcproj @@ -0,0 +1,199 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_dll_simple.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_dll_simple.vcproj new file mode 100644 index 0000000000..ce61228f04 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_dll_simple.vcproj @@ -0,0 +1,202 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_exported.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_exported.vcproj new file mode 100644 index 0000000000..af1cd5ed22 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_exported.vcproj @@ -0,0 +1,202 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_inclusion.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_inclusion.vcproj new file mode 100644 index 0000000000..f46d84133d --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_inclusion.vcproj @@ -0,0 +1,192 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_iterators.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_iterators.vcproj new file mode 100644 index 0000000000..3ca53a3727 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_iterators.vcproj @@ -0,0 +1,193 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_iterators_base64.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_iterators_base64.vcproj new file mode 100644 index 0000000000..1e9b92a1b1 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_iterators_base64.vcproj @@ -0,0 +1,193 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_list.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_list.vcproj new file mode 100644 index 0000000000..159c833baa --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_list.vcproj @@ -0,0 +1,202 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_list_ptrs.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_list_ptrs.vcproj new file mode 100644 index 0000000000..75043ba192 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_list_ptrs.vcproj @@ -0,0 +1,202 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_map.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_map.vcproj new file mode 100644 index 0000000000..694096c208 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_map.vcproj @@ -0,0 +1,202 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_mi.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_mi.vcproj new file mode 100644 index 0000000000..6eacab7717 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_mi.vcproj @@ -0,0 +1,193 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_mult_archive_types.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_mult_archive_types.vcproj new file mode 100644 index 0000000000..205e77d36f --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_mult_archive_types.vcproj @@ -0,0 +1,193 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_multiple_inheritance.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_multiple_inheritance.vcproj new file mode 100644 index 0000000000..aa5f36f0be --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_multiple_inheritance.vcproj @@ -0,0 +1,192 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_multiple_ptrs.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_multiple_ptrs.vcproj new file mode 100644 index 0000000000..63298ae66e --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_multiple_ptrs.vcproj @@ -0,0 +1,204 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_new_operator.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_new_operator.vcproj new file mode 100644 index 0000000000..96b74bfd0d --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_new_operator.vcproj @@ -0,0 +1,202 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_no_rtti.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_no_rtti.vcproj new file mode 100644 index 0000000000..85c8a27e85 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_no_rtti.vcproj @@ -0,0 +1,205 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_non_default_ctor.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_non_default_ctor.vcproj new file mode 100644 index 0000000000..61ec56b541 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_non_default_ctor.vcproj @@ -0,0 +1,193 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_non_default_ctor2.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_non_default_ctor2.vcproj new file mode 100644 index 0000000000..f6f6ec27c5 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_non_default_ctor2.vcproj @@ -0,0 +1,193 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_non_intrusive.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_non_intrusive.vcproj new file mode 100644 index 0000000000..eba3b650cc --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_non_intrusive.vcproj @@ -0,0 +1,193 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_not_serializable.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_not_serializable.vcproj new file mode 100644 index 0000000000..503fc8464c --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_not_serializable.vcproj @@ -0,0 +1,192 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_null_ptr.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_null_ptr.vcproj new file mode 100644 index 0000000000..c372b311bc --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_null_ptr.vcproj @@ -0,0 +1,193 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_nvp.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_nvp.vcproj new file mode 100644 index 0000000000..64114c96de --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_nvp.vcproj @@ -0,0 +1,196 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_object.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_object.vcproj new file mode 100644 index 0000000000..d300023244 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_object.vcproj @@ -0,0 +1,193 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_optional.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_optional.vcproj new file mode 100644 index 0000000000..eefc40f2ef --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_optional.vcproj @@ -0,0 +1,199 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_polymorphic.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_polymorphic.vcproj new file mode 100644 index 0000000000..3e2cd811d8 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_polymorphic.vcproj @@ -0,0 +1,208 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_polymorphic2.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_polymorphic2.vcproj new file mode 100644 index 0000000000..40b4288b4a --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_polymorphic2.vcproj @@ -0,0 +1,202 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_primitive.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_primitive.vcproj new file mode 100644 index 0000000000..23792fa16f --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_primitive.vcproj @@ -0,0 +1,193 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_private_base.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_private_base.vcproj new file mode 100644 index 0000000000..f18173da83 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_private_base.vcproj @@ -0,0 +1,199 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_private_ctor.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_private_ctor.vcproj new file mode 100644 index 0000000000..7f3ca7ea22 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_private_ctor.vcproj @@ -0,0 +1,193 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_recursion.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_recursion.vcproj new file mode 100644 index 0000000000..09b1de3c0a --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_recursion.vcproj @@ -0,0 +1,193 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_recusion.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_recusion.vcproj new file mode 100644 index 0000000000..18503eaec7 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_recusion.vcproj @@ -0,0 +1,193 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_registered.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_registered.vcproj new file mode 100644 index 0000000000..0051386cb8 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_registered.vcproj @@ -0,0 +1,193 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_reset_object_addr.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_reset_object_addr.vcproj new file mode 100644 index 0000000000..4bfc9b48ce --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_reset_object_addr.vcproj @@ -0,0 +1,199 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_set.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_set.vcproj new file mode 100644 index 0000000000..01815d7f07 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_set.vcproj @@ -0,0 +1,199 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_shared_ptr.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_shared_ptr.vcproj new file mode 100644 index 0000000000..329af32071 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_shared_ptr.vcproj @@ -0,0 +1,200 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_shared_ptr_132.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_shared_ptr_132.vcproj new file mode 100644 index 0000000000..fc67680475 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_shared_ptr_132.vcproj @@ -0,0 +1,212 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_shared_ptr_multi_base.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_shared_ptr_multi_base.vcproj new file mode 100644 index 0000000000..3ff36d675f --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_shared_ptr_multi_base.vcproj @@ -0,0 +1,196 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_simple_class.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_simple_class.vcproj new file mode 100644 index 0000000000..6fd4663b9f --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_simple_class.vcproj @@ -0,0 +1,255 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_simple_class_ptr.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_simple_class_ptr.vcproj new file mode 100644 index 0000000000..4fcdf57eba --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_simple_class_ptr.vcproj @@ -0,0 +1,208 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_singleton.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_singleton.vcproj new file mode 100644 index 0000000000..c76cf373c0 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_singleton.vcproj @@ -0,0 +1,196 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_smart_cast.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_smart_cast.vcproj new file mode 100644 index 0000000000..e82bd4f8ce --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_smart_cast.vcproj @@ -0,0 +1,196 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_split.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_split.vcproj new file mode 100644 index 0000000000..170df4c038 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_split.vcproj @@ -0,0 +1,193 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_static_warning.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_static_warning.vcproj new file mode 100644 index 0000000000..6d51eb28b5 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_static_warning.vcproj @@ -0,0 +1,193 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_strong_typedef.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_strong_typedef.vcproj new file mode 100644 index 0000000000..86ba20f76f --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_strong_typedef.vcproj @@ -0,0 +1,196 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_tracking.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_tracking.vcproj new file mode 100644 index 0000000000..7a7e868c3e --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_tracking.vcproj @@ -0,0 +1,193 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_traits_fail.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_traits_fail.vcproj new file mode 100644 index 0000000000..39cb678ff1 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_traits_fail.vcproj @@ -0,0 +1,192 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_traits_pass.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_traits_pass.vcproj new file mode 100644 index 0000000000..6d29dc30ee --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_traits_pass.vcproj @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_unregistered.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_unregistered.vcproj new file mode 100644 index 0000000000..fe32b0e57b --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_unregistered.vcproj @@ -0,0 +1,193 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_utf8_codecvt.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_utf8_codecvt.vcproj new file mode 100644 index 0000000000..1174b1ad04 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_utf8_codecvt.vcproj @@ -0,0 +1,202 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_valarray.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_valarray.vcproj new file mode 100644 index 0000000000..6deb7f17a6 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_valarray.vcproj @@ -0,0 +1,196 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_variant.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_variant.vcproj new file mode 100644 index 0000000000..a5ccfeff5b --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_variant.vcproj @@ -0,0 +1,193 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_vector.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_vector.vcproj new file mode 100644 index 0000000000..3692d4afbd --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_vector.vcproj @@ -0,0 +1,202 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/deal.II/contrib/boost/libs/serialization/vc7ide/test_void_cast.vcproj b/deal.II/contrib/boost/libs/serialization/vc7ide/test_void_cast.vcproj new file mode 100644 index 0000000000..29eb1fbf55 --- /dev/null +++ b/deal.II/contrib/boost/libs/serialization/vc7ide/test_void_cast.vcproj @@ -0,0 +1,196 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +