diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2017-05-08 21:15:18 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2017-05-09 07:16:24 +0000 |
commit | 050edc855e1e45dda3b2b98996f551e909a1a4e7 (patch) | |
tree | 573e86c9c8fb5f160d61132c7266289b3ad8b176 /document | |
parent | a01266777240a6e5db4c92c4801664165400b2cf (diff) |
Deinline as compiler makes the best choices.
Diffstat (limited to 'document')
10 files changed, 49 insertions, 24 deletions
diff --git a/document/src/vespa/document/fieldvalue/weightedsetfieldvalue.cpp b/document/src/vespa/document/fieldvalue/weightedsetfieldvalue.cpp index 2bb9c1f4bc4..7bf5f5350d3 100644 --- a/document/src/vespa/document/fieldvalue/weightedsetfieldvalue.cpp +++ b/document/src/vespa/document/fieldvalue/weightedsetfieldvalue.cpp @@ -29,12 +29,12 @@ WeightedSetFieldValue::WeightedSetFieldValue(const DataType &type) : CollectionFieldValue(type), _map_type(new MapDataType(getKeyType(type), *DataType::INT)), _map(*_map_type), - _altered(true) { -} + _altered(true) +{ } -WeightedSetFieldValue::~WeightedSetFieldValue() -{ -} +WeightedSetFieldValue::WeightedSetFieldValue(const WeightedSetFieldValue &) = default; +WeightedSetFieldValue & WeightedSetFieldValue::operator = (const WeightedSetFieldValue &) = default; +WeightedSetFieldValue::~WeightedSetFieldValue() { } void WeightedSetFieldValue::verifyKey(const FieldValue & v) { diff --git a/document/src/vespa/document/fieldvalue/weightedsetfieldvalue.h b/document/src/vespa/document/fieldvalue/weightedsetfieldvalue.h index 28517f45aee..4d6be1fd35a 100644 --- a/document/src/vespa/document/fieldvalue/weightedsetfieldvalue.h +++ b/document/src/vespa/document/fieldvalue/weightedsetfieldvalue.h @@ -43,7 +43,11 @@ public: * easier to create instances using field's getDataType(). */ WeightedSetFieldValue(const DataType &wsetType); - virtual ~WeightedSetFieldValue(); + WeightedSetFieldValue(const WeightedSetFieldValue &); + WeightedSetFieldValue & operator = (const WeightedSetFieldValue &); + WeightedSetFieldValue(WeightedSetFieldValue &&) = default; + WeightedSetFieldValue & operator = (WeightedSetFieldValue &&) = default; + ~WeightedSetFieldValue(); void accept(FieldValueVisitor &visitor) override { visitor.visit(*this); } void accept(ConstFieldValueVisitor &visitor) const override { visitor.visit(*this); } diff --git a/document/src/vespa/document/update/addvalueupdate.cpp b/document/src/vespa/document/update/addvalueupdate.cpp index 408657f40f9..910e3d7dd50 100644 --- a/document/src/vespa/document/update/addvalueupdate.cpp +++ b/document/src/vespa/document/update/addvalueupdate.cpp @@ -14,11 +14,17 @@ using vespalib::IllegalArgumentException; using vespalib::IllegalStateException; using vespalib::nbostream; -namespace document -{ +namespace document { IMPLEMENT_IDENTIFIABLE(AddValueUpdate, ValueUpdate); +AddValueUpdate:: AddValueUpdate(const FieldValue& value, int weight) + : ValueUpdate(), + _value(value.clone()), + _weight(weight) +{} + +AddValueUpdate::~AddValueUpdate() { } bool AddValueUpdate::operator==(const ValueUpdate& other) const { diff --git a/document/src/vespa/document/update/addvalueupdate.h b/document/src/vespa/document/update/addvalueupdate.h index 1180ba4fcf1..0130899bd7e 100644 --- a/document/src/vespa/document/update/addvalueupdate.h +++ b/document/src/vespa/document/update/addvalueupdate.h @@ -30,10 +30,8 @@ public: * @param value The field value to add. * @param weight The weight for the field value. */ - AddValueUpdate(const FieldValue& value, int weight = 1) - : ValueUpdate(), - _value(value.clone()), - _weight(weight) {} + AddValueUpdate(const FieldValue& value, int weight = 1); + ~AddValueUpdate(); bool operator==(const ValueUpdate& other) const override; diff --git a/document/src/vespa/document/update/assignvalueupdate.cpp b/document/src/vespa/document/update/assignvalueupdate.cpp index dcadcbf279b..0538bec10e5 100644 --- a/document/src/vespa/document/update/assignvalueupdate.cpp +++ b/document/src/vespa/document/update/assignvalueupdate.cpp @@ -1,10 +1,10 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +#include "assignvalueupdate.h" #include <vespa/document/base/field.h> #include <vespa/document/fieldvalue/fieldvalues.h> #include <vespa/document/repo/fixedtyperepo.h> #include <vespa/document/serialization/vespadocumentdeserializer.h> -#include <vespa/document/update/assignvalueupdate.h> #include <vespa/vespalib/objects/nbostream.h> #include <vespa/vespalib/util/exceptions.h> @@ -12,11 +12,19 @@ using vespalib::IllegalArgumentException; using vespalib::IllegalStateException; using vespalib::nbostream; -namespace document -{ +namespace document { IMPLEMENT_IDENTIFIABLE(AssignValueUpdate, ValueUpdate); +AssignValueUpdate::AssignValueUpdate() : ValueUpdate(), _value() {} + +AssignValueUpdate::AssignValueUpdate(const FieldValue& value) + : ValueUpdate(), + _value(value.clone()) +{ +} +AssignValueUpdate::~AssignValueUpdate() {} + // Declare content bits. static const unsigned char CONTENT_HASVALUE = 0x01; diff --git a/document/src/vespa/document/update/assignvalueupdate.h b/document/src/vespa/document/update/assignvalueupdate.h index 3811bad42aa..e28c7124364 100644 --- a/document/src/vespa/document/update/assignvalueupdate.h +++ b/document/src/vespa/document/update/assignvalueupdate.h @@ -23,13 +23,10 @@ class AssignValueUpdate : public ValueUpdate { public: typedef std::unique_ptr<AssignValueUpdate> UP; - AssignValueUpdate() : ValueUpdate(), _value() {} + AssignValueUpdate(); - AssignValueUpdate(const FieldValue& value) - : ValueUpdate(), - _value(value.clone()) - { - } + AssignValueUpdate(const FieldValue& value); + ~AssignValueUpdate(); bool operator==(const ValueUpdate& other) const override; diff --git a/document/src/vespa/document/update/fieldupdate.cpp b/document/src/vespa/document/update/fieldupdate.cpp index 5a677488467..3141fdf3a4f 100644 --- a/document/src/vespa/document/update/fieldupdate.cpp +++ b/document/src/vespa/document/update/fieldupdate.cpp @@ -27,6 +27,8 @@ FieldUpdate::FieldUpdate(const DocumentTypeRepo& repo, deserialize(repo, type, buffer, version); } +FieldUpdate::FieldUpdate(const FieldUpdate &) = default; +FieldUpdate & FieldUpdate::operator = (const FieldUpdate &) = default; FieldUpdate::~FieldUpdate() {} bool diff --git a/document/src/vespa/document/update/fieldupdate.h b/document/src/vespa/document/update/fieldupdate.h index d0e4fd3235e..38a801f16bd 100644 --- a/document/src/vespa/document/update/fieldupdate.h +++ b/document/src/vespa/document/update/fieldupdate.h @@ -34,6 +34,10 @@ public: typedef vespalib::CloneablePtr<FieldUpdate> CP; FieldUpdate(const Field& field); + FieldUpdate(const FieldUpdate &); + FieldUpdate & operator = (const FieldUpdate &); + FieldUpdate(FieldUpdate &&) = default; + FieldUpdate & operator = (FieldUpdate &&) = default; ~FieldUpdate(); /** diff --git a/document/src/vespa/document/update/removevalueupdate.cpp b/document/src/vespa/document/update/removevalueupdate.cpp index 19e72e71e8a..e0575f600da 100644 --- a/document/src/vespa/document/update/removevalueupdate.cpp +++ b/document/src/vespa/document/update/removevalueupdate.cpp @@ -18,6 +18,13 @@ namespace document IMPLEMENT_IDENTIFIABLE(RemoveValueUpdate, ValueUpdate); +RemoveValueUpdate::RemoveValueUpdate(const FieldValue& key) + : ValueUpdate(), + _key(key.clone()) +{} + +RemoveValueUpdate::~RemoveValueUpdate() {} + bool RemoveValueUpdate::operator==(const ValueUpdate& other) const { diff --git a/document/src/vespa/document/update/removevalueupdate.h b/document/src/vespa/document/update/removevalueupdate.h index 42590104870..6db1903a6dd 100644 --- a/document/src/vespa/document/update/removevalueupdate.h +++ b/document/src/vespa/document/update/removevalueupdate.h @@ -24,9 +24,8 @@ public: * * @param value The identifier of the field value to update. */ - RemoveValueUpdate(const FieldValue& key) - : ValueUpdate(), - _key(key.clone()) {} + RemoveValueUpdate(const FieldValue& key); + ~RemoveValueUpdate(); bool operator==(const ValueUpdate& other) const override; |