diff options
Diffstat (limited to 'ingen/Store.hpp')
-rw-r--r-- | ingen/Store.hpp | 33 |
1 files changed, 25 insertions, 8 deletions
diff --git a/ingen/Store.hpp b/ingen/Store.hpp index d9a52102..1f0ca1c8 100644 --- a/ingen/Store.hpp +++ b/ingen/Store.hpp @@ -33,23 +33,38 @@ namespace Ingen { */ class INGEN_API Store : public Raul::Noncopyable , public Raul::Deletable - , public std::map< const Raul::Path, SPtr<Node> > { + , public std::map< const Raul::URI, SPtr<Node> > { public: void add(Node* o); - Node* get(const Raul::Path& path) { - const iterator i = find(path); + Node* get(const Raul::URI& uri) { + const iterator i = find(uri); return (i == end()) ? NULL : i->second.get(); } - typedef std::pair<const_iterator, const_iterator> const_range; + Node* get(const Raul::Path& path) { return get(path_to_uri(path)); } + + const_iterator find(const Raul::Path& path) const { + return find(path_to_uri(path)); + } - typedef std::map< Raul::Path, SPtr<Node> > Objects; + iterator find(const Raul::Path& path) { + return find(path_to_uri(path)); + } - iterator find_descendants_end(Store::iterator parent); - const_iterator find_descendants_end(Store::const_iterator parent) const; + const_iterator find(const Raul::URI& uri) const { + return std::map< const Raul::URI, SPtr<Node> >::find(uri); + } - const_range children_range(SPtr<const Node> o) const; + iterator find(const Raul::URI& uri) { + return std::map< const Raul::URI, SPtr<Node> >::find(uri); + } + + const_iterator find_first_child(SPtr<const Node> o) const; + + typedef std::pair<const_iterator, const_iterator> const_range; + + typedef std::map< Raul::URI, SPtr<Node> > Objects; /** Remove the object at `top` and all its children from the store. * @@ -75,6 +90,8 @@ public: Mutex& mutex() { return _mutex; } private: + iterator find_descendants_end(iterator parent); + Mutex _mutex; }; |