From 8cfeaeba255ccea54f8345724e72adf53280e33d Mon Sep 17 00:00:00 2001 From: Tor Egge Date: Wed, 4 Apr 2018 11:45:55 +0000 Subject: Stop using nested typedef for shared pointer to const DocumentTypeRepo. --- searchcore/src/apps/tests/persistenceconformance_test.cpp | 10 +++++----- searchcore/src/apps/vespa-dump-feed/vespa-dump-feed.cpp | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'searchcore/src/apps') diff --git a/searchcore/src/apps/tests/persistenceconformance_test.cpp b/searchcore/src/apps/tests/persistenceconformance_test.cpp index 3840cfb7869..ea18f513535 100644 --- a/searchcore/src/apps/tests/persistenceconformance_test.cpp +++ b/searchcore/src/apps/tests/persistenceconformance_test.cpp @@ -88,16 +88,16 @@ struct SchemaConfigFactory { class ConfigFactory { private: - DocumentTypeRepo::SP _repo; + std::shared_ptr _repo; DocumenttypesConfigSP _typeCfg; SchemaConfigFactory::SP _schemaFactory; public: - ConfigFactory(const DocumentTypeRepo::SP &repo, + ConfigFactory(const std::shared_ptr &repo, const DocumenttypesConfigSP &typeCfg, const SchemaConfigFactory::SP &schemaFactory); ~ConfigFactory(); - const DocumentTypeRepo::SP getTypeRepo() const { return _repo; } + const std::shared_ptr getTypeRepo() const { return _repo; } const DocumenttypesConfigSP getTypeCfg() const { return _typeCfg; } DocTypeVector getDocTypes() const { DocTypeVector types; @@ -140,7 +140,7 @@ public: }; -ConfigFactory::ConfigFactory(const DocumentTypeRepo::SP &repo, const DocumenttypesConfigSP &typeCfg, +ConfigFactory::ConfigFactory(const std::shared_ptr &repo, const DocumenttypesConfigSP &typeCfg, const SchemaConfigFactory::SP &schemaFactory) : _repo(repo), _typeCfg(typeCfg), @@ -373,7 +373,7 @@ public: _writeFilter() { } - virtual PersistenceProvider::UP getPersistenceImplementation(const DocumentTypeRepo::SP &repo, + virtual PersistenceProvider::UP getPersistenceImplementation(const std::shared_ptr &repo, const DocumenttypesConfig &typesCfg) override { ConfigFactory cfgFactory(repo, DocumenttypesConfigSP(new DocumenttypesConfig(typesCfg)), _schemaFactory); _docDbRepo.reset(new DocumentDBRepo(cfgFactory, _docDbFactory)); diff --git a/searchcore/src/apps/vespa-dump-feed/vespa-dump-feed.cpp b/searchcore/src/apps/vespa-dump-feed/vespa-dump-feed.cpp index 4d6d63cf641..e63f8e1a57a 100644 --- a/searchcore/src/apps/vespa-dump-feed/vespa-dump-feed.cpp +++ b/searchcore/src/apps/vespa-dump-feed/vespa-dump-feed.cpp @@ -57,7 +57,7 @@ private: virtual void handleMessage(mbus::Message::UP message) override; public: - FeedHandler(document::DocumentTypeRepo::SP repo, OutputFile &idx, OutputFile &dat); + FeedHandler(std::shared_ptr repo, OutputFile &idx, OutputFile &dat); std::string getRoute() { return _session->getConnectionSpec(); } virtual ~FeedHandler(); }; @@ -93,7 +93,7 @@ FeedHandler::handleMessage(mbus::Message::UP message) _session->reply(std::move(reply)); // handle all messages synchronously } -FeedHandler::FeedHandler(document::DocumentTypeRepo::SP repo, OutputFile &idx, OutputFile &dat) +FeedHandler::FeedHandler(std::shared_ptr repo, OutputFile &idx, OutputFile &dat) : _loadTypes(), _mbus(mbus::MessageBusParams().addProtocol(mbus::IProtocol::SP(new documentapi::DocumentProtocol(_loadTypes, repo))), mbus::RPCNetworkParams()), @@ -147,10 +147,10 @@ std::unique_ptr getConfig() { return ret; } -document::DocumentTypeRepo::SP getRepo() { +std::shared_ptr getRepo() { typedef document::DocumenttypesConfig DCFG; std::unique_ptr dcfg = getConfig(); - document::DocumentTypeRepo::SP ret; + std::shared_ptr ret; if (dcfg.get() != 0) { ret.reset(new document::DocumentTypeRepo(*dcfg)); } @@ -187,7 +187,7 @@ App::Main() fprintf(stderr, "error: could not save config to disk\n"); return 1; } - document::DocumentTypeRepo::SP repo = getRepo(); + std::shared_ptr repo = getRepo(); if (repo.get() == 0) { fprintf(stderr, "error: could not create document type repo\n"); return 1; -- cgit v1.2.3