1 <!doctype HTML PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
4 (C) Copyright 2002-10 Robert Ramey - http://www.rrsd.com .
5 Use, modification and distribution is subject to the Boost Software
6 License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
7 http://www.boost.org/LICENSE_1_0.txt)
10 <meta http-equiv=
"Content-Type" content=
"text/html; charset=UTF-8">
11 <link rel=
"stylesheet" type=
"text/css" href=
"../../../boost.css">
12 <link rel=
"stylesheet" type=
"text/css" href=
"style.css">
13 <title>Serialization - Derivation from an Existing Archive
</title>
15 <body link=
"#0000ff" vlink=
"#800080">
16 <table border=
"0" cellpadding=
"7" cellspacing=
"0" width=
"100%" summary=
"header">
18 <td valign=
"top" width=
"300">
19 <h3><a href=
"../../../index.htm"><img height=
"86" width=
"277" alt=
"C++ Boost" src=
"../../../boost.png" border=
"0"></a></h3>
22 <h1 align=
"center">Serialization
</h1>
23 <h2 align=
"center">A Simple Logging Archive Class
</h2>
28 The purpose of this example is to help clarify the usage of the
29 <a href=
"archives.html"><strong>Archive Concept
</strong></a>
30 so that one can implement his own archive classes.
31 <a href=
"../example/simple_log_archive.hpp" target=
"simple_archive_hpp">
32 <code>simple_log_archive.hpp
</code></a> implements a simple but useful
33 archive class. This class can be used to send any serializable types
34 on an output text stream in a readable format. Usage of this facility
38 #include
"simple_log_archive.hpp"
40 // display the complete schedule
41 simple_log_archive log(std::cout);
45 and it produces the following output
70 The complete example is
<a href=
"../example/demo_simple_log.cpp" target=
"demo_simple_log_cpp">
71 <code>demo_simple_log.cpp
</code></a>. Look at
72 <a href=
"archive_reference.html#trivial">Trivial Archive
</a> to get a
73 better understanding of how this works.
75 Also, note the following:
77 <li>Only
160 lines of code.
78 <li>Header only - linking with the serialization library not required.
79 <li>Displays ALL
<a href=
"serialization.html"><strong>Serializable
</strong></a> types.
80 <li>Lacks some features.
82 <li>it will not display the data from the derived type given the pointer to a
83 polymorphic base class. That is, only displays the information of the base class.
84 To add that see the next example.
85 <li>doesn't display information serialized as binary data
90 <p><i>© Copyright
<a href=
"http://www.rrsd.com">Robert Ramey
</a> 2002-
2010.
91 Distributed under the Boost Software License, Version
1.0. (See
92 accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)