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.hpp55
1 files changed, 27 insertions, 28 deletions
diff --git a/src/server/GraphImpl.hpp b/src/server/GraphImpl.hpp
index cbbd57de..6c852106 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,12 +20,13 @@
#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"
+#include <lv2/urid/urid.h>
+#include <raul/Maid.hpp>
+#include <boost/intrusive/options.hpp>
#include <boost/intrusive/slist.hpp>
#include <cassert>
@@ -37,16 +38,7 @@ namespace raul {
class Symbol;
} // namespace raul
-namespace boost {
-namespace intrusive {
-
-template <bool Enabled> struct constant_time_size;
-
-} // namespace intrusive
-} // namespace boost
-
-namespace ingen {
-namespace server {
+namespace ingen::server {
class ArcImpl;
class BufferFactory;
@@ -63,7 +55,7 @@ class RunContext;
*
* \ingroup engine
*/
-class GraphImpl final : public BlockImpl
+class INGEN_SERVER_API GraphImpl final : public BlockImpl
{
public:
GraphImpl(Engine& engine,
@@ -105,9 +97,14 @@ public:
* Audio thread.
*
* \param ctx Process context
+ *
* \param bufs New set of buffers
- * \param poly Must be < the most recent value passed to prepare_internal_poly.
- * \param maid Any objects no longer needed will be pushed to this
+ *
+ * \param poly Must be < the most recent value passed to
+ * prepare_internal_poly.
+ *
+ * \param maid Any objects no longer needed will be
+ * pushed to this
*/
bool apply_internal_poly(RunContext& ctx,
BufferFactory& bufs,
@@ -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