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
4219185d
Commit
4219185d
authored
Dec 15, 2016
by
Davis King
Browse files
Allow enqueueing to a pipe from rvalues.
parent
bcf98e05
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
0 deletions
+19
-0
dlib/pipe/pipe_kernel_1.h
dlib/pipe/pipe_kernel_1.h
+9
-0
dlib/pipe/pipe_kernel_abstract.h
dlib/pipe/pipe_kernel_abstract.h
+10
-0
No files found.
dlib/pipe/pipe_kernel_1.h
View file @
4219185d
...
@@ -119,6 +119,10 @@ namespace dlib
...
@@ -119,6 +119,10 @@ namespace dlib
T
&
item
T
&
item
);
);
bool
enqueue
(
T
&&
item
)
{
return
enqueue
(
item
);
}
bool
dequeue
(
bool
dequeue
(
T
&
item
T
&
item
);
);
...
@@ -128,6 +132,11 @@ namespace dlib
...
@@ -128,6 +132,11 @@ namespace dlib
unsigned
long
timeout
unsigned
long
timeout
);
);
bool
enqueue_or_timeout
(
T
&&
item
,
unsigned
long
timeout
)
{
return
enqueue_or_timeout
(
item
,
timeout
);
}
bool
dequeue_or_timeout
(
bool
dequeue_or_timeout
(
T
&
item
,
T
&
item
,
unsigned
long
timeout
unsigned
long
timeout
...
...
dlib/pipe/pipe_kernel_abstract.h
View file @
4219185d
...
@@ -219,6 +219,11 @@ namespace dlib
...
@@ -219,6 +219,11 @@ namespace dlib
- #item == item (i.e. the value of item is unchanged)
- #item == item (i.e. the value of item is unchanged)
!*/
!*/
bool
enqueue
(
T
&&
item
)
{
return
enqueue
(
item
);
}
/*!
enable enqueueing from rvalues
!*/
bool
enqueue_or_timeout
(
bool
enqueue_or_timeout
(
T
&
item
,
T
&
item
,
unsigned
long
timeout
unsigned
long
timeout
...
@@ -249,6 +254,11 @@ namespace dlib
...
@@ -249,6 +254,11 @@ namespace dlib
- #item == item (i.e. the value of item is unchanged)
- #item == item (i.e. the value of item is unchanged)
!*/
!*/
bool
enqueue_or_timeout
(
T
&&
item
,
unsigned
long
timeout
)
{
return
enqueue_or_timeout
(
item
,
timeout
);
}
/*!
enable enqueueing from rvalues
!*/
bool
dequeue
(
bool
dequeue
(
T
&
item
T
&
item
);
);
...
...
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