Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
opendht
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
opendht
Commits
6821e5bd
Commit
6821e5bd
authored
6 years ago
by
Adrien Béraud
Browse files
Options
Downloads
Patches
Plain Diff
dhtrunner: default to null function instead of AllFilter
parent
c4ec1e78
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
include/opendht/dhtrunner.h
+6
-6
6 additions, 6 deletions
include/opendht/dhtrunner.h
with
6 additions
and
6 deletions
include/opendht/dhtrunner.h
+
6
−
6
View file @
6821e5bd
...
...
@@ -105,7 +105,7 @@ public:
getFilterSet
<
T
>
());
}
std
::
future
<
std
::
vector
<
std
::
shared_ptr
<
dht
::
Value
>>>
get
(
InfoHash
key
,
Value
::
Filter
f
=
Value
::
AllFilter
()
,
Where
w
=
{})
{
std
::
future
<
std
::
vector
<
std
::
shared_ptr
<
dht
::
Value
>>>
get
(
InfoHash
key
,
Value
::
Filter
f
=
{}
,
Where
w
=
{})
{
auto
p
=
std
::
make_shared
<
std
::
promise
<
std
::
vector
<
std
::
shared_ptr
<
dht
::
Value
>>>>
();
auto
values
=
std
::
make_shared
<
std
::
vector
<
std
::
shared_ptr
<
dht
::
Value
>>>
();
get
(
key
,
[
=
](
const
std
::
vector
<
std
::
shared_ptr
<
dht
::
Value
>>&
vlist
)
{
...
...
@@ -136,7 +136,7 @@ public:
query
(
hash
,
cb
,
bindDoneCb
(
done_cb
),
q
);
}
std
::
future
<
size_t
>
listen
(
InfoHash
key
,
ValueCallback
vcb
,
Value
::
Filter
f
=
Value
::
AllFilter
()
,
Where
w
=
{});
std
::
future
<
size_t
>
listen
(
InfoHash
key
,
ValueCallback
vcb
,
Value
::
Filter
f
=
{}
,
Where
w
=
{});
std
::
future
<
size_t
>
listen
(
InfoHash
key
,
GetCallback
cb
,
Value
::
Filter
f
=
{},
Where
w
=
{})
{
return
listen
(
key
,
[
cb
](
const
std
::
vector
<
Sp
<
Value
>>&
vals
,
bool
expired
){
...
...
@@ -145,8 +145,8 @@ public:
return
true
;
},
std
::
forward
<
Value
::
Filter
>
(
f
),
std
::
forward
<
Where
>
(
w
));
}
std
::
future
<
size_t
>
listen
(
const
std
::
string
&
key
,
GetCallback
vcb
,
Value
::
Filter
f
=
Value
::
AllFilter
()
,
Where
w
=
{});
std
::
future
<
size_t
>
listen
(
InfoHash
key
,
GetCallbackSimple
cb
,
Value
::
Filter
f
=
Value
::
AllFilter
()
,
Where
w
=
{})
{
std
::
future
<
size_t
>
listen
(
const
std
::
string
&
key
,
GetCallback
vcb
,
Value
::
Filter
f
=
{}
,
Where
w
=
{});
std
::
future
<
size_t
>
listen
(
InfoHash
key
,
GetCallbackSimple
cb
,
Value
::
Filter
f
=
{}
,
Where
w
=
{})
{
return
listen
(
key
,
bindGetCb
(
cb
),
f
,
w
);
}
...
...
@@ -168,7 +168,7 @@ public:
}
template
<
typename
T
>
std
::
future
<
size_t
>
listen
(
InfoHash
hash
,
std
::
function
<
bool
(
T
&&
)
>
cb
,
Value
::
Filter
f
=
Value
::
AllFilter
()
,
Where
w
=
{})
std
::
future
<
size_t
>
listen
(
InfoHash
hash
,
std
::
function
<
bool
(
T
&&
)
>
cb
,
Value
::
Filter
f
=
{}
,
Where
w
=
{})
{
return
listen
(
hash
,
[
=
](
const
std
::
vector
<
std
::
shared_ptr
<
Value
>>&
vals
)
{
for
(
const
auto
&
v
:
vals
)
{
...
...
@@ -184,7 +184,7 @@ public:
getFilterSet
<
T
>
(
f
),
w
);
}
template
<
typename
T
>
std
::
future
<
size_t
>
listen
(
InfoHash
hash
,
std
::
function
<
bool
(
T
&&
,
bool
)
>
cb
,
Value
::
Filter
f
=
Value
::
AllFilter
()
,
Where
w
=
{})
std
::
future
<
size_t
>
listen
(
InfoHash
hash
,
std
::
function
<
bool
(
T
&&
,
bool
)
>
cb
,
Value
::
Filter
f
=
{}
,
Where
w
=
{})
{
return
listen
(
hash
,
[
=
](
const
std
::
vector
<
std
::
shared_ptr
<
Value
>>&
vals
,
bool
expired
)
{
for
(
const
auto
&
v
:
vals
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment