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
02bb47dd
Commit
02bb47dd
authored
6 years ago
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
db/simple/Song: move struct Disposer to separate header
Allow forward-declaring it.
parent
0c48b8d0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
7 deletions
+38
-7
Directory.cxx
src/db/plugins/simple/Directory.cxx
+2
-1
Disposer.hxx
src/db/plugins/simple/Disposer.hxx
+29
-0
Song.cxx
src/db/plugins/simple/Song.cxx
+7
-0
Song.hxx
src/db/plugins/simple/Song.hxx
+0
-6
No files found.
src/db/plugins/simple/Directory.cxx
View file @
02bb47dd
...
...
@@ -20,6 +20,7 @@
#include "Directory.hxx"
#include "SongSort.hxx"
#include "Song.hxx"
#include "Disposer.hxx"
#include "Mount.hxx"
#include "db/LightDirectory.hxx"
#include "song/LightSong.hxx"
...
...
@@ -50,7 +51,7 @@ Directory::~Directory() noexcept
mounted_database
.
reset
();
}
songs
.
clear_and_dispose
(
Song
::
Disposer
());
songs
.
clear_and_dispose
(
SongDisposer
());
children
.
clear_and_dispose
(
DeleteDisposer
());
}
...
...
This diff is collapsed.
Click to expand it.
src/db/plugins/simple/Disposer.hxx
0 → 100644
View file @
02bb47dd
/*
* Copyright 2003-2019 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_SONG_DISPOSER_HXX
#define MPD_SONG_DISPOSER_HXX
struct
Song
;
struct
SongDisposer
{
void
operator
()(
Song
*
song
)
const
noexcept
;
};
#endif
This diff is collapsed.
Click to expand it.
src/db/plugins/simple/Song.cxx
View file @
02bb47dd
...
...
@@ -18,6 +18,7 @@
*/
#include "Song.hxx"
#include "Disposer.hxx"
#include "Directory.hxx"
#include "tag/Tag.hxx"
#include "util/VarSize.hxx"
...
...
@@ -76,6 +77,12 @@ Song::Free() noexcept
DeleteVarSize
(
this
);
}
void
SongDisposer
::
operator
()(
Song
*
song
)
const
noexcept
{
song
->
Free
();
}
std
::
string
Song
::
GetURI
()
const
noexcept
{
...
...
This diff is collapsed.
Click to expand it.
src/db/plugins/simple/Song.hxx
View file @
02bb47dd
...
...
@@ -45,12 +45,6 @@ struct Song {
typedef
boost
::
intrusive
::
link_mode
<
link_mode
>
LinkMode
;
typedef
boost
::
intrusive
::
list_member_hook
<
LinkMode
>
Hook
;
struct
Disposer
{
void
operator
()(
Song
*
song
)
const
noexcept
{
song
->
Free
();
}
};
/**
* Pointers to the siblings of this directory within the
* parent directory. It is unused (undefined) if this song is
...
...
This diff is collapsed.
Click to expand it.
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