Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r60329 - trunk/libs/serialization/doc
From: ramey_at_[hidden]
Date: 2010-03-07 15:38:23


Author: ramey
Date: 2010-03-07 15:38:22 EST (Sun, 07 Mar 2010)
New Revision: 60329
URL: http://svn.boost.org/trac/boost/changeset/60329

Log:
Add simple log demo to documentation
Added:
   trunk/libs/serialization/doc/simple_log.html (contents, props changed)

Added: trunk/libs/serialization/doc/simple_log.html
==============================================================================
--- (empty file)
+++ trunk/libs/serialization/doc/simple_log.html 2010-03-07 15:38:22 EST (Sun, 07 Mar 2010)
@@ -0,0 +1,95 @@
+<!doctype HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<!--
+(C) Copyright 2002-10 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)
+-->
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<link rel="stylesheet" type="text/css" href="../../../boost.css">
+<link rel="stylesheet" type="text/css" href="style.css">
+<title>Serialization - Derivation from an Existing Archive</title>
+</head>
+<body link="#0000ff" vlink="#800080">
+<table border="0" cellpadding="7" cellspacing="0" width="100%" summary="header">
+ <tr>
+ <td valign="top" width="300">
+ <h3>C++ Boost</h3>
+ </td>
+ <td valign="top">
+ <h1 align="center">Serialization</h1>
+ <h2 align="center">A Simple Logging Archive Class</h2>
+ </td>
+ </tr>
+</table>
+<hr>
+The purpose of this example help clarify the usage of the
+Archive Concept
+so that one can implement his own archive classes.
+<a href="../example/simple_log_archive.hpp" target="simple_archive_hpp">
+<code>simple_log_archive.hpp</code></a> 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:
+
+<pre><code>
+#include "simple_log_archive.hpp"
+...
+// display the complete schedule
+simple_log_archive log(std::cout);
+log << schedule;
+</code></pre>
+
+and it produces the following output
+
+<pre><code>
+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
+...
+</code></pre>
+
+The complete example is <a href="../example/demo_simple_log.cpp" target="demo_simple_log_cpp">
+<code>demo_simple_log.cpp</code></a>. Look at
+Trivial Archive to get a
+better understanding of how this works.
+
+Also, note the following:
+<ul>
+ <li>Only 160 lines of code.
+ <li>Header only - linking with the serialization library not required.
+ <li>Displays ALL Serializable types.
+ <li>Lacks some features.
+ <ul>
+ <li>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.
+ <li>doesn't display information serialized as binary data
+ </ul>
+</ul>
+
+<hr>
+<p><i>&copy; 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)
+</i></p>
+</body>
+</html>


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