diff options
author | David Robillard <d@drobilla.net> | 2008-08-16 03:23:15 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2008-08-16 03:23:15 +0000 |
commit | a8b36b5637acb3fa8eb29ef0f45bd11653f412fa (patch) | |
tree | 3a0f0dbef302269f8e509d9f5c2d4c713e00face /src/libs/shared | |
parent | 49e8582cb6720d43389e7d2534be11a4fb0b8959 (diff) | |
download | ingen-a8b36b5637acb3fa8eb29ef0f45bd11653f412fa.tar.gz ingen-a8b36b5637acb3fa8eb29ef0f45bd11653f412fa.tar.bz2 ingen-a8b36b5637acb3fa8eb29ef0f45bd11653f412fa.zip |
Factor out common store functionality.
Make store is-a Table and ditch store->objects() thing everywhere.
Use a separate store in the client (fix ingen -eg).
git-svn-id: http://svn.drobilla.net/lad/ingen@1397 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/shared')
-rw-r--r-- | src/libs/shared/Makefile.am | 8 | ||||
-rw-r--r-- | src/libs/shared/Store.hpp | 17 |
2 files changed, 14 insertions, 11 deletions
diff --git a/src/libs/shared/Makefile.am b/src/libs/shared/Makefile.am index e6cbee60..6a073148 100644 --- a/src/libs/shared/Makefile.am +++ b/src/libs/shared/Makefile.am @@ -1,9 +1,11 @@ noinst_LTLIBRARIES = libingen_shared.la -libingen_shared_la_CXXFLAGS = @INGEN_CFLAGS@ @REDLANDMM_CFLAGS@ @SLV2_CFLAGS@ +libingen_shared_la_CXXFLAGS = @INGEN_CFLAGS@ @REDLANDMM_CFLAGS@ @SLV2_CFLAGS@ @RAUL_CFLAGS@ libingen_shared_la_SOURCES = \ - LV2Features.hpp \ LV2Features.cpp \ + LV2Features.hpp \ LV2URIMap.cpp \ - LV2URIMap.hpp + LV2URIMap.hpp \ + Store.cpp \ + Store.hpp diff --git a/src/libs/shared/Store.hpp b/src/libs/shared/Store.hpp index 428945b9..ec29e7c0 100644 --- a/src/libs/shared/Store.hpp +++ b/src/libs/shared/Store.hpp @@ -18,26 +18,27 @@ #ifndef COMMON_STORE_H #define COMMON_STORE_H +#include <string> #include <raul/PathTable.hpp> #include "interface/GraphObject.hpp" using Raul::PathTable; -using Raul::Path; namespace Ingen { namespace Shared { -class Store { +class Store : public Raul::PathTable< SharedPtr<Shared::GraphObject> > { public: - typedef Raul::PathTable< SharedPtr<Shared::GraphObject> > Objects; - virtual const Objects& objects() const = 0; - - virtual Objects::iterator find(const Path& path) = 0; virtual void add(GraphObject* o) = 0; + + typedef Raul::Table< Raul::Path, SharedPtr<Shared::GraphObject> > Objects; - virtual Objects::const_iterator children_begin(SharedPtr<Shared::GraphObject> o) const = 0; - virtual Objects::const_iterator children_end(SharedPtr<Shared::GraphObject> o) const = 0; + const_iterator children_begin(SharedPtr<Shared::GraphObject> o) const; + const_iterator children_end(SharedPtr<Shared::GraphObject> o) const; + + SharedPtr<Shared::GraphObject> find_child(SharedPtr<Shared::GraphObject> parent, + const std::string& child_name) const; }; |