aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore/src/apps
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@oath.com>2018-04-04 11:45:55 +0000
committerTor Egge <Tor.Egge@oath.com>2018-04-04 11:45:55 +0000
commit8cfeaeba255ccea54f8345724e72adf53280e33d (patch)
tree711593ee26f3688371e0b0ae948247df22ee54d0 /searchcore/src/apps
parent7902239839a6f34e12ed7aa0f2b7a65114f8ee68 (diff)
Stop using nested typedef for shared pointer to const DocumentTypeRepo.
Diffstat (limited to 'searchcore/src/apps')
-rw-r--r--searchcore/src/apps/tests/persistenceconformance_test.cpp10
-rw-r--r--searchcore/src/apps/vespa-dump-feed/vespa-dump-feed.cpp10
2 files changed, 10 insertions, 10 deletions
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<const DocumentTypeRepo> _repo;
DocumenttypesConfigSP _typeCfg;
SchemaConfigFactory::SP _schemaFactory;
public:
- ConfigFactory(const DocumentTypeRepo::SP &repo,
+ ConfigFactory(const std::shared_ptr<const DocumentTypeRepo> &repo,
const DocumenttypesConfigSP &typeCfg,
const SchemaConfigFactory::SP &schemaFactory);
~ConfigFactory();
- const DocumentTypeRepo::SP getTypeRepo() const { return _repo; }
+ const std::shared_ptr<const DocumentTypeRepo> 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<const DocumentTypeRepo> &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<const DocumentTypeRepo> &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<const document::DocumentTypeRepo> 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<const document::DocumentTypeRepo> 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<CFG> getConfig() {
return ret;
}
-document::DocumentTypeRepo::SP getRepo() {
+std::shared_ptr<const document::DocumentTypeRepo> getRepo() {
typedef document::DocumenttypesConfig DCFG;
std::unique_ptr<DCFG> dcfg = getConfig<DCFG>();
- document::DocumentTypeRepo::SP ret;
+ std::shared_ptr<const document::DocumentTypeRepo> 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<const document::DocumentTypeRepo> repo = getRepo();
if (repo.get() == 0) {
fprintf(stderr, "error: could not create document type repo\n");
return 1;