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
e2bc92d1
Commit
e2bc92d1
authored
Mar 10, 2016
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Instance: replace IdleMaskMonitor with CallMaskMonitor
parent
5ffe3773
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
52 deletions
+12
-52
Makefile.am
Makefile.am
+0
-1
IdleMaskMonitor.hxx
src/IdleMaskMonitor.hxx
+0
-44
Instance.hxx
src/Instance.hxx
+12
-7
No files found.
Makefile.am
View file @
e2bc92d1
...
...
@@ -95,7 +95,6 @@ libmpd_a_SOURCES = \
src/command/OtherCommands.cxx src/command/OtherCommands.hxx
\
src/command/CommandListBuilder.cxx src/command/CommandListBuilder.hxx
\
src/Idle.cxx src/Idle.hxx
\
src/IdleMaskMonitor.hxx
\
src/IdleFlags.cxx src/IdleFlags.hxx
\
src/decoder/DecoderError.cxx src/decoder/DecoderError.hxx
\
src/decoder/DecoderThread.cxx src/decoder/DecoderThread.hxx
\
...
...
src/IdleMaskMonitor.hxx
deleted
100644 → 0
View file @
5ffe3773
/*
* Copyright 2003-2016 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef MPD_IDLE_MONITOR_HXX
#define MPD_IDLE_MONITOR_HXX
#include "event/MaskMonitor.hxx"
class
IdleMaskMonitor
:
MaskMonitor
{
public
:
explicit
IdleMaskMonitor
(
EventLoop
&
_loop
)
:
MaskMonitor
(
_loop
)
{}
void
EmitIdle
(
unsigned
mask
)
{
OrMask
(
mask
);
}
protected
:
virtual
void
OnIdle
(
unsigned
mask
)
=
0
;
private
:
/* virtual methods from class MaskMonitor */
void
HandleMask
(
unsigned
mask
)
final
{
OnIdle
(
mask
);
}
};
#endif
src/Instance.hxx
View file @
e2bc92d1
...
...
@@ -22,7 +22,7 @@
#include "check.h"
#include "event/Loop.hxx"
#include "
Idle
MaskMonitor.hxx"
#include "
event/
MaskMonitor.hxx"
#include "GlobalEvents.hxx"
#include "Compiler.h"
...
...
@@ -52,8 +52,7 @@ struct EventLoopHolder {
};
struct
Instance
final
:
EventLoopHolder
,
IdleMaskMonitor
:
EventLoopHolder
#if defined(ENABLE_DATABASE) || defined(ENABLE_NEIGHBOR_PLUGINS)
,
#endif
...
...
@@ -69,6 +68,8 @@ struct Instance final
{
GlobalEvents
::
Monitor
global_events
;
CallbackMaskMonitor
<
Instance
>
idle_monitor
;
#ifdef ENABLE_NEIGHBOR_PLUGINS
NeighborGlue
*
neighbors
;
#endif
...
...
@@ -92,8 +93,8 @@ struct Instance final
StateFile
*
state_file
;
Instance
()
:
IdleMaskMonitor
(
event_loop
),
global_events
(
event_loop
)
{}
:
global_events
(
event_loop
),
idle_monitor
(
event_loop
,
*
this
,
&
Instance
::
OnIdle
)
{}
/**
* Initiate shutdown. Wrapper for EventLoop::Break().
...
...
@@ -102,6 +103,10 @@ struct Instance final
event_loop
.
Break
();
}
void
EmitIdle
(
unsigned
mask
)
{
idle_monitor
.
OrMask
(
mask
);
}
#ifdef ENABLE_DATABASE
/**
* Returns the global #Database instance. May return nullptr
...
...
@@ -134,8 +139,8 @@ private:
virtual
void
LostNeighbor
(
const
NeighborInfo
&
info
)
override
;
#endif
/*
virtual methods from class IdleMaskM
onitor */
void
OnIdle
(
unsigned
mask
)
override
;
/*
callback for #idle_m
onitor */
void
OnIdle
(
unsigned
mask
);
};
#endif
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