From 98b760a33c142227cd88448bc6666eb9809aa4a2 Mon Sep 17 00:00:00 2001 From: Arne H Juul Date: Thu, 2 Dec 2021 08:07:30 +0000 Subject: track namespace move in documenttypes.def * For C++ code this introduces a "document::config" namespace, which will sometimes conflict with the global "config" namespace. * Move all forward-declarations of the types DocumenttypesConfig and DocumenttypesConfigBuilder to a common header file. --- searchlib/src/apps/tests/memoryindexstress_test.cpp | 2 +- .../document_store_visitor/document_store_visitor_test.cpp | 2 +- .../src/tests/docstore/logdatastore/logdatastore_test.cpp | 2 +- .../src/tests/index/doctypebuilder/doctypebuilder_test.cpp | 4 ++-- searchlib/src/vespa/searchlib/index/docbuilder.h | 4 ++-- searchlib/src/vespa/searchlib/index/doctypebuilder.cpp | 10 +++++----- searchlib/src/vespa/searchlib/index/doctypebuilder.h | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) (limited to 'searchlib/src') diff --git a/searchlib/src/apps/tests/memoryindexstress_test.cpp b/searchlib/src/apps/tests/memoryindexstress_test.cpp index 54864702a47..fcac0be8f85 100644 --- a/searchlib/src/apps/tests/memoryindexstress_test.cpp +++ b/searchlib/src/apps/tests/memoryindexstress_test.cpp @@ -73,7 +73,7 @@ makeSchema() return schema; } -document::DocumenttypesConfig +document::config::DocumenttypesConfig makeDocTypeRepoConfig() { const int32_t doc_type_id = 787121340; diff --git a/searchlib/src/tests/docstore/document_store_visitor/document_store_visitor_test.cpp b/searchlib/src/tests/docstore/document_store_visitor/document_store_visitor_test.cpp index 792cc48c338..072efb06a07 100644 --- a/searchlib/src/tests/docstore/document_store_visitor/document_store_visitor_test.cpp +++ b/searchlib/src/tests/docstore/document_store_visitor/document_store_visitor_test.cpp @@ -36,7 +36,7 @@ const string doc_type_name = "test"; const string header_name = doc_type_name + ".header"; const string body_name = doc_type_name + ".body"; -document::DocumenttypesConfig +document::config::DocumenttypesConfig makeDocTypeRepoConfig() { const int32_t doc_type_id = 787121340; diff --git a/searchlib/src/tests/docstore/logdatastore/logdatastore_test.cpp b/searchlib/src/tests/docstore/logdatastore/logdatastore_test.cpp index 242a3c31663..07652dfd336 100644 --- a/searchlib/src/tests/docstore/logdatastore/logdatastore_test.cpp +++ b/searchlib/src/tests/docstore/logdatastore/logdatastore_test.cpp @@ -399,7 +399,7 @@ const string doc_type_name = "test"; const string header_name = doc_type_name + ".header"; const string body_name = doc_type_name + ".body"; -document::DocumenttypesConfig +document::config::DocumenttypesConfig makeDocTypeRepoConfig() { const int32_t doc_type_id = 787121340; diff --git a/searchlib/src/tests/index/doctypebuilder/doctypebuilder_test.cpp b/searchlib/src/tests/index/doctypebuilder/doctypebuilder_test.cpp index 4b7062be4f8..f8a07270292 100644 --- a/searchlib/src/tests/index/doctypebuilder/doctypebuilder_test.cpp +++ b/searchlib/src/tests/index/doctypebuilder/doctypebuilder_test.cpp @@ -26,7 +26,7 @@ TEST("testSearchDocType") { s.addSummaryField(Schema::SummaryField("sa", DataType::STRING)); DocTypeBuilder docTypeBuilder(s); - document::DocumenttypesConfig config = docTypeBuilder.makeConfig(); + document::config::DocumenttypesConfig config = docTypeBuilder.makeConfig(); DocumentTypeRepo repo(config); const DocumentType *docType = repo.getDocumentType("searchdocument"); ASSERT_TRUE(docType); @@ -57,7 +57,7 @@ TEST("require that multiple fields can have the same type") { s.addIndexField(Schema::IndexField("array1", DataType::STRING, CollectionType::ARRAY)); s.addIndexField(Schema::IndexField("array2", DataType::STRING, CollectionType::ARRAY)); DocTypeBuilder docTypeBuilder(s); - document::DocumenttypesConfig config = docTypeBuilder.makeConfig(); + document::config::DocumenttypesConfig config = docTypeBuilder.makeConfig(); DocumentTypeRepo repo(config); const DocumentType *docType = repo.getDocumentType("searchdocument"); ASSERT_TRUE(docType); diff --git a/searchlib/src/vespa/searchlib/index/docbuilder.h b/searchlib/src/vespa/searchlib/index/docbuilder.h index 2b60446bd4e..2ee28c90827 100644 --- a/searchlib/src/vespa/searchlib/index/docbuilder.h +++ b/searchlib/src/vespa/searchlib/index/docbuilder.h @@ -253,7 +253,7 @@ private: }; const Schema & _schema; - document::DocumenttypesConfig _doctypes_config; + document::config::DocumenttypesConfig _doctypes_config; std::shared_ptr _repo; const document::DocumentType &_docType; document::Document::UP _doc; // the document we are about to generate @@ -300,7 +300,7 @@ public: const document::DocumentType &getDocumentType() const { return _docType; } const std::shared_ptr &getDocumentTypeRepo() const { return _repo; } - document::DocumenttypesConfig getDocumenttypesConfig() const { return _doctypes_config; } + document::config::DocumenttypesConfig getDocumenttypesConfig() const { return _doctypes_config; } }; } diff --git a/searchlib/src/vespa/searchlib/index/doctypebuilder.cpp b/searchlib/src/vespa/searchlib/index/doctypebuilder.cpp index 9f0a44d2b73..1ddfbff54a8 100644 --- a/searchlib/src/vespa/searchlib/index/doctypebuilder.cpp +++ b/searchlib/src/vespa/searchlib/index/doctypebuilder.cpp @@ -43,9 +43,9 @@ DataType::Type convert(Schema::DataType type) { } void -insertStructType(document::DocumenttypesConfig::Documenttype & cfg, const StructDataType & structType) +insertStructType(document::config::DocumenttypesConfig::Documenttype & cfg, const StructDataType & structType) { - typedef document::DocumenttypesConfig DTC; + typedef document::config::DocumenttypesConfig DTC; DTC::Documenttype::Datatype::Sstruct cfgStruct; cfgStruct.name = structType.getName(); Field::Set fieldSet = structType.getFieldSet(); @@ -97,7 +97,7 @@ DocTypeBuilder::DocTypeBuilder(const Schema &schema) _iFields.setup(schema); } -document::DocumenttypesConfig DocTypeBuilder::makeConfig() const { +document::config::DocumenttypesConfig DocTypeBuilder::makeConfig() const { using namespace document::config_builder; TypeCache type_cache; @@ -168,10 +168,10 @@ document::DocumenttypesConfig DocTypeBuilder::makeConfig() const { return builder.config(); } -document::DocumenttypesConfig +document::config::DocumenttypesConfig DocTypeBuilder::makeConfig(const DocumentType &docType) { - typedef document::DocumenttypesConfigBuilder DTC; + typedef document::config::DocumenttypesConfigBuilder DTC; DTC cfg; { // document type DTC::Documenttype dtype; diff --git a/searchlib/src/vespa/searchlib/index/doctypebuilder.h b/searchlib/src/vespa/searchlib/index/doctypebuilder.h index 98b52e955fc..c66ae66e250 100644 --- a/searchlib/src/vespa/searchlib/index/doctypebuilder.h +++ b/searchlib/src/vespa/searchlib/index/doctypebuilder.h @@ -20,9 +20,9 @@ class DocTypeBuilder { public: DocTypeBuilder(const Schema & schema); - document::DocumenttypesConfig makeConfig() const; + document::config::DocumenttypesConfig makeConfig() const; - static document::DocumenttypesConfig + static document::config::DocumenttypesConfig makeConfig(const document::DocumentType &docType); }; -- cgit v1.2.3