diff options
author | David Robillard <d@drobilla.net> | 2006-09-11 11:10:35 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2006-09-11 11:10:35 +0000 |
commit | b15864870d34a1188eda93ad215734275037278e (patch) | |
tree | 224a1669a29091ea4198425d4a002e448cde8b30 /src/libs/client/ObjectModel.h | |
parent | 22bf43352ddfc48452d776f10ad4d12161255049 (diff) | |
download | ingen-b15864870d34a1188eda93ad215734275037278e.tar.gz ingen-b15864870d34a1188eda93ad215734275037278e.tar.bz2 ingen-b15864870d34a1188eda93ad215734275037278e.zip |
Switched homebrew CountedPtr to boost::shared_ptr.
Factories for patch windows, controller.
Robustness updated in many places.
Tons of cleanups, rewrites, bugfixes, etc.
git-svn-id: http://svn.drobilla.net/lad/ingen@128 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/client/ObjectModel.h')
-rw-r--r-- | src/libs/client/ObjectModel.h | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/src/libs/client/ObjectModel.h b/src/libs/client/ObjectModel.h index 9daccfd2..9ee4f8c4 100644 --- a/src/libs/client/ObjectModel.h +++ b/src/libs/client/ObjectModel.h @@ -26,6 +26,7 @@ #include <sigc++/sigc++.h> #include "util/Path.h" #include "util/CountedPtr.h" +#include "ObjectController.h" using std::string; using std::map; using std::find; using std::cout; using std::cerr; using std::endl; @@ -42,8 +43,8 @@ class ObjectController; class ObjectModel { public: - ObjectModel(const string& path); - ObjectModel() : m_path("/UNINITIALIZED"), m_parent(NULL) {} // FIXME: remove + ObjectModel(const Path& path); + ObjectModel() : m_path("/UNINITIALIZED") {} // FIXME: remove virtual ~ObjectModel() {} @@ -55,23 +56,24 @@ public: inline const Path& path() const { return m_path; } virtual void set_path(const Path& p) { m_path = p; } - CountedPtr<ObjectModel> parent() const { return m_parent; } + CountedPtr<ObjectModel> parent() const { return m_parent; } virtual void set_parent(CountedPtr<ObjectModel> p) { m_parent = p; } - ObjectController* controller() const { return m_controller; } - - void set_controller(ObjectController* c); + virtual void add_child(CountedPtr<ObjectModel> c) = 0; - // Convenience functions - string base_path() const; - const string name() const { return m_path.name(); } + CountedPtr<ObjectController> controller() const { return m_controller; } + void set_controller(CountedPtr<ObjectController> c); + + void assimilate(CountedPtr<ObjectModel> model); + // Signals sigc::signal<void, const string&, const string&> metadata_update_sig; + sigc::signal<void> destroyed_sig; protected: - Path m_path; - CountedPtr<ObjectModel> m_parent; - ObjectController* m_controller; // FIXME: remove + Path m_path; + CountedPtr<ObjectModel> m_parent; + CountedPtr<ObjectController> m_controller; map<string,string> m_metadata; |