From df1447c665e6c3631961297a9d3e9aff4e94c47f Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 12 Jan 2013 23:38:03 +0000 Subject: Remove Raul::SharedPtr and switch to std::shared_ptr. Use project local short type aliases for shared_ptr and friends. Move Raul::Disposable and Raul::Manageable into Raul::Maid. Use sets to store machina nodes and edges to avoid O(n) searches. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4939 a436a847-0d15-0410-975c-d299462d15a1 --- src/serialisation/Serialiser.cpp | 70 ++++++++++++++++++++-------------------- 1 file changed, 35 insertions(+), 35 deletions(-) (limited to 'src/serialisation/Serialiser.cpp') diff --git a/src/serialisation/Serialiser.cpp b/src/serialisation/Serialiser.cpp index 0bd6b49b..41ae45dc 100644 --- a/src/serialisation/Serialiser.cpp +++ b/src/serialisation/Serialiser.cpp @@ -66,12 +66,12 @@ struct Serialiser::Impl { void start_to_filename(const std::string& filename); - void serialise_graph(SharedPtr p, - const Sord::Node& id); + void serialise_graph(SPtr p, + const Sord::Node& id); - void serialise_block(SharedPtr n, - const Sord::Node& class_id, - const Sord::Node& id); + void serialise_block(SPtr n, + const Sord::Node& class_id, + const Sord::Node& id); void serialise_port(const Node* p, Resource::Graph context, @@ -80,17 +80,17 @@ struct Serialiser::Impl { void serialise_properties(Sord::Node id, const Resource::Properties& props); - void write_bundle(SharedPtr graph, - const std::string& uri); + void write_bundle(SPtr graph, + const std::string& uri); Sord::Node path_rdf_node(const Raul::Path& path); - void write_manifest(const std::string& bundle_path, - SharedPtr graph, - const std::string& graph_symbol); + void write_manifest(const std::string& bundle_path, + SPtr graph, + const std::string& graph_symbol); - void serialise_arc(const Sord::Node& parent, - SharedPtr a) + void serialise_arc(const Sord::Node& parent, + SPtr a) throw (std::logic_error); std::string finish(); @@ -113,8 +113,8 @@ Serialiser::~Serialiser() } void -Serialiser::to_file(SharedPtr object, - const std::string& filename) +Serialiser::to_file(SPtr object, + const std::string& filename) { me->_root_path = object->path(); me->start_to_filename(filename); @@ -123,9 +123,9 @@ Serialiser::to_file(SharedPtr object, } void -Serialiser::Impl::write_manifest(const std::string& bundle_path, - SharedPtr graph, - const std::string& graph_symbol) +Serialiser::Impl::write_manifest(const std::string& bundle_path, + SPtr graph, + const std::string& graph_symbol) { const string manifest_path(Glib::build_filename(bundle_path, "manifest.ttl")); const string binary_path(Glib::Module::build_path("", "ingen_lv2")); @@ -158,15 +158,15 @@ Serialiser::Impl::write_manifest(const std::string& bundle_path, } void -Serialiser::write_bundle(SharedPtr graph, - const std::string& path) +Serialiser::write_bundle(SPtr graph, + const std::string& path) { me->write_bundle(graph, path); } void -Serialiser::Impl::write_bundle(SharedPtr graph, - const std::string& a_path) +Serialiser::Impl::write_bundle(SPtr graph, + const std::string& a_path) { std::string path = Glib::filename_from_uri(a_path); if (Glib::file_test(path, Glib::FILE_TEST_EXISTS) @@ -195,8 +195,8 @@ Serialiser::Impl::write_bundle(SharedPtr graph, } string -Serialiser::to_string(SharedPtr object, - const string& base_uri) +Serialiser::to_string(SPtr object, + const string& base_uri) { start_to_string(object->path(), base_uri); serialise(object); @@ -279,7 +279,7 @@ Serialiser::Impl::path_rdf_node(const Raul::Path& path) } void -Serialiser::serialise(SharedPtr object) throw (std::logic_error) +Serialiser::serialise(SPtr object) throw (std::logic_error) { if (!me->_model) throw std::logic_error("serialise called without serialisation in progress"); @@ -300,8 +300,8 @@ Serialiser::serialise(SharedPtr object) throw (std::logic_error) } void -Serialiser::Impl::serialise_graph(SharedPtr graph, - const Sord::Node& graph_id) +Serialiser::Impl::serialise_graph(SPtr graph, + const Sord::Node& graph_id) { Sord::World& world = _model->world(); const URIs& uris = _world.uris(); @@ -354,7 +354,7 @@ Serialiser::Impl::serialise_graph(SharedPtr graph, continue; if (n->second->graph_type() == Node::GraphType::GRAPH) { - SharedPtr subgraph = n->second; + SPtr subgraph = n->second; SerdURI base_uri; serd_uri_parse((const uint8_t*)_base_uri.c_str(), &base_uri); @@ -387,7 +387,7 @@ Serialiser::Impl::serialise_graph(SharedPtr graph, block_id); serialise_block(subgraph, subgraph_id, block_id); } else if (n->second->graph_type() == Node::GraphType::BLOCK) { - SharedPtr block = n->second; + SPtr block = n->second; const Sord::URI class_id(world, block->plugin()->uri()); const Sord::Node block_id(path_rdf_node(n->second->path())); @@ -419,9 +419,9 @@ Serialiser::Impl::serialise_graph(SharedPtr graph, } void -Serialiser::Impl::serialise_block(SharedPtr block, - const Sord::Node& class_id, - const Sord::Node& block_id) +Serialiser::Impl::serialise_block(SPtr block, + const Sord::Node& class_id, + const Sord::Node& block_id) { const URIs& uris = _world.uris(); @@ -480,16 +480,16 @@ Serialiser::Impl::serialise_port(const Node* port, } void -Serialiser::serialise_arc(const Sord::Node& parent, - SharedPtr arc) +Serialiser::serialise_arc(const Sord::Node& parent, + SPtr arc) throw (std::logic_error) { return me->serialise_arc(parent, arc); } void -Serialiser::Impl::serialise_arc(const Sord::Node& parent, - SharedPtr arc) +Serialiser::Impl::serialise_arc(const Sord::Node& parent, + SPtr arc) throw (std::logic_error) { if (!_model) -- cgit v1.2.1