Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
4f678aa2
Commit
4f678aa2
authored
Jul 17, 2018
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
neighbor/Glue: use struct ConfigData
parent
3a4a430f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
6 deletions
+10
-6
Main.cxx
src/Main.cxx
+2
-1
Glue.cxx
src/neighbor/Glue.cxx
+4
-3
Glue.hxx
src/neighbor/Glue.hxx
+3
-1
run_neighbor_explorer.cxx
test/run_neighbor_explorer.cxx
+1
-1
No files found.
src/Main.cxx
View file @
4f678aa2
...
...
@@ -515,7 +515,8 @@ try {
#ifdef ENABLE_NEIGHBOR_PLUGINS
instance
->
neighbors
=
new
NeighborGlue
();
instance
->
neighbors
->
Init
(
instance
->
io_thread
.
GetEventLoop
(),
instance
->
neighbors
->
Init
(
raw_config
,
instance
->
io_thread
.
GetEventLoop
(),
*
instance
);
if
(
instance
->
neighbors
->
IsEmpty
())
{
...
...
src/neighbor/Glue.cxx
View file @
4f678aa2
...
...
@@ -23,7 +23,7 @@
#include "Explorer.hxx"
#include "NeighborPlugin.hxx"
#include "Info.hxx"
#include "config/
Global
.hxx"
#include "config/
Data
.hxx"
#include "config/Domain.hxx"
#include "config/Block.hxx"
#include "util/RuntimeError.hxx"
...
...
@@ -50,9 +50,10 @@ CreateNeighborExplorer(EventLoop &loop, NeighborListener &listener,
}
void
NeighborGlue
::
Init
(
EventLoop
&
loop
,
NeighborListener
&
listener
)
NeighborGlue
::
Init
(
const
ConfigData
&
config
,
EventLoop
&
loop
,
NeighborListener
&
listener
)
{
for
(
const
auto
*
block
=
config
_get_b
lock
(
ConfigBlockOption
::
NEIGHBORS
);
for
(
const
auto
*
block
=
config
.
GetB
lock
(
ConfigBlockOption
::
NEIGHBORS
);
block
!=
nullptr
;
block
=
block
->
next
)
{
block
->
SetUsed
();
...
...
src/neighbor/Glue.hxx
View file @
4f678aa2
...
...
@@ -27,6 +27,7 @@
#include <forward_list>
#include <memory>
struct
ConfigData
;
class
EventLoop
;
class
NeighborExplorer
;
class
NeighborListener
;
...
...
@@ -64,7 +65,8 @@ public:
/**
* Throws std::runtime_error on error.
*/
void
Init
(
EventLoop
&
loop
,
NeighborListener
&
listener
);
void
Init
(
const
ConfigData
&
config
,
EventLoop
&
loop
,
NeighborListener
&
listener
);
void
Open
();
void
Close
()
noexcept
;
...
...
test/run_neighbor_explorer.cxx
View file @
4f678aa2
...
...
@@ -79,7 +79,7 @@ try {
MyNeighborListener
listener
;
NeighborGlue
neighbor
;
neighbor
.
Init
(
loop
,
listener
);
neighbor
.
Init
(
GetGlobalConfig
(),
loop
,
listener
);
neighbor
.
Open
();
/* dump initial list */
...
...
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