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
cd6de3b2
Commit
cd6de3b2
authored
Jan 02, 2018
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
neighbor/{Explorer,Listener}: add "noexcept"
parent
dcd483bd
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
20 additions
and
18 deletions
+20
-18
Instance.cxx
src/Instance.cxx
+2
-2
Instance.hxx
src/Instance.hxx
+2
-2
Explorer.hxx
src/neighbor/Explorer.hxx
+2
-2
Glue.cxx
src/neighbor/Glue.cxx
+3
-3
Glue.hxx
src/neighbor/Glue.hxx
+7
-5
Listener.hxx
src/neighbor/Listener.hxx
+2
-2
run_neighbor_explorer.cxx
test/run_neighbor_explorer.cxx
+2
-2
No files found.
src/Instance.cxx
View file @
cd6de3b2
...
...
@@ -98,14 +98,14 @@ Instance::OnDatabaseSongRemoved(const char *uri)
#ifdef ENABLE_NEIGHBOR_PLUGINS
void
Instance
::
FoundNeighbor
(
gcc_unused
const
NeighborInfo
&
info
)
Instance
::
FoundNeighbor
(
gcc_unused
const
NeighborInfo
&
info
)
noexcept
{
for
(
auto
&
partition
:
partitions
)
partition
.
EmitIdle
(
IDLE_NEIGHBOR
);
}
void
Instance
::
LostNeighbor
(
gcc_unused
const
NeighborInfo
&
info
)
Instance
::
LostNeighbor
(
gcc_unused
const
NeighborInfo
&
info
)
noexcept
{
for
(
auto
&
partition
:
partitions
)
partition
.
EmitIdle
(
IDLE_NEIGHBOR
);
...
...
src/Instance.hxx
View file @
cd6de3b2
...
...
@@ -139,8 +139,8 @@ private:
#ifdef ENABLE_NEIGHBOR_PLUGINS
/* virtual methods from class NeighborListener */
void
FoundNeighbor
(
const
NeighborInfo
&
info
)
override
;
void
LostNeighbor
(
const
NeighborInfo
&
info
)
override
;
void
FoundNeighbor
(
const
NeighborInfo
&
info
)
noexcept
override
;
void
LostNeighbor
(
const
NeighborInfo
&
info
)
noexcept
override
;
#endif
/* callback for #idle_monitor */
...
...
src/neighbor/Explorer.hxx
View file @
cd6de3b2
...
...
@@ -40,7 +40,7 @@ class NeighborExplorer {
protected
:
NeighborListener
&
listener
;
explicit
NeighborExplorer
(
NeighborListener
&
_listener
)
explicit
NeighborExplorer
(
NeighborListener
&
_listener
)
noexcept
:
listener
(
_listener
)
{}
public
:
...
...
@@ -49,7 +49,7 @@ public:
/**
* Free instance data.
*/
virtual
~
NeighborExplorer
()
{}
virtual
~
NeighborExplorer
()
noexcept
{}
/**
* Start exploring the neighborhood.
...
...
src/neighbor/Glue.cxx
View file @
cd6de3b2
...
...
@@ -30,12 +30,12 @@
#include <stdexcept>
NeighborGlue
::
Explorer
::~
Explorer
()
NeighborGlue
::
Explorer
::~
Explorer
()
noexcept
{
delete
explorer
;
}
NeighborGlue
::~
NeighborGlue
()
{}
NeighborGlue
::~
NeighborGlue
()
noexcept
{}
static
NeighborExplorer
*
CreateNeighborExplorer
(
EventLoop
&
loop
,
NeighborListener
&
listener
,
...
...
@@ -86,7 +86,7 @@ NeighborGlue::Open()
}
void
NeighborGlue
::
Close
()
NeighborGlue
::
Close
()
noexcept
{
for
(
auto
i
=
explorers
.
begin
(),
end
=
explorers
.
end
();
i
!=
end
;
++
i
)
i
->
explorer
->
Close
();
...
...
src/neighbor/Glue.hxx
View file @
cd6de3b2
...
...
@@ -38,9 +38,11 @@ class NeighborGlue {
struct
Explorer
{
NeighborExplorer
*
const
explorer
;
Explorer
(
NeighborExplorer
*
_explorer
)
:
explorer
(
_explorer
)
{}
Explorer
(
NeighborExplorer
*
_explorer
)
noexcept
:
explorer
(
_explorer
)
{}
Explorer
(
const
Explorer
&
)
=
delete
;
~
Explorer
();
~
Explorer
()
noexcept
;
};
Mutex
mutex
;
...
...
@@ -52,9 +54,9 @@ public:
NeighborGlue
()
=
default
;
NeighborGlue
(
const
NeighborGlue
&
)
=
delete
;
~
NeighborGlue
();
~
NeighborGlue
()
noexcept
;
bool
IsEmpty
()
const
{
bool
IsEmpty
()
const
noexcept
{
return
explorers
.
empty
();
}
...
...
@@ -64,7 +66,7 @@ public:
void
Init
(
EventLoop
&
loop
,
NeighborListener
&
listener
);
void
Open
();
void
Close
();
void
Close
()
noexcept
;
/**
* Get the combined list of all neighbors from all active
...
...
src/neighbor/Listener.hxx
View file @
cd6de3b2
...
...
@@ -29,8 +29,8 @@ class NeighborExplorer;
*/
class
NeighborListener
{
public
:
virtual
void
FoundNeighbor
(
const
NeighborInfo
&
info
)
=
0
;
virtual
void
LostNeighbor
(
const
NeighborInfo
&
info
)
=
0
;
virtual
void
FoundNeighbor
(
const
NeighborInfo
&
info
)
noexcept
=
0
;
virtual
void
LostNeighbor
(
const
NeighborInfo
&
info
)
noexcept
=
0
;
};
#endif
test/run_neighbor_explorer.cxx
View file @
cd6de3b2
...
...
@@ -43,12 +43,12 @@ public:
class
MyNeighborListener
final
:
public
NeighborListener
{
public
:
/* virtual methods from class NeighborListener */
virtual
void
FoundNeighbor
(
const
NeighborInfo
&
info
)
override
{
virtual
void
FoundNeighbor
(
const
NeighborInfo
&
info
)
noexcept
override
{
printf
(
"found '%s' (%s)
\n
"
,
info
.
display_name
.
c_str
(),
info
.
uri
.
c_str
());
}
virtual
void
LostNeighbor
(
const
NeighborInfo
&
info
)
override
{
virtual
void
LostNeighbor
(
const
NeighborInfo
&
info
)
noexcept
override
{
printf
(
"lost '%s' (%s)
\n
"
,
info
.
display_name
.
c_str
(),
info
.
uri
.
c_str
());
}
...
...
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