summaryrefslogtreecommitdiffstats
path: root/streamingvisitors
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2022-03-04 05:00:44 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2022-03-04 08:11:53 +0000
commit19c86cb3ebac5b36630eb2a83281bb0d037a9070 (patch)
treeb2e527d41d7c12a4673a1ba6daa7faff334f9adf /streamingvisitors
parent50780f816746c84bbb9f6d2c476c5cb3e57740f7 (diff)
Remove identifiable from document::DataType
Also remove the virtual == operator and the need for default constructor.
Diffstat (limited to 'streamingvisitors')
-rw-r--r--streamingvisitors/src/vespa/searchvisitor/searchvisitor.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/streamingvisitors/src/vespa/searchvisitor/searchvisitor.cpp b/streamingvisitors/src/vespa/searchvisitor/searchvisitor.cpp
index 460a0886ee2..3caa82aa171 100644
--- a/streamingvisitors/src/vespa/searchvisitor/searchvisitor.cpp
+++ b/streamingvisitors/src/vespa/searchvisitor/searchvisitor.cpp
@@ -67,8 +67,9 @@ AttributeVector::SP
createMultiValueAttribute(const vespalib::string & name, const document::FieldValue & fv, bool arrayType)
{
const DataType * ndt = fv.getDataType();
- if (ndt->inherits(document::CollectionDataType::classId)) {
- ndt = &(static_cast<const document::CollectionDataType *>(ndt))->getNestedType();
+ const document::CollectionDataType * cdt = ndt->cast_collection();
+ if (cdt != nullptr) {
+ ndt = &cdt->getNestedType();
}
LOG(debug, "Create %s attribute '%s' with data type '%s' (%s)",
arrayType ? "array" : "weighted set", name.c_str(), ndt->getName().c_str(), fv.getClass().name());
@@ -739,12 +740,12 @@ void SearchVisitor::setupAttributeVector(const FieldPath &fieldPath) {
enum FieldDataType { OTHER = 0, ARRAY, WSET };
FieldDataType typeSeen = OTHER;
for (const auto & entry : fieldPath) {
- int dataTypeId(entry->getDataType().getClass().id());
- if (dataTypeId == document::ArrayDataType::classId) {
+ const document::DataType & dt = entry->getDataType();
+ if (dt.isArray()) {
typeSeen = ARRAY;
- } else if (dataTypeId == document::MapDataType::classId) {
+ } else if (dt.cast_map() != nullptr) {
typeSeen = ARRAY;
- } else if (dataTypeId == document::WeightedSetDataType::classId) {
+ } else if (dt.isWeightedSet()) {
typeSeen = WSET;
}
}