summaryrefslogtreecommitdiffstats
path: root/document/src
diff options
context:
space:
mode:
Diffstat (limited to 'document/src')
-rw-r--r--document/src/tests/fieldpathupdatetestcase.cpp2
-rw-r--r--document/src/tests/select/select_test.cpp2
-rw-r--r--document/src/tests/serialization/annotationserializer_test.cpp2
-rw-r--r--document/src/tests/serialization/vespadocumentserializer_test.cpp2
-rw-r--r--document/src/vespa/document/base/testdocrepo.cpp2
-rw-r--r--document/src/vespa/document/base/testdocrepo.h1
-rw-r--r--document/src/vespa/document/config/doctypecfg.h16
-rw-r--r--document/src/vespa/document/config/documentmanager.def2
-rw-r--r--document/src/vespa/document/repo/configbuilder.h5
-rw-r--r--document/src/vespa/document/repo/document_type_repo_factory.h6
-rw-r--r--document/src/vespa/document/repo/documenttyperepo.cpp3
-rw-r--r--document/src/vespa/document/repo/documenttyperepo.h3
12 files changed, 31 insertions, 15 deletions
diff --git a/document/src/tests/fieldpathupdatetestcase.cpp b/document/src/tests/fieldpathupdatetestcase.cpp
index d71ef94a595..e4516ab6d70 100644
--- a/document/src/tests/fieldpathupdatetestcase.cpp
+++ b/document/src/tests/fieldpathupdatetestcase.cpp
@@ -41,7 +41,7 @@ protected:
namespace {
-document::DocumenttypesConfig getRepoConfig() {
+DocumenttypesConfig getRepoConfig() {
const int struct2_id = 64;
DocumenttypesConfigBuilderHelper builder;
builder.document(
diff --git a/document/src/tests/select/select_test.cpp b/document/src/tests/select/select_test.cpp
index e01564f4b3b..5a743fb93cd 100644
--- a/document/src/tests/select/select_test.cpp
+++ b/document/src/tests/select/select_test.cpp
@@ -2,6 +2,7 @@
#include <vespa/vespalib/gtest/gtest.h>
#include <vespa/document/base/documentid.h>
+#include <vespa/document/config/doctypecfg.h>
#include <vespa/document/datatype/documenttype.h>
#include <vespa/document/datatype/referencedatatype.h>
#include <vespa/document/fieldvalue/document.h>
@@ -16,7 +17,6 @@ LOG_SETUP("document_select_test");
using document::Document;
using document::DocumentId;
-using document::DocumenttypesConfig;
using document::DocumentType;
using document::DocumentTypeRepo;
using document::DocumentTypeRepoFactory;
diff --git a/document/src/tests/serialization/annotationserializer_test.cpp b/document/src/tests/serialization/annotationserializer_test.cpp
index c3c9b09477b..073544b1bc9 100644
--- a/document/src/tests/serialization/annotationserializer_test.cpp
+++ b/document/src/tests/serialization/annotationserializer_test.cpp
@@ -4,6 +4,7 @@
#include <vespa/document/annotation/alternatespanlist.h>
#include <vespa/document/annotation/annotation.h>
#include <vespa/document/annotation/spantree.h>
+#include <vespa/document/config/doctypecfg.h>
#include <vespa/document/fieldvalue/stringfieldvalue.h>
#include <vespa/document/serialization/annotationdeserializer.h>
#include <vespa/document/serialization/annotationserializer.h>
@@ -17,7 +18,6 @@
#include <algorithm>
-using document::DocumenttypesConfig;
using std::fstream;
using std::ostringstream;
using std::string;
diff --git a/document/src/tests/serialization/vespadocumentserializer_test.cpp b/document/src/tests/serialization/vespadocumentserializer_test.cpp
index 443c7d1885a..9a0786c846f 100644
--- a/document/src/tests/serialization/vespadocumentserializer_test.cpp
+++ b/document/src/tests/serialization/vespadocumentserializer_test.cpp
@@ -5,6 +5,7 @@
#include <vespa/document/annotation/span.h>
#include <vespa/document/annotation/spantree.h>
#include <vespa/document/config/config-documenttypes.h>
+#include <vespa/document/config/doctypecfg.h>
#include <vespa/document/datatype/annotationreferencedatatype.h>
#include <vespa/document/datatype/arraydatatype.h>
#include <vespa/document/datatype/documenttype.h>
@@ -46,7 +47,6 @@
#include <vespa/document/base/exceptions.h>
#include <vespa/vespalib/util/compressionconfig.h>
-using document::DocumenttypesConfig;
using vespalib::File;
using vespalib::Slime;
using vespalib::nbostream;
diff --git a/document/src/vespa/document/base/testdocrepo.cpp b/document/src/vespa/document/base/testdocrepo.cpp
index e6ed37dce92..d48bac0ff74 100644
--- a/document/src/vespa/document/base/testdocrepo.cpp
+++ b/document/src/vespa/document/base/testdocrepo.cpp
@@ -75,7 +75,7 @@ TestDocRepo::getDocumentType(const vespalib::string &t) const {
}
DocumenttypesConfig readDocumenttypesConfig(const char *file_name) {
- config::FileConfigReader<DocumenttypesConfig> reader(file_name);
+ ::config::FileConfigReader<DocumenttypesConfig> reader(file_name);
return DocumenttypesConfig(*reader.read());
}
diff --git a/document/src/vespa/document/base/testdocrepo.h b/document/src/vespa/document/base/testdocrepo.h
index 594057887e3..fa2689a94f4 100644
--- a/document/src/vespa/document/base/testdocrepo.h
+++ b/document/src/vespa/document/base/testdocrepo.h
@@ -3,6 +3,7 @@
#pragma once
#include <vespa/document/config/config-documenttypes.h>
+#include <vespa/document/config/doctypecfg.h>
#include <vespa/document/datatype/datatype.h>
namespace document {
diff --git a/document/src/vespa/document/config/doctypecfg.h b/document/src/vespa/document/config/doctypecfg.h
new file mode 100644
index 00000000000..a1f7cfcb308
--- /dev/null
+++ b/document/src/vespa/document/config/doctypecfg.h
@@ -0,0 +1,16 @@
+// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+
+#pragma once
+
+/**
+ * Forward-declaration of the types
+ * DocumenttypesConfig and DocumenttypesConfigBuilder
+ * (globally visible).
+ **/
+
+namespace document::config::internal {
+class InternalDocumenttypesType;
+}
+
+using DocumenttypesConfigBuilder = document::config::internal::InternalDocumenttypesType;
+using DocumenttypesConfig = const document::config::internal::InternalDocumenttypesType;
diff --git a/document/src/vespa/document/config/documentmanager.def b/document/src/vespa/document/config/documentmanager.def
index 6d4b12207bd..b9e7cc0f0d1 100644
--- a/document/src/vespa/document/config/documentmanager.def
+++ b/document/src/vespa/document/config/documentmanager.def
@@ -66,7 +66,7 @@ datatype[].structtype[].field[].datatype int
## (necessarily) causing field incompatibility
datatype[].structtype[].field[].detailedtype string default=""
-## Specify a document type to inherit
+## Specify a struct type to inherit
datatype[].structtype[].inherits[].name string
## Version is not in use
diff --git a/document/src/vespa/document/repo/configbuilder.h b/document/src/vespa/document/repo/configbuilder.h
index 0bcebe7ddf6..6774ca060f1 100644
--- a/document/src/vespa/document/repo/configbuilder.h
+++ b/document/src/vespa/document/repo/configbuilder.h
@@ -4,6 +4,7 @@
#include <vespa/document/base/field.h>
#include <vespa/document/config/config-documenttypes.h>
+#include <vespa/document/config/doctypecfg.h>
#include <vespa/document/datatype/datatype.h>
#include <vespa/document/datatype/structdatatype.h>
#include <vespa/vespalib/stllike/string.h>
@@ -136,7 +137,7 @@ struct DocTypeRep {
};
class DocumenttypesConfigBuilderHelper {
- ::document::DocumenttypesConfigBuilder _config;
+ ::document::config::DocumenttypesConfigBuilder _config;
public:
DocumenttypesConfigBuilderHelper() {}
@@ -147,7 +148,7 @@ public:
const DatatypeConfig &header,
const DatatypeConfig &body);
- ::document::DocumenttypesConfigBuilder &config() { return _config; }
+ ::document::config::DocumenttypesConfigBuilder &config() { return _config; }
};
}
diff --git a/document/src/vespa/document/repo/document_type_repo_factory.h b/document/src/vespa/document/repo/document_type_repo_factory.h
index 4dc75a04e38..28b87566d5d 100644
--- a/document/src/vespa/document/repo/document_type_repo_factory.h
+++ b/document/src/vespa/document/repo/document_type_repo_factory.h
@@ -5,13 +5,10 @@
#include <memory>
#include <mutex>
#include <map>
+#include <vespa/document/config/doctypecfg.h>
namespace document {
-namespace internal {
- class InternalDocumenttypesType;
-}
-
class DocumentTypeRepo;
/*
@@ -19,7 +16,6 @@ class DocumentTypeRepo;
* for equal config.
*/
class DocumentTypeRepoFactory {
- using DocumenttypesConfig = const internal::InternalDocumenttypesType;
struct DocumentTypeRepoEntry {
std::weak_ptr<const DocumentTypeRepo> repo;
std::unique_ptr<const DocumenttypesConfig> config;
diff --git a/document/src/vespa/document/repo/documenttyperepo.cpp b/document/src/vespa/document/repo/documenttyperepo.cpp
index 15730d14a86..20e3d0c712d 100644
--- a/document/src/vespa/document/repo/documenttyperepo.cpp
+++ b/document/src/vespa/document/repo/documenttyperepo.cpp
@@ -2,6 +2,7 @@
#include "documenttyperepo.h"
+#include <vespa/document/config/doctypecfg.h>
#include <vespa/document/datatype/annotationreferencedatatype.h>
#include <vespa/document/datatype/arraydatatype.h>
#include <vespa/document/datatype/documenttype.h>
@@ -229,6 +230,8 @@ struct DataTypeRepo {
};
namespace {
+
+
void addAnnotationType(const DocumenttypesConfig::Documenttype::Annotationtype &type, AnnotationTypeRepo &annotations)
{
auto a = std::make_unique<AnnotationType>(type.id, type.name);
diff --git a/document/src/vespa/document/repo/documenttyperepo.h b/document/src/vespa/document/repo/documenttyperepo.h
index 87830b0aa1c..fe2158639e6 100644
--- a/document/src/vespa/document/repo/documenttyperepo.h
+++ b/document/src/vespa/document/repo/documenttyperepo.h
@@ -4,11 +4,11 @@
#include <memory>
#include <vespa/vespalib/stllike/string.h>
+#include <vespa/document/config/doctypecfg.h>
namespace document {
namespace internal {
- class InternalDocumenttypesType;
class DocumentTypeMap;
}
@@ -19,7 +19,6 @@ class DocumentType;
class DocumentTypeRepo {
public:
- using DocumenttypesConfig = const internal::InternalDocumenttypesType;
struct Handler {
virtual ~Handler() = default;
virtual void handle(const DocumentType & type) = 0;