From a8b36b5637acb3fa8eb29ef0f45bd11653f412fa Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 16 Aug 2008 03:23:15 +0000 Subject: 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 --- src/libs/shared/Makefile.am | 8 +++++--- src/libs/shared/Store.hpp | 17 +++++++++-------- 2 files changed, 14 insertions(+), 11 deletions(-) (limited to 'src/libs/shared') 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 #include #include "interface/GraphObject.hpp" using Raul::PathTable; -using Raul::Path; namespace Ingen { namespace Shared { -class Store { +class Store : public Raul::PathTable< SharedPtr > { public: - typedef Raul::PathTable< SharedPtr > 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 > Objects; - virtual Objects::const_iterator children_begin(SharedPtr o) const = 0; - virtual Objects::const_iterator children_end(SharedPtr o) const = 0; + const_iterator children_begin(SharedPtr o) const; + const_iterator children_end(SharedPtr o) const; + + SharedPtr find_child(SharedPtr parent, + const std::string& child_name) const; }; -- cgit v1.2.1