summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-08-17 03:20:42 +0000
committerDavid Robillard <d@drobilla.net>2008-08-17 03:20:42 +0000
commit3019b09099371b3fe568b7dcc3bb92203d800b1f (patch)
treeeed4a0cb4be627764beb262756085bd51d86add5 /src
parentd6823fa9b29bcff74ca180e6d389d8a21cf88d1f (diff)
downloadingen-3019b09099371b3fe568b7dcc3bb92203d800b1f.tar.gz
ingen-3019b09099371b3fe568b7dcc3bb92203d800b1f.tar.bz2
ingen-3019b09099371b3fe568b7dcc3bb92203d800b1f.zip
Rename 'Loader' 'Parser'.
git-svn-id: http://svn.drobilla.net/lad/ingen@1411 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r--src/libs/engine/HTTPEngineReceiver.cpp14
-rw-r--r--src/libs/gui/Configuration.cpp7
-rw-r--r--src/libs/gui/ThreadedLoader.cpp10
-rw-r--r--src/libs/gui/ThreadedLoader.hpp4
-rw-r--r--src/libs/module/World.hpp6
-rw-r--r--src/libs/serialisation/Makefile.am4
-rw-r--r--src/libs/serialisation/Parser.cpp (renamed from src/libs/serialisation/Loader.cpp)24
-rw-r--r--src/libs/serialisation/Parser.hpp (renamed from src/libs/serialisation/Loader.hpp)18
-rw-r--r--src/libs/serialisation/serialisation.cpp8
-rw-r--r--src/libs/serialisation/serialisation.hpp4
-rw-r--r--src/progs/ingen/main.cpp10
11 files changed, 53 insertions, 56 deletions
diff --git a/src/libs/engine/HTTPEngineReceiver.cpp b/src/libs/engine/HTTPEngineReceiver.cpp
index 7427f18d..4d57843b 100644
--- a/src/libs/engine/HTTPEngineReceiver.cpp
+++ b/src/libs/engine/HTTPEngineReceiver.cpp
@@ -26,7 +26,7 @@
#include "module/Module.hpp"
#include "serialisation/serialisation.hpp"
#include "serialisation/Serialiser.hpp"
-#include "serialisation/Loader.hpp"
+#include "serialisation/Parser.hpp"
#include "engine/ThreadManager.hpp"
#include "HTTPEngineReceiver.hpp"
#include "QueuedEventSource.hpp"
@@ -58,9 +58,9 @@ HTTPEngineReceiver::HTTPEngineReceiver(Engine& engine, uint16_t port)
engine.world()->serialiser = SharedPtr<Serialiser>(
Ingen::Serialisation::new_serialiser(engine.world(), engine.engine_store()));
- if (!engine.world()->loader)
- engine.world()->loader = SharedPtr<Loader>(
- Ingen::Serialisation::new_loader());
+ if (!engine.world()->parser)
+ engine.world()->parser = SharedPtr<Parser>(
+ Ingen::Serialisation::new_parser());
} else {
cerr << "WARNING: Failed to load ingen_serialisation module, HTTP disabled." << endl;
}
@@ -165,9 +165,9 @@ HTTPEngineReceiver::message_callback(SoupServer* server, SoupMessage* msg, const
return;
}
- // Get loader
- SharedPtr<Loader> loader = me->_engine.world()->loader;
- if (!loader) {
+ // Get parser
+ SharedPtr<Parser> parser = me->_engine.world()->parser;
+ if (!parser) {
soup_message_set_status (msg, SOUP_STATUS_INTERNAL_SERVER_ERROR);
return;
}
diff --git a/src/libs/gui/Configuration.cpp b/src/libs/gui/Configuration.cpp
index 36d5ad75..a442b37c 100644
--- a/src/libs/gui/Configuration.cpp
+++ b/src/libs/gui/Configuration.cpp
@@ -23,13 +23,10 @@
#include <map>
#include "client/PortModel.hpp"
#include "client/PluginModel.hpp"
-#include "client/PatchModel.hpp"
-#include "serialisation/Loader.hpp"
+#include "serialisation/Parser.hpp"
#include "App.hpp"
-using std::cerr; using std::cout; using std::endl;
-using std::map; using std::string;
-using Ingen::Client::PatchModel;
+using namespace std;
namespace Ingen {
namespace GUI {
diff --git a/src/libs/gui/ThreadedLoader.cpp b/src/libs/gui/ThreadedLoader.cpp
index 0247529d..8c8af828 100644
--- a/src/libs/gui/ThreadedLoader.cpp
+++ b/src/libs/gui/ThreadedLoader.cpp
@@ -44,16 +44,16 @@ ThreadedLoader::ThreadedLoader(SharedPtr<EngineInterface> engine)
world->serialisation_module = Ingen::Shared::load_module("ingen_serialisation");
if (world->serialisation_module) {
- Loader* (*new_loader)() = NULL;
+ Parser* (*new_parser)() = NULL;
bool found = App::instance().world()->serialisation_module->get_symbol(
- "new_loader", (void*&)new_loader);
+ "new_parser", (void*&)new_parser);
if (found)
- _loader = SharedPtr<Loader>(new_loader());
+ _parser = SharedPtr<Parser>(new_parser());
}
- if (_loader)
+ if (_parser)
start();
else
cerr << "WARNING: Failed to load ingen_serialisation module, load disabled." << endl;
@@ -99,7 +99,7 @@ ThreadedLoader::load_patch(bool merge,
false)));
} else {
_events.push_back(sigc::hide_return(sigc::bind(
- sigc::mem_fun(_loader.get(), &Ingen::Serialisation::Loader::load),
+ sigc::mem_fun(_parser.get(), &Ingen::Serialisation::Parser::parse),
App::instance().world(),
App::instance().world()->engine.get(),
data_base_uri,
diff --git a/src/libs/gui/ThreadedLoader.hpp b/src/libs/gui/ThreadedLoader.hpp
index 6c095925..ea4f652d 100644
--- a/src/libs/gui/ThreadedLoader.hpp
+++ b/src/libs/gui/ThreadedLoader.hpp
@@ -29,7 +29,7 @@
#include "client/PatchModel.hpp"
#include "client/DeprecatedLoader.hpp"
#include "serialisation/Serialiser.hpp"
-#include "serialisation/Loader.hpp"
+#include "serialisation/Parser.hpp"
using std::string;
using std::list;
using boost::optional;
@@ -80,7 +80,7 @@ private:
void _whipped();
SharedPtr<EngineInterface> _engine;
- SharedPtr<Loader> _loader;
+ SharedPtr<Parser> _parser;
DeprecatedLoader _deprecated_loader;
Glib::Mutex _mutex;
diff --git a/src/libs/module/World.hpp b/src/libs/module/World.hpp
index a1a0d5c7..dbbac2bd 100644
--- a/src/libs/module/World.hpp
+++ b/src/libs/module/World.hpp
@@ -34,9 +34,9 @@ namespace Redland { class World; }
namespace Ingen {
class Engine;
-namespace Serialisation { class Serialiser; class Loader; }
+namespace Serialisation { class Serialiser; class Parser; }
using Serialisation::Serialiser;
-using Serialisation::Loader;
+using Serialisation::Parser;
namespace Shared {
class EngineInterface;
@@ -64,7 +64,7 @@ struct World {
SharedPtr<EngineInterface> engine;
SharedPtr<Engine> local_engine;
SharedPtr<Serialiser> serialiser;
- SharedPtr<Loader> loader;
+ SharedPtr<Parser> parser;
SharedPtr<Store> store;
SharedPtr<Glib::Module> serialisation_module;
diff --git a/src/libs/serialisation/Makefile.am b/src/libs/serialisation/Makefile.am
index 3121cec3..57e99055 100644
--- a/src/libs/serialisation/Makefile.am
+++ b/src/libs/serialisation/Makefile.am
@@ -15,8 +15,8 @@ libingen_serialisation_la_LDFLAGS = -no-undefined -module -avoid-version
libingen_serialisation_la_LIBADD = @RAUL_LIBS@ @REDLANDMM_LIBS@ @GLIBMM_LIBS@ @SLV2_LIBS@
libingen_serialisation_la_SOURCES = \
- Loader.cpp \
- Loader.hpp \
+ Parser.cpp \
+ Parser.hpp \
Serialiser.cpp \
Serialiser.hpp \
serialisation.cpp \
diff --git a/src/libs/serialisation/Loader.cpp b/src/libs/serialisation/Parser.cpp
index b0d919e0..8bd9bcbb 100644
--- a/src/libs/serialisation/Loader.cpp
+++ b/src/libs/serialisation/Parser.cpp
@@ -25,7 +25,7 @@
#include <raul/Atom.hpp>
#include <raul/AtomRDF.hpp>
#include "interface/EngineInterface.hpp"
-#include "Loader.hpp"
+#include "Parser.hpp"
using namespace std;
using namespace Raul;
@@ -35,20 +35,20 @@ namespace Ingen {
namespace Serialisation {
-/** Load (create) a patch from RDF into the engine.
+/** Parse a patch from RDF into a CommonInterface (engine or client).
*
* @param document_uri URI of file to load objects from.
* @param parent Path of parent under which to load objects.
* @return whether or not load was successful.
*/
bool
-Loader::load(Ingen::Shared::World* world,
- Ingen::Shared::CommonInterface* target,
- const Glib::ustring& document_uri,
- boost::optional<Raul::Path> parent,
- std::string patch_name,
- Glib::ustring patch_uri,
- GraphObject::Variables data)
+Parser::parse(Ingen::Shared::World* world,
+ Ingen::Shared::CommonInterface* target,
+ const Glib::ustring& document_uri,
+ boost::optional<Raul::Path> parent,
+ std::string patch_name,
+ Glib::ustring patch_uri,
+ GraphObject::Variables data)
{
setlocale(LC_NUMERIC, "C");
@@ -63,7 +63,7 @@ Loader::load(Ingen::Shared::World* world,
else
patch_uri = string("<") + patch_uri + ">";
- cout << "[Loader] Loading " << patch_uri << endl;
+ cout << "[Parser] Loading " << patch_uri << endl;
size_t patch_poly = 1;
@@ -82,7 +82,7 @@ Loader::load(Ingen::Shared::World* world,
Redland::Query::Results results = query.run(*world->rdf_world, model);
if (results.size() == 0) {
- cerr << "[Loader] ERROR: No polyphony found!" << endl;
+ cerr << "[Parser] ERROR: No polyphony found!" << endl;
return false;
}
@@ -186,7 +186,7 @@ Loader::load(Ingen::Shared::World* world,
if (created.find(subpatch_path) == created.end()) {
created.insert(subpatch_path);
- load(world, target, document_uri, patch_path, name, patch);
+ parse(world, target, document_uri, patch_path, name, patch);
}
}
diff --git a/src/libs/serialisation/Loader.hpp b/src/libs/serialisation/Parser.hpp
index 9220e4c9..18d59bf2 100644
--- a/src/libs/serialisation/Loader.hpp
+++ b/src/libs/serialisation/Parser.hpp
@@ -36,17 +36,17 @@ namespace Ingen {
namespace Serialisation {
-class Loader {
+class Parser {
public:
- virtual ~Loader() {}
+ virtual ~Parser() {}
- virtual bool load(Ingen::Shared::World* world,
- Ingen::Shared::CommonInterface* target,
- const Glib::ustring& uri,
- boost::optional<Raul::Path> parent,
- std::string patch_name,
- Glib::ustring patch_uri = "",
- GraphObject::Variables data = GraphObject::Variables());
+ virtual bool parse(Ingen::Shared::World* world,
+ Ingen::Shared::CommonInterface* target,
+ const Glib::ustring& uri,
+ boost::optional<Raul::Path> parent,
+ std::string patch_name,
+ Glib::ustring patch_uri = "",
+ GraphObject::Variables data = GraphObject::Variables());
};
diff --git a/src/libs/serialisation/serialisation.cpp b/src/libs/serialisation/serialisation.cpp
index 3ece3772..1d08e76c 100644
--- a/src/libs/serialisation/serialisation.cpp
+++ b/src/libs/serialisation/serialisation.cpp
@@ -18,17 +18,17 @@
#include CONFIG_H_PATH
#include "module/World.hpp"
#include "serialisation.hpp"
-#include "Loader.hpp"
+#include "Parser.hpp"
#include "Serialiser.hpp"
namespace Ingen {
namespace Serialisation {
-Ingen::Serialisation::Loader*
-new_loader()
+Ingen::Serialisation::Parser*
+new_parser()
{
- return new Loader();
+ return new Parser();
}
diff --git a/src/libs/serialisation/serialisation.hpp b/src/libs/serialisation/serialisation.hpp
index abae159c..a250945b 100644
--- a/src/libs/serialisation/serialisation.hpp
+++ b/src/libs/serialisation/serialisation.hpp
@@ -24,13 +24,13 @@ namespace Shared { class World; class Store; }
namespace Serialisation {
-class Loader;
+class Parser;
class Serialiser;
extern "C" {
- extern Loader* new_loader();
+ extern Parser* new_parser();
extern Serialiser* new_serialiser(Ingen::Shared::World* world,
SharedPtr<Shared::Store> store);
diff --git a/src/progs/ingen/main.cpp b/src/progs/ingen/main.cpp
index 9715e12f..657e942d 100644
--- a/src/progs/ingen/main.cpp
+++ b/src/progs/ingen/main.cpp
@@ -33,7 +33,7 @@
#include "module/World.hpp"
#include "engine/Engine.hpp"
#include "engine/QueuedEngineInterface.hpp"
-#include "serialisation/Loader.hpp"
+#include "serialisation/Parser.hpp"
#include "cmdline.h"
#ifdef WITH_BINDINGS
@@ -164,13 +164,13 @@ main(int argc, char** argv)
if (!world->serialisation_module)
world->serialisation_module = Ingen::Shared::load_module("ingen_serialisation");
- Serialisation::Loader* (*new_loader)() = NULL;
+ Serialisation::Parser* (*new_parser)() = NULL;
if (world->serialisation_module)
- found = world->serialisation_module->get_symbol("new_loader", (void*&)new_loader);
+ found = world->serialisation_module->get_symbol("new_parser", (void*&)new_parser);
if (world->serialisation_module && found) {
- SharedPtr<Serialisation::Loader> loader(new_loader());
+ SharedPtr<Serialisation::Parser> parser(new_parser());
// Assumption: Containing ':' means URI, otherwise filename
string uri = args.load_arg;
@@ -184,7 +184,7 @@ main(int argc, char** argv)
engine_interface->load_plugins();
- loader->load(world, engine_interface.get(), uri, parent_path, "");
+ parser->parse(world, engine_interface.get(), uri, parent_path, "");
} else {
cerr << "Unable to load serialisation module, aborting." << endl;