summaryrefslogtreecommitdiffstats
path: root/searchlib
diff options
context:
space:
mode:
authorArne H Juul <arnej@yahooinc.com>2021-12-02 08:07:30 +0000
committerArne H Juul <arnej@yahooinc.com>2021-12-02 09:35:08 +0000
commit98b760a33c142227cd88448bc6666eb9809aa4a2 (patch)
treeb36c7e4cdd582267f5a605bb8a2ebeb55d734e8c /searchlib
parenta7aa496c28792461b7e252a3046cf003ed0113b1 (diff)
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.
Diffstat (limited to 'searchlib')
-rw-r--r--searchlib/src/apps/tests/memoryindexstress_test.cpp2
-rw-r--r--searchlib/src/tests/docstore/document_store_visitor/document_store_visitor_test.cpp2
-rw-r--r--searchlib/src/tests/docstore/logdatastore/logdatastore_test.cpp2
-rw-r--r--searchlib/src/tests/index/doctypebuilder/doctypebuilder_test.cpp4
-rw-r--r--searchlib/src/vespa/searchlib/index/docbuilder.h4
-rw-r--r--searchlib/src/vespa/searchlib/index/doctypebuilder.cpp10
-rw-r--r--searchlib/src/vespa/searchlib/index/doctypebuilder.h4
7 files changed, 14 insertions, 14 deletions
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<const document::DocumentTypeRepo> _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<const document::DocumentTypeRepo> &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);
};