Commit c7813163 authored by Davis King's avatar Davis King
Browse files

merged

parents a9e1c9e4 27274c17
// Copyright (C) 2016 Davis E. King (davis@dlib.net)
// License: Boost Software License See LICENSE.txt for the full license.
#undef DLIB_uNSERIALIZE_ABSTRACT_Hh_
#ifdef DLIB_uNSERIALIZE_ABSTRACT_Hh_
#include "../serialize.h"
#include <iostream>
namespace dlib
{
class unserialize : public std::iostream
{
/*!
WHAT THIS OBJECT REPRESENTS
This is a tool that allows you to effectively put an object you just
deserialized from a stream back into the stream. Its use is best
illustrated via an example.
void example(std::istream& in)
{
// Suppose that in contains serialized copies of three "some_type"
// objects. You could read them as follows:
some_type obj1, obj2, obj3;
deserialize(obj1, in); // reads obj1 from stream.
deserialize(obj2, in); // reads obj2 from stream.
unserialize in2(obj2, in); // make the in2 stream that has obj2 at its front.
deserialize(obj2, in2); // reads obj2 from stream again.
deserialize(obj3, in2); // reads obj3 from stream.
}
The reason unserialize is useful is because it allows you to peek at the
next object in a stream and potentially do something different based on
what object is coming next, but still allowing subsequent deserialize()
statements to be undisturbed by the fact that you peeked at the data.
!*/
public:
template <typename T>
unserialize (
const T& item,
std::istream& in
);
/*!
requires
- T must be serializable
ensures
- The bytes in this stream begin with a serialized copy of item followed
immediately by the bytes in the given istream.
!*/
};
}
#endif // DLIB_uNSERIALIZE_ABSTRACT_Hh_
......@@ -58,6 +58,7 @@
<item>rand</item>
<item>median</item>
<item>running_stats</item>
<item>running_gradient</item>
<item>running_scalar_covariance</item>
<item>mean_sign_agreement</item>
<item>correlation</item>
......@@ -475,6 +476,20 @@
</component>
<!-- ************************************************************************* -->
<component cpp11="true">
<name>running_gradient</name>
<file>dlib/statistics/running_gradient.h</file>
<spec_file link="true">dlib/statistics/running_gradient_abstract.h</spec_file>
<description>
This object is a tool for estimating if a noisy sequence of numbers is
trending up or down and by how much. It does this by finding the least
squares fit of a line to the data and then allows you to perform a
statistical test on the slope of that line.
</description>
</component>
<!-- ************************************************************************* -->
<component>
......
......@@ -65,7 +65,7 @@ tell CMake which one you want it to use via the -G option.
<p>
In most cases, to use this library all you have to do is extract it somewhere, make
sure the folder <i>containing</i> the dlib folder is in your include path, and
finally add <a href="dlib/all/source.cpp.html">dlib/all/source.cpp</a> to your
finally add dlib/all/source.cpp to your
project. It is worth noting that most of dlib is "header-only" which means that, in
many cases, you don't actually have to build dlib/all/source.cpp into your
application. So if you don't get linker errors when you exclude dlib/all/source.cpp
......
......@@ -105,6 +105,14 @@ ul.tree li ul { margin-left:10px; padding:0px; }
li#term { list-style: none; }
span.cpp11
{
color: #008000;
font-family: sans-serif;
font-size: 0.8em;
margin-left: 0.3em;
}
div.include_file_more_details_wrapper
{
margin-top: 1em;
......
......@@ -34,6 +34,7 @@
<item>timeout</item>
<item>member_function_pointer</item>
<item>vectorstream</item>
<item>unserialize</item>
<item>bound_function_pointer</item>
<item>error</item>
<item>console_progress_indicator</item>
......@@ -403,6 +404,20 @@
</component>
<!-- ************************************************************************* -->
<component>
<name>unserialize</name>
<file>dlib/vectorstream.h</file>
<spec_file>dlib/vectorstream/unserialize_abstract.h</spec_file>
<description>
This object effectively allows you to peek at the next serialized
object in an istream. It does this by allowing you to read an object
and then put it back.
</description>
</component>
<!-- ************************************************************************* -->
<component>
......
......@@ -11,6 +11,19 @@
<!-- ************************************************************************************** -->
<current>
New Features:
Non-Backwards Compatible Changes:
Bug fixes:
Other:
</current>
<!-- ************************************************************************************** -->
<old name="18.18" date="Oct 28, 2015">
New Features:
- Added the set_ptrm() routine for assigning dlib::matrix objects to arbitrary
memory blocks.
......@@ -30,8 +43,7 @@ Other:
install target. Now dlib can be installed system wide by executing
'cmake PATH_TO_DLIB; make install'. This also includes installing the
appropriate scripts for CMake's find_package(dlib) to work.
</current>
</old>
<!-- ************************************************************************************** -->
......
......@@ -327,7 +327,8 @@
<div class="component" >
<a href="#top"><font size='2'><center>[top]</center></font></a>
<h1 style="margin:0px;"><xsl:value-of select="name"/></h1>
<h1 style="margin:0px;"><xsl:value-of select="name"/> <xsl:if test="@cpp11 = 'true'"><span class='cpp11'>(C++11)</span></xsl:if>
</h1>
<BR/>
<BR/>
<xsl:apply-templates select="description"/>
......
......@@ -257,6 +257,7 @@
<term file="linear_algebra.html" name="find_projective_transform" include="dlib/geometry.h"/>
<term file="linear_algebra.html" name="rotation_matrix" include="dlib/geometry.h"/>
<term file="algorithms.html" name="running_stats" include="dlib/statistics.h"/>
<term file="algorithms.html" name="running_gradient" include="dlib/statistics/running_gradient.h"/>
<term file="algorithms.html" name="running_scalar_covariance" include="dlib/statistics.h"/>
<term file="algorithms.html" name="mean_sign_agreement" include="dlib/statistics.h"/>
<term file="algorithms.html" name="correlation" include="dlib/statistics.h"/>
......@@ -1431,6 +1432,7 @@
<term link="other.html#dlib_testing_suite" name="unit testing"/>
<term file="other.html" name="logger" include="dlib/logger.h"/>
<term file="other.html" name="vectorstream" include="dlib/vectorstream.h"/>
<term file="other.html" name="unserialize" include="dlib/vectorstream.h"/>
<term file="other.html" name="member_function_pointer" include="dlib/member_function_pointer.h"/>
<term file="other.html" name="make_mfp" include="dlib/member_function_pointer.h"/>
<term file="other.html" name="bound_function_pointer" include="dlib/bound_function_pointer.h"/>
......
......@@ -265,7 +265,8 @@ def enqueue_output(out, queue):
def _log_buf(buf):
if not buf:
return
buf = buf.decode("latin-1")
if sys.stdout.encoding:
buf = buf.decode(sys.stdout.encoding)
buf = buf.rstrip()
lines = buf.splitlines()
for line in lines:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment