summaryrefslogtreecommitdiffstats
path: root/document
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2017-05-02 14:41:50 +0200
committerHenning Baldersheim <balder@yahoo-inc.com>2017-05-02 14:41:50 +0200
commitd7b84c7e809895dba41273b770c40c7333700b09 (patch)
tree4300d2cb105c19a303194b6d568de30fe561ed57 /document
parent0f646f10b377b90fc37e9911f9fe383d112ff157 (diff)
Fix warnings hidden earlier due to including application headers as system includes
Diffstat (limited to 'document')
-rw-r--r--document/src/vespa/document/base/testdocrepo.cpp7
-rw-r--r--document/src/vespa/document/base/testdocrepo.h1
-rw-r--r--document/src/vespa/document/predicate/predicate.cpp2
-rw-r--r--document/src/vespa/document/predicate/predicate.h1
-rw-r--r--document/src/vespa/document/select/valuenode.cpp13
-rw-r--r--document/src/vespa/document/select/valuenode.h19
-rw-r--r--document/src/vespa/document/update/addfieldpathupdate.cpp3
-rw-r--r--document/src/vespa/document/update/addfieldpathupdate.h27
-rw-r--r--document/src/vespa/document/update/assignfieldpathupdate.h39
-rw-r--r--document/src/vespa/document/update/mapvalueupdate.cpp17
-rw-r--r--document/src/vespa/document/update/mapvalueupdate.h13
11 files changed, 69 insertions, 73 deletions
diff --git a/document/src/vespa/document/base/testdocrepo.cpp b/document/src/vespa/document/base/testdocrepo.cpp
index 6b010af383d..17817c53932 100644
--- a/document/src/vespa/document/base/testdocrepo.cpp
+++ b/document/src/vespa/document/base/testdocrepo.cpp
@@ -11,11 +11,14 @@ using document::config_builder::Array;
using document::config_builder::Map;
namespace document {
+
TestDocRepo::TestDocRepo()
- : _cfg(getDefaultConfig()),
- _repo(new DocumentTypeRepo(_cfg)) {
+ : _cfg(getDefaultConfig()),
+ _repo(new DocumentTypeRepo(_cfg)) {
}
+ TestDocRepo::~TestDocRepo() {}
+
DocumenttypesConfig TestDocRepo::getDefaultConfig() {
const int type1_id = 238423572;
const int type2_id = 238424533;
diff --git a/document/src/vespa/document/base/testdocrepo.h b/document/src/vespa/document/base/testdocrepo.h
index 94b039cfe75..1cdf90d1129 100644
--- a/document/src/vespa/document/base/testdocrepo.h
+++ b/document/src/vespa/document/base/testdocrepo.h
@@ -14,6 +14,7 @@ class TestDocRepo {
public:
TestDocRepo();
+ ~TestDocRepo();
static DocumenttypesConfig getDefaultConfig();
diff --git a/document/src/vespa/document/predicate/predicate.cpp b/document/src/vespa/document/predicate/predicate.cpp
index aa6c1f4e337..701cdd73389 100644
--- a/document/src/vespa/document/predicate/predicate.cpp
+++ b/document/src/vespa/document/predicate/predicate.cpp
@@ -2,7 +2,6 @@
#include "predicate.h"
#include <vespa/vespalib/data/slime/slime.h>
-#include <algorithm>
#include <set>
using std::mismatch;
@@ -128,6 +127,7 @@ FeatureSet::FeatureSet(const Inspector &inspector)
make_insert_from_array(back_inserter(_features)).ref());
}
+FeatureSet::~FeatureSet() {}
FeatureRange::FeatureRange(const Inspector &inspector)
: FeatureBase(inspector),
diff --git a/document/src/vespa/document/predicate/predicate.h b/document/src/vespa/document/predicate/predicate.h
index 23968f0e904..cbb1f7e2908 100644
--- a/document/src/vespa/document/predicate/predicate.h
+++ b/document/src/vespa/document/predicate/predicate.h
@@ -62,6 +62,7 @@ class FeatureSet : public FeatureBase {
public:
FeatureSet(const vespalib::slime::Inspector &inspector);
+ ~FeatureSet();
size_t getSize() const { return _features.size(); }
std::string operator[](size_t i) const { return _features[i]; }
diff --git a/document/src/vespa/document/select/valuenode.cpp b/document/src/vespa/document/select/valuenode.cpp
index bc2bc249db6..ebf0a466ad9 100644
--- a/document/src/vespa/document/select/valuenode.cpp
+++ b/document/src/vespa/document/select/valuenode.cpp
@@ -199,7 +199,12 @@ FieldValueNode::FieldValueNode(const vespalib::string& doctype,
{
}
-const vespalib::string FieldValueNode::extractFieldName(const std::string & fieldExpression) {
+FieldValueNode::FieldValueNode(const FieldValueNode &) = default;
+FieldValueNode & FieldValueNode::operator = (const FieldValueNode &) = default;
+
+FieldValueNode::~FieldValueNode() {}
+vespalib::string
+FieldValueNode::extractFieldName(const std::string & fieldExpression) {
std::smatch match;
if (std::regex_match(fieldExpression, match, FIELD_NAME_REGEX) && match[1].matched) {
@@ -215,10 +220,8 @@ FieldValueNode::initFieldPath(const DocumentType& type) const {
FieldPath::UP path(type.buildFieldPath(_fieldExpression));
if (!path.get()) {
throw FieldNotFoundException(
- vespalib::make_string("Could not create field path for doc "
- "type: '%s' field: '%s'",
- type.toString().c_str(),
- _fieldExpression.c_str()),
+ vespalib::make_string("Could not create field path for doc type: '%s' field: '%s'",
+ type.toString().c_str(), _fieldExpression.c_str()),
VESPA_STRLOC);
}
_fieldPath = *path;
diff --git a/document/src/vespa/document/select/valuenode.h b/document/src/vespa/document/select/valuenode.h
index 96bc03fee8d..e3f0b4c4a94 100644
--- a/document/src/vespa/document/select/valuenode.h
+++ b/document/src/vespa/document/select/valuenode.h
@@ -12,14 +12,12 @@
#pragma once
-#include <memory>
-#include <vespa/document/bucket/bucketidfactory.h>
#include "value.h"
+#include "context.h"
#include <vespa/document/fieldvalue/document.h>
#include <vespa/document/update/documentupdate.h>
#include <vespa/document/bucket/bucketdistribution.h>
-#include <vespa/document/fieldvalue/fieldvalue.h>
-#include "context.h"
+#include <vespa/document/bucket/bucketidfactory.h>
namespace document {
@@ -221,13 +219,15 @@ class FieldValueNode : public ValueNode
mutable FieldPath _fieldPath;
public:
- FieldValueNode(const vespalib::string& doctype,
- const vespalib::string& fieldExpression);
+ FieldValueNode(const vespalib::string& doctype, const vespalib::string& fieldExpression);
+ FieldValueNode(const FieldValueNode &);
+ FieldValueNode & operator = (const FieldValueNode &);
+ FieldValueNode(FieldValueNode &&) = default;
+ FieldValueNode & operator = (FieldValueNode &&) = default;
+ ~FieldValueNode();
const vespalib::string& getDocType() const { return _doctype; }
-
const vespalib::string& getRealFieldName() const { return _fieldName; }
-
const vespalib::string& getFieldName() const { return _fieldExpression; }
std::unique_ptr<Value> getValue(const Context& context) const override;
@@ -239,7 +239,7 @@ public:
return wrapParens(new FieldValueNode(_doctype, _fieldExpression));
}
- static const vespalib::string extractFieldName(const std::string & fieldExpression);
+ static vespalib::string extractFieldName(const std::string & fieldExpression);
private:
class IteratorHandler : public FieldValue::IteratorHandler
@@ -416,4 +416,3 @@ private:
} // select
} // document
-
diff --git a/document/src/vespa/document/update/addfieldpathupdate.cpp b/document/src/vespa/document/update/addfieldpathupdate.cpp
index 076e67e0abc..03a31d882f3 100644
--- a/document/src/vespa/document/update/addfieldpathupdate.cpp
+++ b/document/src/vespa/document/update/addfieldpathupdate.cpp
@@ -1,10 +1,9 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+#include "addfieldpathupdate.h"
#include <vespa/document/fieldvalue/fieldvalues.h>
-#include <vespa/document/repo/fixedtyperepo.h>
#include <vespa/document/select/parser.h>
#include <vespa/document/serialization/vespadocumentdeserializer.h>
-#include <vespa/document/update/addfieldpathupdate.h>
#include <vespa/vespalib/objects/nbostream.h>
#include <vespa/vespalib/util/exceptions.h>
#include <vespa/log/log.h>
diff --git a/document/src/vespa/document/update/addfieldpathupdate.h b/document/src/vespa/document/update/addfieldpathupdate.h
index 529a0b68053..6d75ebc4209 100644
--- a/document/src/vespa/document/update/addfieldpathupdate.h
+++ b/document/src/vespa/document/update/addfieldpathupdate.h
@@ -1,7 +1,7 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
-#include <vespa/document/update/fieldpathupdate.h>
+#include "fieldpathupdate.h"
namespace document {
@@ -11,19 +11,13 @@ public:
/** For deserialization */
AddFieldPathUpdate();
- AddFieldPathUpdate(const DocumentTypeRepo& repo,
- const DataType& type,
- stringref fieldPath,
- stringref whereClause,
- const ArrayFieldValue& values);
+ AddFieldPathUpdate(const DocumentTypeRepo& repo, const DataType& type, stringref fieldPath,
+ stringref whereClause, const ArrayFieldValue& values);
~AddFieldPathUpdate();
FieldPathUpdate* clone() const override;
-
- bool operator==(const FieldPathUpdate& other) const;
-
- virtual void print(std::ostream& out, bool verbose,
- const std::string& indent) const;
+ bool operator==(const FieldPathUpdate& other) const override;
+ void print(std::ostream& out, bool verbose, const std::string& indent) const override;
const ArrayFieldValue & getValues() const { return *_values; }
@@ -32,9 +26,8 @@ public:
private:
uint8_t getSerializedType() const override { return AddMagic; }
- virtual void deserialize(const DocumentTypeRepo& repo,
- const DataType& type,
- ByteBuffer& buffer, uint16_t version);
+ void deserialize(const DocumentTypeRepo& repo, const DataType& type,
+ ByteBuffer& buffer, uint16_t version) override;
class AddIteratorHandler : public FieldValue::IteratorHandler
{
@@ -42,15 +35,13 @@ private:
AddIteratorHandler(const ArrayFieldValue& values) : _values(values) { }
ModificationStatus doModify(FieldValue& fv) override;
-
bool createMissingPath() const override { return true; }
-
bool onComplex(const Content&) override { return false; }
private:
const ArrayFieldValue& _values;
};
- std::unique_ptr<FieldValue::IteratorHandler> getIteratorHandler(Document&) const {
+ std::unique_ptr<FieldValue::IteratorHandler> getIteratorHandler(Document&) const override {
return std::unique_ptr<FieldValue::IteratorHandler>(
new AddIteratorHandler(*_values));
}
@@ -58,6 +49,4 @@ private:
vespalib::CloneablePtr<ArrayFieldValue> _values;
};
-
} // ns document
-
diff --git a/document/src/vespa/document/update/assignfieldpathupdate.h b/document/src/vespa/document/update/assignfieldpathupdate.h
index 3cfa234922b..81853246e54 100644
--- a/document/src/vespa/document/update/assignfieldpathupdate.h
+++ b/document/src/vespa/document/update/assignfieldpathupdate.h
@@ -1,8 +1,8 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
+#include "fieldpathupdate.h"
#include <vespa/document/base/documentcalculator.h>
-#include <vespa/document/update/fieldpathupdate.h>
namespace document {
@@ -44,21 +44,19 @@ public:
bool hasValue() const { return _newValue.get() != nullptr; }
const FieldValue & getValue() const { return *_newValue; }
- FieldPathUpdate* clone() const;
+ FieldPathUpdate* clone() const override;
- bool operator==(const FieldPathUpdate& other) const;
+ bool operator==(const FieldPathUpdate& other) const override;
- virtual void print(std::ostream& out, bool verbose,
- const std::string& indent) const;
+ void print(std::ostream& out, bool verbose, const std::string& indent) const override;
DECLARE_IDENTIFIABLE(AssignFieldPathUpdate);
ACCEPT_UPDATE_VISITOR;
private:
uint8_t getSerializedType() const override { return AssignMagic; }
- virtual void deserialize(const DocumentTypeRepo& repo,
- const DataType& type,
- ByteBuffer& buffer, uint16_t version);
+ void deserialize(const DocumentTypeRepo& repo, const DataType& type,
+ ByteBuffer& buffer, uint16_t version) override;
class AssignValueIteratorHandler : public FieldValue::IteratorHandler
{
@@ -68,14 +66,11 @@ private:
bool createMissingPath_)
: _newValue(newValue), _removeIfZero(removeIfZero),
_createMissingPath(createMissingPath_)
- {
- }
+ {}
- ModificationStatus doModify(FieldValue& fv);
-
- bool onComplex(const Content&) { return false; }
-
- bool createMissingPath() const { return _createMissingPath; }
+ ModificationStatus doModify(FieldValue& fv) override;
+ bool onComplex(const Content&) override { return false; }
+ bool createMissingPath() const override { return _createMissingPath; }
private:
const FieldValue& _newValue;
@@ -96,14 +91,11 @@ private:
_doc(doc),
_removeIfZero(removeIfZero),
_createMissingPath(createMissingPath_)
- {
- }
-
- ModificationStatus doModify(FieldValue& fv);
+ {}
- bool onComplex(const Content&) { return false; }
-
- bool createMissingPath() const { return _createMissingPath; }
+ ModificationStatus doModify(FieldValue& fv) override;
+ bool onComplex(const Content&) override { return false; }
+ bool createMissingPath() const override { return _createMissingPath; }
private:
DocumentCalculator _calc;
@@ -112,7 +104,7 @@ private:
bool _createMissingPath;
};
- std::unique_ptr<FieldValue::IteratorHandler> getIteratorHandler(Document& doc) const;
+ std::unique_ptr<FieldValue::IteratorHandler> getIteratorHandler(Document& doc) const override;
const DocumentTypeRepo *_repo;
FieldValue::CP _newValue;
@@ -122,4 +114,3 @@ private:
};
} // ns document
-
diff --git a/document/src/vespa/document/update/mapvalueupdate.cpp b/document/src/vespa/document/update/mapvalueupdate.cpp
index 56657491124..0a92fa7fb15 100644
--- a/document/src/vespa/document/update/mapvalueupdate.cpp
+++ b/document/src/vespa/document/update/mapvalueupdate.cpp
@@ -1,11 +1,8 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/document/base/field.h>
-#include <vespa/document/datatype/arraydatatype.h>
-#include <vespa/document/datatype/weightedsetdatatype.h>
+
+#include "mapvalueupdate.h"
#include <vespa/document/fieldvalue/fieldvalues.h>
-#include <vespa/document/repo/fixedtyperepo.h>
#include <vespa/document/serialization/vespadocumentdeserializer.h>
-#include <vespa/document/update/mapvalueupdate.h>
#include <vespa/vespalib/objects/nbostream.h>
#include <vespa/document/util/serializableexceptions.h>
@@ -18,6 +15,16 @@ namespace document
IMPLEMENT_IDENTIFIABLE(MapValueUpdate, ValueUpdate);
+MapValueUpdate::MapValueUpdate(const FieldValue& key, const ValueUpdate& update)
+ : ValueUpdate(),
+ _key(key.clone()),
+ _update(update.clone())
+{}
+
+MapValueUpdate::MapValueUpdate(const MapValueUpdate &) = default;
+MapValueUpdate & MapValueUpdate::operator = (const MapValueUpdate &) = default;
+MapValueUpdate::~MapValueUpdate() {}
+
bool
MapValueUpdate::operator==(const ValueUpdate& other) const
{
diff --git a/document/src/vespa/document/update/mapvalueupdate.h b/document/src/vespa/document/update/mapvalueupdate.h
index 14bd0fc9bd3..1dd7b6ea1d0 100644
--- a/document/src/vespa/document/update/mapvalueupdate.h
+++ b/document/src/vespa/document/update/mapvalueupdate.h
@@ -11,7 +11,7 @@
*/
#pragma once
-#include <vespa/document/update/valueupdate.h>
+#include "valueupdate.h"
#include <vespa/document/fieldvalue/fieldvalue.h>
namespace document {
@@ -37,10 +37,13 @@ public:
* @param key The identifier of the field value to be updated.
* @param update The update to map to apply to the field value of this.
*/
- MapValueUpdate(const FieldValue& key, const ValueUpdate& update)
- : ValueUpdate(),
- _key(key.clone()),
- _update(update.clone()) {}
+ MapValueUpdate(const FieldValue& key, const ValueUpdate& update);
+ MapValueUpdate(const MapValueUpdate &);
+ MapValueUpdate & operator = (const MapValueUpdate &);
+ MapValueUpdate(MapValueUpdate &&) = default;
+ MapValueUpdate & operator = (MapValueUpdate &&) = default;
+
+ ~MapValueUpdate();
bool operator==(const ValueUpdate& other) const override;