summaryrefslogtreecommitdiffstats
path: root/document
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@broadpark.no>2019-07-30 12:54:18 +0200
committerTor Egge <Tor.Egge@broadpark.no>2019-07-30 13:00:40 +0200
commitfba625e9a06308364f0c0e6728a9d2195b9354a0 (patch)
treef26a1979f4c5733331c11832a0256234a4a8b38b /document
parentb53df1fcba1dae72a6e78c7892bc7b51408d4348 (diff)
Use proper scope for enum constants.
Diffstat (limited to 'document')
-rw-r--r--document/src/tests/documenttestcase.cpp2
-rw-r--r--document/src/tests/repo/documenttyperepo_test.cpp2
-rw-r--r--document/src/vespa/document/repo/configbuilder.cpp4
-rw-r--r--document/src/vespa/document/repo/configbuilder.h10
-rw-r--r--document/src/vespa/document/repo/documenttyperepo.cpp14
5 files changed, 16 insertions, 16 deletions
diff --git a/document/src/tests/documenttestcase.cpp b/document/src/tests/documenttestcase.cpp
index bb07f63a83b..5521fac58e8 100644
--- a/document/src/tests/documenttestcase.cpp
+++ b/document/src/tests/documenttestcase.cpp
@@ -1161,7 +1161,7 @@ TEST(DocumentTest, testCompressionConfigured)
Struct("serializetest.body").setId(45)
.addField("stringfield", DataType::T_STRING)
.setCompression(DocumenttypesConfig::Documenttype::
- Datatype::Sstruct::Compression::LZ4,
+ Datatype::Sstruct::Compression::Type::LZ4,
9, 99, 0));
DocumentTypeRepo repo2(builder2.config());
diff --git a/document/src/tests/repo/documenttyperepo_test.cpp b/document/src/tests/repo/documenttyperepo_test.cpp
index 64900d2ad65..b263ad75930 100644
--- a/document/src/tests/repo/documenttyperepo_test.cpp
+++ b/document/src/tests/repo/documenttyperepo_test.cpp
@@ -86,7 +86,7 @@ TEST("requireThatStructsCanConfigureCompression") {
builder.document(doc_type_id, type_name,
Struct(header_name),
Struct(body_name).setCompression(
- Sstruct::Compression::LZ4,
+ Sstruct::Compression::Type::LZ4,
comp_level, comp_minres, comp_minsize));
DocumentTypeRepo repo(builder.config());
diff --git a/document/src/vespa/document/repo/configbuilder.cpp b/document/src/vespa/document/repo/configbuilder.cpp
index 9610697b84f..7d9b607facd 100644
--- a/document/src/vespa/document/repo/configbuilder.cpp
+++ b/document/src/vespa/document/repo/configbuilder.cpp
@@ -62,8 +62,8 @@ DocTypeRep
DocumenttypesConfigBuilderHelper::document(int32_t id, const vespalib::string &name,
const DatatypeConfig &header,
const DatatypeConfig &body) {
- assert(header.type == DatatypeConfig::STRUCT);
- assert(body.type == DatatypeConfig::STRUCT);
+ assert(header.type == DatatypeConfig::Type::STRUCT);
+ assert(body.type == DatatypeConfig::Type::STRUCT);
_config.documenttype.resize(_config.documenttype.size() + 1);
_config.documenttype.back().id = id;
_config.documenttype.back().name = name;
diff --git a/document/src/vespa/document/repo/configbuilder.h b/document/src/vespa/document/repo/configbuilder.h
index 5f6f5548ae2..15ee0da0c79 100644
--- a/document/src/vespa/document/repo/configbuilder.h
+++ b/document/src/vespa/document/repo/configbuilder.h
@@ -39,7 +39,7 @@ struct TypeOrId {
struct Struct : DatatypeConfig {
Struct(const vespalib::string &name) {
- type = STRUCT;
+ type = Type::STRUCT;
sstruct.name = name;
}
Struct &setCompression(Sstruct::Compression::Type t, int32_t level,
@@ -65,7 +65,7 @@ struct Struct : DatatypeConfig {
struct Array : DatatypeConfig {
Array(TypeOrId nested_type) {
addNestedType(nested_type);
- type = ARRAY;
+ type = Type::ARRAY;
array.element.id = nested_type.id;
}
};
@@ -73,7 +73,7 @@ struct Array : DatatypeConfig {
struct Wset : DatatypeConfig {
Wset(TypeOrId nested_type) {
addNestedType(nested_type);
- type = WSET;
+ type = Type::WSET;
wset.key.id = nested_type.id;
}
Wset &removeIfZero() { wset.removeifzero = true; return *this; }
@@ -87,7 +87,7 @@ struct Map : DatatypeConfig {
Map(TypeOrId key_type, TypeOrId value_type) {
addNestedType(key_type);
addNestedType(value_type);
- type = MAP;
+ type = Type::MAP;
map.key.id = key_type.id;
map.value.id = value_type.id;
}
@@ -95,7 +95,7 @@ struct Map : DatatypeConfig {
struct AnnotationRef : DatatypeConfig {
AnnotationRef(int32_t annotation_type_id) {
- type = ANNOTATIONREF;
+ type = Type::ANNOTATIONREF;
annotationref.annotation.id = annotation_type_id;
}
};
diff --git a/document/src/vespa/document/repo/documenttyperepo.cpp b/document/src/vespa/document/repo/documenttyperepo.cpp
index bdecd521f44..da59f527115 100644
--- a/document/src/vespa/document/repo/documenttyperepo.cpp
+++ b/document/src/vespa/document/repo/documenttyperepo.cpp
@@ -310,7 +310,7 @@ void addStruct(int32_t id, const Datatype::Sstruct &s, Repo &repo) {
}
CompressionConfig::Type type = CompressionConfig::NONE;
- if (s.compression.type == Datatype::Sstruct::Compression::LZ4) {
+ if (s.compression.type == Datatype::Sstruct::Compression::Type::LZ4) {
type = CompressionConfig::LZ4;
}
@@ -348,18 +348,18 @@ void addAnnotationRef(int32_t id, const Datatype::Annotationref &a, Repo &r, con
void addDataType(const Datatype &type, Repo &repo, const AnnotationTypeRepo &a_repo) {
switch (type.type) {
- case Datatype::STRUCT:
+ case Datatype::Type::STRUCT:
return addStruct(type.id, type.sstruct, repo);
- case Datatype::ARRAY:
+ case Datatype::Type::ARRAY:
return addArray(type.id, type.array, repo);
- case Datatype::WSET:
+ case Datatype::Type::WSET:
return addWset(type.id, type.wset, repo);
- case Datatype::MAP:
+ case Datatype::Type::MAP:
return addMap(type.id, type.map, repo);
- case Datatype::ANNOTATIONREF:
+ case Datatype::Type::ANNOTATIONREF:
return addAnnotationRef(type.id, type.annotationref, repo, a_repo);
default:
- throw IllegalArgumentException(make_string("Unknown datatype type %d for id %d", type.type, type.id));
+ throw IllegalArgumentException(make_string("Unknown datatype type %d for id %d", static_cast<int>(type.type), type.id));
}
}