From cc384f6f622cc10fd83616256080b80dc2123aaf Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 14 Sep 2006 02:27:02 +0000 Subject: Cleaned up client-side model code significantly (made everything private so only Store can change the state of models). Extremely broken, just committing to move code between machines :). git-svn-id: http://svn.drobilla.net/lad/ingen@133 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/client/ConnectionModel.h | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'src/libs/client/ConnectionModel.h') diff --git a/src/libs/client/ConnectionModel.h b/src/libs/client/ConnectionModel.h index fe244649..4c0d18f8 100644 --- a/src/libs/client/ConnectionModel.h +++ b/src/libs/client/ConnectionModel.h @@ -14,7 +14,6 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ - #ifndef CONNECTIONMODEL_H #define CONNECTIONMODEL_H @@ -28,6 +27,8 @@ using std::string; namespace Ingen { namespace Client { +class Store; + /** Class to represent a port->port connection in the engine. * @@ -42,23 +43,25 @@ namespace Client { class ConnectionModel { public: - ConnectionModel(const Path& src_port, const Path& dst_port); - ConnectionModel(CountedPtr src, CountedPtr dst); - CountedPtr src_port() const { return _src_port; } CountedPtr dst_port() const { return _dst_port; } - void set_src_port(CountedPtr port) { _src_port = port; _src_port_path = port->path(); } - void set_dst_port(CountedPtr port) { _dst_port = port; _dst_port_path = port->path(); } - - void src_port_path(const string& s) { _src_port_path = s; } - void dst_port_path(const string& s) { _dst_port_path = s; } - const Path& src_port_path() const; const Path& dst_port_path() const; const Path patch_path() const; private: + friend class Store; + + ConnectionModel(const Path& src_port, const Path& dst_port); + ConnectionModel(CountedPtr src, CountedPtr dst); + + void set_src_port(CountedPtr port) { _src_port = port; _src_port_path = port->path(); } + void set_dst_port(CountedPtr port) { _dst_port = port; _dst_port_path = port->path(); } + + void src_port_path(const string& s) { _src_port_path = s; } + void dst_port_path(const string& s) { _dst_port_path = s; } + Path _src_port_path; ///< Only used if _src_port == NULL Path _dst_port_path; ///< Only used if _dst_port == NULL CountedPtr _src_port; -- cgit v1.2.1