From deeb1f23b97c43195a20c5981df3a71c42ec6f3f Mon Sep 17 00:00:00 2001 From: Henning Baldersheim Date: Thu, 7 Jun 2018 18:55:25 +0200 Subject: Reduce code visibility Conflicts: document/src/vespa/document/update/documentupdate.h document/src/vespa/document/update/mapvalueupdate.cpp --- document/src/tests/documentupdatetestcase.cpp | 1 + document/src/tests/fieldpathupdatetestcase.cpp | 2 ++ document/src/tests/testxml.cpp | 2 +- document/src/vespa/document/base/documentid.cpp | 12 ++++++- document/src/vespa/document/base/documentid.h | 19 +++-------- document/src/vespa/document/base/fieldpath.h | 1 - document/src/vespa/document/datatype/datatype.h | 4 +-- .../vespa/document/datatype/structureddatatype.cpp | 6 ++-- .../serialization/vespadocumentserializer.cpp | 1 + .../src/vespa/document/update/addvalueupdate.cpp | 1 + .../document/update/arithmeticvalueupdate.cpp | 10 +++--- .../vespa/document/update/assignvalueupdate.cpp | 10 +++--- .../src/vespa/document/update/documentupdate.cpp | 1 + .../src/vespa/document/update/documentupdate.h | 5 +-- .../src/vespa/document/update/fieldpathupdate.h | 3 -- document/src/vespa/document/update/fieldupdate.cpp | 1 + document/src/vespa/document/update/fieldupdate.h | 1 - .../src/vespa/document/update/mapvalueupdate.cpp | 37 ++++++++-------------- .../vespa/document/update/removevalueupdate.cpp | 25 +++++---------- document/src/vespa/document/update/valueupdate.cpp | 5 ++- document/src/vespa/document/update/valueupdate.h | 3 -- document/src/vespa/document/util/printable.h | 10 ++---- document/src/vespa/document/util/serializable.cpp | 14 -------- document/src/vespa/document/util/serializable.h | 32 ------------------- .../conformancetest/conformancetest.cpp | 1 + .../proton/feedoperation/updateoperation.cpp | 1 + 26 files changed, 64 insertions(+), 144 deletions(-) diff --git a/document/src/tests/documentupdatetestcase.cpp b/document/src/tests/documentupdatetestcase.cpp index 67fafadd8cd..6b52d4018b3 100644 --- a/document/src/tests/documentupdatetestcase.cpp +++ b/document/src/tests/documentupdatetestcase.cpp @@ -14,6 +14,7 @@ #include #include #include +#include #include #include diff --git a/document/src/tests/fieldpathupdatetestcase.cpp b/document/src/tests/fieldpathupdatetestcase.cpp index 7058af95828..b240f322e4b 100644 --- a/document/src/tests/fieldpathupdatetestcase.cpp +++ b/document/src/tests/fieldpathupdatetestcase.cpp @@ -11,6 +11,8 @@ #include #include +#include + #include #include #include diff --git a/document/src/tests/testxml.cpp b/document/src/tests/testxml.cpp index 76cb13c78e9..4cc1306ff45 100644 --- a/document/src/tests/testxml.cpp +++ b/document/src/tests/testxml.cpp @@ -1,6 +1,5 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. - #include #include #include @@ -11,6 +10,7 @@ #include #include #include +#include #include using vespalib::StringTokenizer; diff --git a/document/src/vespa/document/base/documentid.cpp b/document/src/vespa/document/base/documentid.cpp index d5e84e48e38..d2eae01922d 100644 --- a/document/src/vespa/document/base/documentid.cpp +++ b/document/src/vespa/document/base/documentid.cpp @@ -15,7 +15,7 @@ DocumentId::DocumentId() { } -DocumentId::DocumentId(const vespalib::stringref & id) +DocumentId::DocumentId(vespalib::stringref id) : Printable(), _globalId(), _id(IdString::createIdString(id.c_str(), id.size()).release()) @@ -42,6 +42,11 @@ DocumentId::toString() const { return _id->toString(); } +void DocumentId::set(vespalib::stringref id) { + _id.reset(IdString::createIdString(id).release()); + _globalId.first = false; +} + void DocumentId::print(std::ostream& out, bool verbose, const std::string& indent) const { @@ -61,6 +66,11 @@ DocumentId::getSerializedSize() const return _id->toString().size() + 1; } +void DocumentId::swap(DocumentId & rhs) { + _id.swap(rhs._id); + std::swap(_globalId, rhs._globalId); +} + void DocumentId::calculateGlobalId() const { diff --git a/document/src/vespa/document/base/documentid.h b/document/src/vespa/document/base/documentid.h index 319ec1187ba..4611de73741 100644 --- a/document/src/vespa/document/base/documentid.h +++ b/document/src/vespa/document/base/documentid.h @@ -43,20 +43,16 @@ public: * * @throws IdParseException If the identifier given is invalid. */ - explicit DocumentId(const vespalib::stringref & id); + explicit DocumentId(vespalib::stringref id); - void set(const vespalib::stringref & id) { - _id.reset(IdString::createIdString(id).release()); - _globalId.first = false; - } + void set(vespalib::stringref id); /** Hides the printable toString() for effiency reasons. */ vespalib::string toString() const; - void print(std::ostream& out, bool verbose, - const std::string& indent) const override; + void print(std::ostream& out, bool verbose, const std::string& indent) const override; bool operator==(const DocumentId& other) const { return *_id == *other._id; } bool operator!=(const DocumentId& other) const { return ! (*_id == *other._id); } @@ -71,16 +67,11 @@ public: } DocumentId* clone() const { return new DocumentId(*this); } - virtual size_t getSerializedSize() const; - void swap(DocumentId & rhs) { - _id.swap(rhs._id); - std::swap(_globalId, rhs._globalId); - } - + void swap(DocumentId & rhs); private: mutable std::pair _globalId; - IdString::CP _id; + vespalib::CloneablePtr _id; void calculateGlobalId() const; }; diff --git a/document/src/vespa/document/base/fieldpath.h b/document/src/vespa/document/base/fieldpath.h index 578b54faf56..42248bf2595 100644 --- a/document/src/vespa/document/base/fieldpath.h +++ b/document/src/vespa/document/base/fieldpath.h @@ -4,7 +4,6 @@ #include "field.h" #include #include -#include #include namespace vespalib { class ObjectVisitor; } diff --git a/document/src/vespa/document/datatype/datatype.h b/document/src/vespa/document/datatype/datatype.h index 11c321f29e6..fae33ea2a42 100644 --- a/document/src/vespa/document/datatype/datatype.h +++ b/document/src/vespa/document/datatype/datatype.h @@ -12,9 +12,6 @@ #include #include -#include -#include -#include namespace document { @@ -24,6 +21,7 @@ class NumericDataType; class PrimitiveDataType; class DocumentType; class WeightedSetDataType; +class FieldPath; class DataType : public vespalib::Cloneable, public Printable, diff --git a/document/src/vespa/document/datatype/structureddatatype.cpp b/document/src/vespa/document/datatype/structureddatatype.cpp index e054cf24706..41c0cd6f4e7 100644 --- a/document/src/vespa/document/datatype/structureddatatype.cpp +++ b/document/src/vespa/document/datatype/structureddatatype.cpp @@ -1,6 +1,7 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "structureddatatype.h" +#include #include #include @@ -10,10 +11,7 @@ namespace document { IMPLEMENT_IDENTIFIABLE_ABSTRACT(StructuredDataType, DataType); -StructuredDataType::StructuredDataType() : - DataType() -{ -} +StructuredDataType::StructuredDataType() = default; StructuredDataType::StructuredDataType(const vespalib::stringref &name) : DataType(name, createId(name)) diff --git a/document/src/vespa/document/serialization/vespadocumentserializer.cpp b/document/src/vespa/document/serialization/vespadocumentserializer.cpp index 919f02a5fee..1a628ea2618 100644 --- a/document/src/vespa/document/serialization/vespadocumentserializer.cpp +++ b/document/src/vespa/document/serialization/vespadocumentserializer.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include diff --git a/document/src/vespa/document/update/addvalueupdate.cpp b/document/src/vespa/document/update/addvalueupdate.cpp index 73f106f8559..8ac1ee301eb 100644 --- a/document/src/vespa/document/update/addvalueupdate.cpp +++ b/document/src/vespa/document/update/addvalueupdate.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include #include diff --git a/document/src/vespa/document/update/arithmeticvalueupdate.cpp b/document/src/vespa/document/update/arithmeticvalueupdate.cpp index 61fc9d93563..b84dbe0f366 100644 --- a/document/src/vespa/document/update/arithmeticvalueupdate.cpp +++ b/document/src/vespa/document/update/arithmeticvalueupdate.cpp @@ -2,6 +2,7 @@ #include "arithmeticvalueupdate.h" #include #include +#include #include #include @@ -9,8 +10,7 @@ using vespalib::IllegalArgumentException; using vespalib::IllegalStateException; using namespace vespalib::xml; -namespace document -{ +namespace document { IMPLEMENT_IDENTIFIABLE(ArithmeticValueUpdate, ValueUpdate); @@ -22,8 +22,7 @@ bool ArithmeticValueUpdate::operator==(const ValueUpdate& other) const { if (other.getClass().id() != ArithmeticValueUpdate::classId) return false; - const ArithmeticValueUpdate& o( - static_cast(other)); + const ArithmeticValueUpdate& o(static_cast(other)); if (_operator != o._operator) return false; if (_operand != o._operand) return false; return true; @@ -115,8 +114,7 @@ ArithmeticValueUpdate::applyTo(const std::string & value) const void ArithmeticValueUpdate::print(std::ostream& out, bool, const std::string& indent) const { - out << indent << "ArithmeticValueUpdate(" << operatorNameC[_operator] - << " " << _operand << ")"; + out << indent << "ArithmeticValueUpdate(" << operatorNameC[_operator] << " " << _operand << ")"; } void diff --git a/document/src/vespa/document/update/assignvalueupdate.cpp b/document/src/vespa/document/update/assignvalueupdate.cpp index 81d4097d13b..fb38a78690b 100644 --- a/document/src/vespa/document/update/assignvalueupdate.cpp +++ b/document/src/vespa/document/update/assignvalueupdate.cpp @@ -4,11 +4,11 @@ #include #include #include +#include #include #include #include - using vespalib::IllegalArgumentException; using vespalib::IllegalStateException; using vespalib::nbostream; @@ -18,14 +18,14 @@ namespace document { IMPLEMENT_IDENTIFIABLE(AssignValueUpdate, ValueUpdate); -AssignValueUpdate::AssignValueUpdate() : ValueUpdate(), _value() {} +AssignValueUpdate::AssignValueUpdate() = default; AssignValueUpdate::AssignValueUpdate(const FieldValue& value) : ValueUpdate(), _value(value.clone()) { } -AssignValueUpdate::~AssignValueUpdate() {} +AssignValueUpdate::~AssignValueUpdate() = default; // Declare content bits. static const unsigned char CONTENT_HASVALUE = 0x01; @@ -90,9 +90,7 @@ AssignValueUpdate::printXml(XmlOutputStream& xos) const // Deserialize this update from the given buffer. void -AssignValueUpdate::deserialize( - const DocumentTypeRepo& repo, const DataType& type, - ByteBuffer& buffer, uint16_t version) +AssignValueUpdate::deserialize(const DocumentTypeRepo& repo, const DataType& type, ByteBuffer& buffer, uint16_t version) { // Read content bit vector. unsigned char content = 0x00; diff --git a/document/src/vespa/document/update/documentupdate.cpp b/document/src/vespa/document/update/documentupdate.cpp index a3cc2a95155..30b760a6102 100644 --- a/document/src/vespa/document/update/documentupdate.cpp +++ b/document/src/vespa/document/update/documentupdate.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include diff --git a/document/src/vespa/document/update/documentupdate.h b/document/src/vespa/document/update/documentupdate.h index a7f9d13d693..c4b351674b5 100644 --- a/document/src/vespa/document/update/documentupdate.h +++ b/document/src/vespa/document/update/documentupdate.h @@ -28,9 +28,7 @@ #include "fieldupdate.h" #include "fieldpathupdate.h" #include -#include -#include -#include +#include namespace document { @@ -166,4 +164,3 @@ private: }; } // document - diff --git a/document/src/vespa/document/update/fieldpathupdate.h b/document/src/vespa/document/update/fieldpathupdate.h index 6629aa74aee..76d529fec68 100644 --- a/document/src/vespa/document/update/fieldpathupdate.h +++ b/document/src/vespa/document/update/fieldpathupdate.h @@ -4,9 +4,6 @@ #include "updatevisitor.h" #include #include -#include -#include -#include namespace document { diff --git a/document/src/vespa/document/update/fieldupdate.cpp b/document/src/vespa/document/update/fieldupdate.cpp index 277d6467ae8..52fe0071b94 100644 --- a/document/src/vespa/document/update/fieldupdate.cpp +++ b/document/src/vespa/document/update/fieldupdate.cpp @@ -4,6 +4,7 @@ #include #include #include +#include namespace document { diff --git a/document/src/vespa/document/update/fieldupdate.h b/document/src/vespa/document/update/fieldupdate.h index 569fb21fe1c..fc94df605af 100644 --- a/document/src/vespa/document/update/fieldupdate.h +++ b/document/src/vespa/document/update/fieldupdate.h @@ -15,7 +15,6 @@ #include "valueupdate.h" #include -#include namespace document { diff --git a/document/src/vespa/document/update/mapvalueupdate.cpp b/document/src/vespa/document/update/mapvalueupdate.cpp index 09cec34c388..568b661e03d 100644 --- a/document/src/vespa/document/update/mapvalueupdate.cpp +++ b/document/src/vespa/document/update/mapvalueupdate.cpp @@ -4,9 +4,10 @@ #include #include #include -#include #include +#include #include +#include using vespalib::IllegalArgumentException; using vespalib::IllegalStateException; @@ -25,7 +26,7 @@ MapValueUpdate::MapValueUpdate(const FieldValue& key, const ValueUpdate& update) MapValueUpdate::MapValueUpdate(const MapValueUpdate &) = default; MapValueUpdate & MapValueUpdate::operator = (const MapValueUpdate &) = default; -MapValueUpdate::~MapValueUpdate() {} +MapValueUpdate::~MapValueUpdate() = default; bool MapValueUpdate::operator==(const ValueUpdate& other) const @@ -45,18 +46,15 @@ MapValueUpdate::checkCompatibility(const Field& field) const if (field.getDataType().getClass().id() == ArrayDataType::classId) { if (_key->getClass().id() != IntFieldValue::classId) { throw IllegalArgumentException(vespalib::make_string( - "Key for field '%s' is of wrong type (expected '%s', " - "was '%s').", + "Key for field '%s' is of wrong type (expected '%s', was '%s').", field.getName().c_str(), DataType::INT->toString().c_str(), _key->getDataType()->toString().c_str()), VESPA_STRLOC); } } else if (field.getDataType().getClass().id() == WeightedSetDataType::classId) { - const WeightedSetDataType& type = - static_cast(field.getDataType()); + const WeightedSetDataType& type = static_cast(field.getDataType()); if (!type.getNestedType().isValueType(*_key)) { throw IllegalArgumentException(vespalib::make_string( - "Key for field '%s' is of wrong type (expected '%s', " - "was '%s').", + "Key for field '%s' is of wrong type (expected '%s', was '%s').", field.getName().c_str(), DataType::INT->toString().c_str(), _key->getDataType()->toString().c_str()), VESPA_STRLOC); } @@ -81,11 +79,8 @@ MapValueUpdate::applyTo(FieldValue& value) const if (!_update->applyTo(val[_key->getAsInt()])) { val.remove(_key->getAsInt()); } - } else if (value.getDataType()->getClass().id() - == WeightedSetDataType::classId) - { - const WeightedSetDataType& type( - static_cast(*value.getDataType())); + } else if (value.getDataType()->getClass().id() == WeightedSetDataType::classId) { + const WeightedSetDataType& type(static_cast(*value.getDataType())); WeightedSetFieldValue& val(static_cast(value)); WeightedSetFieldValue::iterator it = val.find(*_key); if (it == val.end() && type.createIfNonExistent()) { @@ -133,9 +128,7 @@ MapValueUpdate::printXml(XmlOutputStream& xos) const // Deserialize this update from the given buffer. void -MapValueUpdate::deserialize(const DocumentTypeRepo& repo, - const DataType& type, - ByteBuffer& buffer, uint16_t version) +MapValueUpdate::deserialize(const DocumentTypeRepo& repo, const DataType& type, ByteBuffer& buffer, uint16_t version) { nbostream stream(buffer.getBufferAtPos(), buffer.getRemaining()); VespaDocumentDeserializer deserializer(repo, stream, version); @@ -146,24 +139,20 @@ MapValueUpdate::deserialize(const DocumentTypeRepo& repo, deserializer.read(*_key); buffer.incPos(buffer.getRemaining() - stream.size()); const ArrayDataType& arrayType = static_cast(type); - _update.reset(ValueUpdate::createInstance( - repo, arrayType.getNestedType(), buffer, version).release()); + _update.reset(ValueUpdate::createInstance(repo, arrayType.getNestedType(), buffer, version).release()); break; } case WeightedSetDataType::classId: { - const WeightedSetDataType& wset( - static_cast(type)); + const WeightedSetDataType& wset(static_cast(type)); _key.reset(wset.getNestedType().createFieldValue().release()); deserializer.read(*_key); buffer.incPos(buffer.getRemaining() - stream.size()); - _update.reset(ValueUpdate::createInstance( - repo, *DataType::INT, buffer, version).release()); + _update.reset(ValueUpdate::createInstance(repo, *DataType::INT, buffer, version).release()); break; } default: - throw DeserializeException("Can not perform map update on type " - + type.toString() + ".", VESPA_STRLOC); + throw DeserializeException("Can not perform map update on type " + type.toString() + ".", VESPA_STRLOC); } } diff --git a/document/src/vespa/document/update/removevalueupdate.cpp b/document/src/vespa/document/update/removevalueupdate.cpp index 76561e6633c..c21e7c93abe 100644 --- a/document/src/vespa/document/update/removevalueupdate.cpp +++ b/document/src/vespa/document/update/removevalueupdate.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include using vespalib::IllegalArgumentException; @@ -23,7 +24,7 @@ RemoveValueUpdate::RemoveValueUpdate(const FieldValue& key) _key(key.clone()) {} -RemoveValueUpdate::~RemoveValueUpdate() {} +RemoveValueUpdate::~RemoveValueUpdate() = default; bool RemoveValueUpdate::operator==(const ValueUpdate& other) const @@ -39,8 +40,7 @@ void RemoveValueUpdate::checkCompatibility(const Field& field) const { if (field.getDataType().inherits(CollectionDataType::classId)) { - const CollectionDataType& type = - static_cast(field.getDataType()); + const CollectionDataType& type = static_cast(field.getDataType()); if (!type.getNestedType().isValueType(*_key)) { throw IllegalArgumentException( "Cannot remove value of type " @@ -49,9 +49,7 @@ RemoveValueUpdate::checkCompatibility(const Field& field) const + field.getDataType().toString(), VESPA_STRLOC); } } else { - throw IllegalArgumentException( - "Can not remove a value from field of type " - + field.getDataType().toString(), VESPA_STRLOC); + throw IllegalArgumentException("Can not remove a value from field of type " + field.getDataType().toString(), VESPA_STRLOC); } } @@ -66,9 +64,7 @@ RemoveValueUpdate::applyTo(FieldValue& value) const WeightedSetFieldValue& doc(static_cast(value)); doc.remove(*_key); } else { - std::string err = vespalib::make_string( - "Unable to remove a value from a \"%s\" field value.", - value.getClass().name()); + std::string err = vespalib::make_string("Unable to remove a value from a \"%s\" field value.", value.getClass().name()); throw IllegalStateException(err, VESPA_STRLOC); } return true; @@ -89,16 +85,13 @@ RemoveValueUpdate::print(std::ostream& out, bool, const std::string&) const // Deserialize this update from the given buffer. void -RemoveValueUpdate::deserialize( - const DocumentTypeRepo& repo, const DataType& type, - ByteBuffer& buffer, uint16_t version) +RemoveValueUpdate::deserialize(const DocumentTypeRepo& repo, const DataType& type, ByteBuffer& buffer, uint16_t version) { switch(type.getClass().id()) { case ArrayDataType::classId: case WeightedSetDataType::classId: { - const CollectionDataType& c( - static_cast(type)); + const CollectionDataType& c(static_cast(type)); _key.reset(c.getNestedType().createFieldValue().release()); nbostream stream(buffer.getBufferAtPos(), buffer.getRemaining()); VespaDocumentDeserializer deserializer(repo, stream, version); @@ -107,9 +100,7 @@ RemoveValueUpdate::deserialize( break; } default: - throw DeserializeException( - "Can not perform remove operation on type " - + type.toString() + ".", VESPA_STRLOC); + throw DeserializeException("Can not perform remove operation on type " + type.toString() + ".", VESPA_STRLOC); } } diff --git a/document/src/vespa/document/update/valueupdate.cpp b/document/src/vespa/document/update/valueupdate.cpp index d44b1e2e0e5..103d9341f0e 100644 --- a/document/src/vespa/document/update/valueupdate.cpp +++ b/document/src/vespa/document/update/valueupdate.cpp @@ -2,6 +2,7 @@ #include "valueupdate.h" #include +#include #include namespace document { @@ -10,9 +11,7 @@ IMPLEMENT_IDENTIFIABLE_ABSTRACT(ValueUpdate, Identifiable); // Create a value update from a byte buffer. std::unique_ptr -ValueUpdate::createInstance(const DocumentTypeRepo& repo, - const DataType& type, ByteBuffer& buffer, - int serializationVersion) +ValueUpdate::createInstance(const DocumentTypeRepo& repo, const DataType& type, ByteBuffer& buffer, int serializationVersion) { ValueUpdate* update(NULL); int32_t classId = 0; diff --git a/document/src/vespa/document/update/valueupdate.h b/document/src/vespa/document/update/valueupdate.h index 25824799942..ffa40b1c191 100644 --- a/document/src/vespa/document/update/valueupdate.h +++ b/document/src/vespa/document/update/valueupdate.h @@ -19,11 +19,8 @@ #pragma once #include "updatevisitor.h" - #include -#include #include -#include namespace document { diff --git a/document/src/vespa/document/util/printable.h b/document/src/vespa/document/util/printable.h index 0771a6c04e5..71b93d4bdc4 100644 --- a/document/src/vespa/document/util/printable.h +++ b/document/src/vespa/document/util/printable.h @@ -16,8 +16,7 @@ #include #include -namespace document -{ +namespace document { class Printable { public: @@ -48,9 +47,7 @@ public: * @param indent This indentation should be printed AFTER each newline * printed. (Not before output in first line) */ - virtual void print(std::ostream& out, - bool verbose, - const std::string& indent) const = 0; + virtual void print(std::ostream& out, bool verbose, const std::string& indent) const = 0; /** * Utility function, since default arguments used in virtual functions is @@ -61,8 +58,7 @@ public: void print(std::ostream& out, const std::string& indent) const; /** Utility function to get this output as a string. */ - std::string toString(bool verbose=false, - const std::string& indent="") const; + std::string toString(bool verbose=false, const std::string& indent="") const; }; std::ostream& operator<<(std::ostream& out, const Printable& p); diff --git a/document/src/vespa/document/util/serializable.cpp b/document/src/vespa/document/util/serializable.cpp index 99f7d4943ff..32c7bef90f0 100644 --- a/document/src/vespa/document/util/serializable.cpp +++ b/document/src/vespa/document/util/serializable.cpp @@ -68,18 +68,4 @@ Deserializable::deserialize(const DocumentTypeRepo &repo, ByteBuffer& buffer) { throw; } } -void -VersionedDeserializable::deserialize(ByteBuffer& buffer, uint16_t version) { - int pos = buffer.getPos(); - try{ - onDeserialize(buffer, version); - } catch (const DeserializeException &) { - buffer.setPos(pos); - throw; - } catch (const BufferOutOfBoundsException &) { - buffer.setPos(pos); - throw; - } -} - } diff --git a/document/src/vespa/document/util/serializable.h b/document/src/vespa/document/util/serializable.h index 1a9c7f26894..8818feceb9a 100644 --- a/document/src/vespa/document/util/serializable.h +++ b/document/src/vespa/document/util/serializable.h @@ -94,37 +94,5 @@ public: void deserialize(const DocumentTypeRepo &repo, ByteBuffer& buffer); }; -/** - * If a deserializable needs a version number of the bytestream to deserialize, - * and they doesn't include this version number in their own bytestream, they - * can be VersionedDeserializable, getting version number externally. - * - * This is a special case used since document now uses this approach to - * deserialize its contents. It is preferable to let each component store its - * own version number, unless this has a big impact on the size of what is - * serialized. - */ -class VersionedDeserializable -{ -protected: - virtual void onDeserialize(ByteBuffer& buffer, uint16_t version) = 0; - -public: - virtual ~VersionedDeserializable() {} - - /** - * Overwrite this object with the object represented by the given - * bytestream. On success, buffer will be positioned after the bytestream - * representing the instance we've just deserialized, on failure, bytebuffer - * will be pointing to where it was pointing before calling this function. - * - * @throw DeserializeException If read data doesn't represent a legal object - * of this type. - * @throw BufferOutOfBoundsException If instance wants to read more data - * than is available in the buffer. - */ - void deserialize(ByteBuffer& buffer, uint16_t version); -}; - } diff --git a/persistence/src/vespa/persistence/conformancetest/conformancetest.cpp b/persistence/src/vespa/persistence/conformancetest/conformancetest.cpp index 2a215b099b6..f9538a94c59 100644 --- a/persistence/src/vespa/persistence/conformancetest/conformancetest.cpp +++ b/persistence/src/vespa/persistence/conformancetest/conformancetest.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include diff --git a/searchcore/src/vespa/searchcore/proton/feedoperation/updateoperation.cpp b/searchcore/src/vespa/searchcore/proton/feedoperation/updateoperation.cpp index 3468cc68ced..0e3bffcdcc2 100644 --- a/searchcore/src/vespa/searchcore/proton/feedoperation/updateoperation.cpp +++ b/searchcore/src/vespa/searchcore/proton/feedoperation/updateoperation.cpp @@ -2,6 +2,7 @@ #include "updateoperation.h" #include #include +#include #include LOG_SETUP(".proton.feedoperation.updateoperation"); -- cgit v1.2.3