summaryrefslogtreecommitdiffstats
path: root/src/server/GraphImpl.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/GraphImpl.hpp')
-rw-r--r--src/server/GraphImpl.hpp45
1 files changed, 22 insertions, 23 deletions
diff --git a/src/server/GraphImpl.hpp b/src/server/GraphImpl.hpp
index cbbd57de..c5f978fb 100644
--- a/src/server/GraphImpl.hpp
+++ b/src/server/GraphImpl.hpp
@@ -1,6 +1,6 @@
/*
This file is part of Ingen.
- Copyright 2007-2015 David Robillard <http://drobilla.net/>
+ Copyright 2007-2023 David Robillard <http://drobilla.net/>
Ingen is free software: you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License as published by the Free
@@ -20,9 +20,9 @@
#include "BlockImpl.hpp"
#include "DuplexPort.hpp"
#include "ThreadManager.hpp"
+#include "server.h"
#include "types.hpp"
-#include "ingen/Node.hpp"
#include "lv2/urid/urid.h"
#include "raul/Maid.hpp"
@@ -33,24 +33,21 @@
#include <memory>
#include <utility>
+// IWYU pragma: no_include "CompiledGraph.hpp"
+
namespace raul {
class Symbol;
} // namespace raul
-namespace boost {
-namespace intrusive {
-
+namespace boost::intrusive {
template <bool Enabled> struct constant_time_size;
+} // namespace boost::intrusive
-} // namespace intrusive
-} // namespace boost
-
-namespace ingen {
-namespace server {
+namespace ingen::server {
class ArcImpl;
class BufferFactory;
-class CompiledGraph;
+class CompiledGraph; // IWYU pragma: keep
class Engine;
class PortImpl;
class RunContext;
@@ -63,7 +60,7 @@ class RunContext;
*
* \ingroup engine
*/
-class GraphImpl final : public BlockImpl
+class INGEN_SERVER_API GraphImpl final : public BlockImpl
{
public:
GraphImpl(Engine& engine,
@@ -184,7 +181,8 @@ public:
bool has_arc(const PortImpl* tail, const PortImpl* dst_port) const;
/** Set a new compiled graph to run, and return the old one. */
- void set_compiled_graph(raul::managed_ptr<CompiledGraph>&& cg);
+ [[nodiscard]] std::unique_ptr<CompiledGraph>
+ swap_compiled_graph(std::unique_ptr<CompiledGraph> cg);
const raul::managed_ptr<Ports>& external_ports() { return _ports; }
@@ -203,17 +201,18 @@ public:
Engine& engine() { return _engine; }
private:
- Engine& _engine;
- uint32_t _poly_pre; ///< Pre-process thread only
- uint32_t _poly_process; ///< Process thread only
- raul::managed_ptr<CompiledGraph> _compiled_graph; ///< Process thread only
- PortList _inputs; ///< Pre-process thread only
- PortList _outputs; ///< Pre-process thread only
- Blocks _blocks; ///< Pre-process thread only
- bool _process; ///< True iff graph is enabled
+ using CompiledGraphPtr = std::unique_ptr<CompiledGraph>;
+
+ Engine& _engine;
+ uint32_t _poly_pre; ///< Pre-process thread only
+ uint32_t _poly_process; ///< Process thread only
+ CompiledGraphPtr _compiled_graph; ///< Process thread only
+ PortList _inputs; ///< Pre-process thread only
+ PortList _outputs; ///< Pre-process thread only
+ Blocks _blocks; ///< Pre-process thread only
+ bool _process{false}; ///< True iff graph is enabled
};
-} // namespace server
-} // namespace ingen
+} // namespace ingen::server
#endif // INGEN_ENGINE_GRAPHIMPL_HPP