summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2019-04-24 14:57:30 +0200
committerMax Kellermann <max@musicpd.org>2019-04-24 14:57:30 +0200
commitc7c303eec3d53e65ee599f1863f66cb0e1deba91 (patch)
tree8eee4ba9f882ef07979b52577f78b546036ca3c8
parent1b62adc89406dbb5822c225b80f6cfe51168db19 (diff)
db/DatabaseListener: add `noexcept`
-rw-r--r--src/Instance.cxx4
-rw-r--r--src/Instance.hxx5
-rw-r--r--src/db/DatabaseListener.hxx4
-rw-r--r--test/DumpDatabase.cxx4
4 files changed, 9 insertions, 8 deletions
diff --git a/src/Instance.cxx b/src/Instance.cxx
index c2032aa7c..5b6600420 100644
--- a/src/Instance.cxx
+++ b/src/Instance.cxx
@@ -88,7 +88,7 @@ Instance::GetDatabaseOrThrow() const
}
void
-Instance::OnDatabaseModified()
+Instance::OnDatabaseModified() noexcept
{
assert(database != nullptr);
@@ -101,7 +101,7 @@ Instance::OnDatabaseModified()
}
void
-Instance::OnDatabaseSongRemoved(const char *uri)
+Instance::OnDatabaseSongRemoved(const char *uri) noexcept
{
assert(database != nullptr);
diff --git a/src/Instance.hxx b/src/Instance.hxx
index a2fd0d82b..f3c772931 100644
--- a/src/Instance.hxx
+++ b/src/Instance.hxx
@@ -178,8 +178,9 @@ struct Instance final
private:
#ifdef ENABLE_DATABASE
- void OnDatabaseModified() override;
- void OnDatabaseSongRemoved(const char *uri) override;
+ /* virtual methods from class DatabaseListener */
+ void OnDatabaseModified() noexcept override;
+ void OnDatabaseSongRemoved(const char *uri) noexcept override;
#endif
#ifdef ENABLE_NEIGHBOR_PLUGINS
diff --git a/src/db/DatabaseListener.hxx b/src/db/DatabaseListener.hxx
index cad39414a..8b0ab5c08 100644
--- a/src/db/DatabaseListener.hxx
+++ b/src/db/DatabaseListener.hxx
@@ -34,13 +34,13 @@ public:
* thread that has created the #Database instance and that
* runs the #EventLoop.
*/
- virtual void OnDatabaseModified() = 0;
+ virtual void OnDatabaseModified() noexcept = 0;
/**
* During database update, a song is about to be removed from
* the database because the file has disappeared.
*/
- virtual void OnDatabaseSongRemoved(const char *uri) = 0;
+ virtual void OnDatabaseSongRemoved(const char *uri) noexcept = 0;
};
#endif
diff --git a/test/DumpDatabase.cxx b/test/DumpDatabase.cxx
index 76315c133..176829870 100644
--- a/test/DumpDatabase.cxx
+++ b/test/DumpDatabase.cxx
@@ -68,11 +68,11 @@ InputStream::LockRead(void *, size_t)
class MyDatabaseListener final : public DatabaseListener {
public:
- virtual void OnDatabaseModified() override {
+ virtual void OnDatabaseModified() noexcept override {
cout << "DatabaseModified" << endl;
}
- virtual void OnDatabaseSongRemoved(const char *uri) override {
+ virtual void OnDatabaseSongRemoved(const char *uri) noexcept override {
cout << "SongRemoved " << uri << endl;
}
};