Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
c7813163
Commit
c7813163
authored
Jan 23, 2016
by
Davis King
Browse files
merged
parents
a9e1c9e4
27274c17
Changes
29
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
117 additions
and
5 deletions
+117
-5
dlib/vectorstream/unserialize_abstract.h
dlib/vectorstream/unserialize_abstract.h
+58
-0
docs/docs/algorithms.xml
docs/docs/algorithms.xml
+15
-0
docs/docs/compile.xml
docs/docs/compile.xml
+1
-1
docs/docs/dlib.css
docs/docs/dlib.css
+8
-0
docs/docs/other.xml
docs/docs/other.xml
+15
-0
docs/docs/release_notes.xml
docs/docs/release_notes.xml
+14
-2
docs/docs/stylesheet.xsl
docs/docs/stylesheet.xsl
+2
-1
docs/docs/term_index.xml
docs/docs/term_index.xml
+2
-0
setup.py
setup.py
+2
-1
No files found.
dlib/vectorstream/unserialize_abstract.h
0 → 100644
View file @
c7813163
// 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_
docs/docs/algorithms.xml
View file @
c7813163
...
...
@@ -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>
...
...
docs/docs/compile.xml
View file @
c7813163
...
...
@@ -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
...
...
docs/docs/dlib.css
View file @
c7813163
...
...
@@ -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
;
...
...
docs/docs/other.xml
View file @
c7813163
...
...
@@ -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>
...
...
docs/docs/release_notes.xml
View file @
c7813163
...
...
@@ -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>
<!-- ************************************************************************************** -->
...
...
docs/docs/stylesheet.xsl
View file @
c7813163
...
...
@@ -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"
/>
...
...
docs/docs/term_index.xml
View file @
c7813163
...
...
@@ -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"
/>
...
...
setup.py
View file @
c7813163
...
...
@@ -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
:
...
...
Prev
1
2
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment