summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2022-12-13 01:21:23 -0500
committerDavid Robillard <d@drobilla.net>2022-12-14 18:04:27 -0500
commit513296b868df8a3c5a55290d3146cba017418926 (patch)
tree995f1325f06d731a2c86627330d36b6453867334 /src
parentfa611574101cd657a0716aaf2028b5bc852d4a8a (diff)
downloadingen-513296b868df8a3c5a55290d3146cba017418926.tar.gz
ingen-513296b868df8a3c5a55290d3146cba017418926.tar.bz2
ingen-513296b868df8a3c5a55290d3146cba017418926.zip
Use std::variant
Diffstat (limited to 'src')
-rw-r--r--src/AtomWriter.cpp5
-rw-r--r--src/SocketWriter.cpp5
-rw-r--r--src/client/ClientStore.cpp4
-rw-r--r--src/gui/App.cpp10
-rw-r--r--src/gui/BreadCrumbs.cpp4
-rw-r--r--src/gui/ConnectWindow.cpp6
-rw-r--r--src/server/EventWriter.cpp4
7 files changed, 18 insertions, 20 deletions
diff --git a/src/AtomWriter.cpp b/src/AtomWriter.cpp
index e8418de1..604bafdc 100644
--- a/src/AtomWriter.cpp
+++ b/src/AtomWriter.cpp
@@ -64,13 +64,12 @@
#include "raul/Path.hpp"
#include "serd/serd.h"
-#include <boost/variant/apply_visitor.hpp>
-
#include <cassert>
#include <cstdint>
#include <map>
#include <string>
#include <utility>
+#include <variant>
namespace ingen {
@@ -92,7 +91,7 @@ AtomWriter::finish_msg()
void
AtomWriter::message(const Message& message)
{
- boost::apply_visitor(*this, message);
+ std::visit(*this, message);
}
/** @page protocol
diff --git a/src/SocketWriter.cpp b/src/SocketWriter.cpp
index c705ed96..6bbab6cb 100644
--- a/src/SocketWriter.cpp
+++ b/src/SocketWriter.cpp
@@ -19,11 +19,10 @@
#include "ingen/URI.hpp"
#include "raul/Socket.hpp"
-#include <boost/variant/get.hpp>
-
#include <memory>
#include <sys/socket.h>
#include <utility>
+#include <variant>
#ifndef MSG_NOSIGNAL
# define MSG_NOSIGNAL 0
@@ -43,7 +42,7 @@ void
SocketWriter::message(const Message& message)
{
TurtleWriter::message(message);
- if (boost::get<BundleEnd>(&message)) {
+ if (std::get_if<BundleEnd>(&message)) {
// Send a null byte to indicate end of bundle
const char end[] = { 0 };
send(_socket->fd(), end, 1, MSG_NOSIGNAL);
diff --git a/src/client/ClientStore.cpp b/src/client/ClientStore.cpp
index 80143265..02f28324 100644
--- a/src/client/ClientStore.cpp
+++ b/src/client/ClientStore.cpp
@@ -33,7 +33,6 @@
#include "ingen/paths.hpp"
#include "raul/Path.hpp"
-#include <boost/variant/apply_visitor.hpp>
#include <sigc++/functors/mem_fun.h>
#include <cassert>
@@ -41,6 +40,7 @@
#include <memory>
#include <string>
#include <utility>
+#include <variant>
namespace ingen {
namespace client {
@@ -244,7 +244,7 @@ ClientStore::operator()(const Move& msg)
void
ClientStore::message(const Message& msg)
{
- boost::apply_visitor(*this, msg);
+ std::visit(*this, msg);
}
void
diff --git a/src/gui/App.cpp b/src/gui/App.cpp
index ff9636b9..7ec6014e 100644
--- a/src/gui/App.cpp
+++ b/src/gui/App.cpp
@@ -47,7 +47,6 @@
#include "lilv/lilv.h"
#include "suil/suil.h"
-#include <boost/variant/get.hpp>
#include <glib.h>
#include <glibmm/main.h>
#include <glibmm/miscutils.h>
@@ -73,6 +72,7 @@
#include <memory>
#include <string>
#include <utility>
+#include <variant>
namespace ingen {
namespace gui {
@@ -239,13 +239,13 @@ App::serialiser()
void
App::message(const Message& msg)
{
- if (const Response* const r = boost::get<Response>(&msg)) {
+ if (const Response* const r = std::get_if<Response>(&msg)) {
response(r->id, r->status, r->subject);
- } else if (const Error* const e = boost::get<Error>(&msg)) {
+ } else if (const Error* const e = std::get_if<Error>(&msg)) {
error_message(e->message);
- } else if (const Put* const p = boost::get<Put>(&msg)) {
+ } else if (const Put* const p = std::get_if<Put>(&msg)) {
put(p->uri, p->properties, p->ctx);
- } else if (const SetProperty* const s = boost::get<SetProperty>(&msg)) {
+ } else if (const SetProperty* const s = std::get_if<SetProperty>(&msg)) {
property_change(s->subject, s->predicate, s->value, s->ctx);
}
}
diff --git a/src/gui/BreadCrumbs.cpp b/src/gui/BreadCrumbs.cpp
index 46a0757a..942b88f5 100644
--- a/src/gui/BreadCrumbs.cpp
+++ b/src/gui/BreadCrumbs.cpp
@@ -22,12 +22,12 @@
#include "ingen/client/SigClientInterface.hpp"
#include "raul/Symbol.hpp"
-#include <boost/variant/get.hpp>
#include <glibmm/signalproxy.h>
#include <sigc++/adaptors/bind.h>
#include <sigc++/functors/mem_fun.h>
#include <string>
+#include <variant>
namespace ingen {
namespace gui {
@@ -196,7 +196,7 @@ BreadCrumbs::breadcrumb_clicked(BreadCrumb* crumb)
void
BreadCrumbs::message(const Message& msg)
{
- if (const Del* const del = boost::get<Del>(&msg)) {
+ if (const Del* const del = std::get_if<Del>(&msg)) {
object_destroyed(del->uri);
}
}
diff --git a/src/gui/ConnectWindow.cpp b/src/gui/ConnectWindow.cpp
index a4c8a433..4569acec 100644
--- a/src/gui/ConnectWindow.cpp
+++ b/src/gui/ConnectWindow.cpp
@@ -37,7 +37,6 @@
#include "raul/Path.hpp"
#include "raul/Process.hpp"
-#include <boost/variant/get.hpp>
#include <glib.h>
#include <glibmm/main.h>
#include <glibmm/signalproxy.h>
@@ -62,6 +61,7 @@
#include <string>
#include <sys/time.h>
#include <utility>
+#include <variant>
namespace ingen {
namespace gui {
@@ -75,9 +75,9 @@ ConnectWindow::ConnectWindow(BaseObjectType* cobject,
void
ConnectWindow::message(const Message& msg)
{
- if (const Response* const r = boost::get<Response>(&msg)) {
+ if (const Response* const r = std::get_if<Response>(&msg)) {
ingen_response(r->id, r->status, r->subject);
- } else if (const Error* const e = boost::get<Error>(&msg)) {
+ } else if (const Error* const e = std::get_if<Error>(&msg)) {
error(e->message);
}
}
diff --git a/src/server/EventWriter.cpp b/src/server/EventWriter.cpp
index e9fb56a6..e61b7624 100644
--- a/src/server/EventWriter.cpp
+++ b/src/server/EventWriter.cpp
@@ -29,7 +29,7 @@
#include "events/Move.hpp"
#include "events/Undo.hpp"
-#include <boost/variant/apply_visitor.hpp>
+#include <variant>
namespace ingen {
namespace server {
@@ -47,7 +47,7 @@ EventWriter::now() const
void
EventWriter::message(const Message& msg)
{
- boost::apply_visitor(*this, msg);
+ std::visit(*this, msg);
}
void