summaryrefslogtreecommitdiffstats
path: root/src/libs/client/PatchModel.hpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-08-17 07:04:34 +0000
committerDavid Robillard <d@drobilla.net>2008-08-17 07:04:34 +0000
commit988bcdbcd2438d09f2d2b3f34bcaa403d10c9007 (patch)
tree6593a332a84e599870807daefde1413f40feb6fe /src/libs/client/PatchModel.hpp
parente0743e9d9b15fb2731e26bf5700413c083a89186 (diff)
downloadingen-988bcdbcd2438d09f2d2b3f34bcaa403d10c9007.tar.gz
ingen-988bcdbcd2438d09f2d2b3f34bcaa403d10c9007.tar.bz2
ingen-988bcdbcd2438d09f2d2b3f34bcaa403d10c9007.zip
Copyable models.
git-svn-id: http://svn.drobilla.net/lad/ingen@1416 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/client/PatchModel.hpp')
-rw-r--r--src/libs/client/PatchModel.hpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/libs/client/PatchModel.hpp b/src/libs/client/PatchModel.hpp
index 8c60e884..b1c03cd0 100644
--- a/src/libs/client/PatchModel.hpp
+++ b/src/libs/client/PatchModel.hpp
@@ -43,7 +43,9 @@ class ClientStore;
class PatchModel : public NodeModel, public Ingen::Shared::Patch
{
public:
- const Connections& connections() const { return _connections; }
+ /* WARNING: Copy constructor creates a shallow copy WRT connections */
+
+ const Connections& connections() const { return *_connections.get(); }
SharedPtr<ConnectionModel> get_connection(const string& src_port_path,
const string& dst_port_path) const;
@@ -80,6 +82,7 @@ private:
PatchModel(const Path& patch_path, size_t internal_poly)
: NodeModel("ingen:Patch", patch_path)
+ , _connections(new Connections())
, _poly(internal_poly)
, _editable(true)
{
@@ -92,9 +95,9 @@ private:
void add_connection(SharedPtr<ConnectionModel> cm);
void remove_connection(const string& src_port_path, const string& dst_port_path);
- Connections _connections;
- uint32_t _poly;
- bool _editable;
+ SharedPtr<Connections> _connections;
+ uint32_t _poly;
+ bool _editable;
};
typedef Table<string, SharedPtr<PatchModel> > PatchModelMap;