diff options
author | Henning Baldersheim <balder@oath.com> | 2018-05-29 23:52:23 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@oath.com> | 2018-05-29 23:52:23 +0200 |
commit | 7464fdcbd41ab78ab40832ef520040d5d3085009 (patch) | |
tree | 76003dd9a945621c78faaaf2d8b4b0d98f0111dc /document | |
parent | abb73351b0d0b1904eb11c2d85413328e505883d (diff) |
GC some more unused code
Diffstat (limited to 'document')
-rw-r--r-- | document/src/vespa/document/update/documentupdate.cpp | 18 | ||||
-rw-r--r-- | document/src/vespa/document/update/documentupdate.h | 14 |
2 files changed, 9 insertions, 23 deletions
diff --git a/document/src/vespa/document/update/documentupdate.cpp b/document/src/vespa/document/update/documentupdate.cpp index 8d497378ca4..c4e8213f1df 100644 --- a/document/src/vespa/document/update/documentupdate.cpp +++ b/document/src/vespa/document/update/documentupdate.cpp @@ -21,18 +21,14 @@ using namespace vespalib::xml; namespace document { -IMPLEMENT_IDENTIFIABLE(DocumentUpdate, vespalib::Identifiable); - // Declare content bits. static const unsigned char CONTENT_HASTYPE = 0x01; -typedef std::vector<FieldUpdate> FieldUpdateList; -typedef std::vector<FieldPathUpdate::CP> FieldPathUpdateList; - DocumentUpdate::DocumentUpdate() : _documentId("doc::"), _type(DataType::DOCUMENT), _updates(), + _fieldPathUpdates(), _version(Document::getNewestSerializationVersion()), _createIfNonExistent(false) { @@ -42,6 +38,7 @@ DocumentUpdate::DocumentUpdate(const DataType &type, const DocumentId& id) : _documentId(id), _type(&type), _updates(), + _fieldPathUpdates(), _version(Document::getNewestSerializationVersion()), _createIfNonExistent(false) { @@ -109,11 +106,6 @@ DocumentUpdate::addFieldPathUpdate(const FieldPathUpdate::CP& update) { return *this; } -DocumentUpdate* -DocumentUpdate::clone() const { - return new DocumentUpdate(*this); -} - void DocumentUpdate::print(std::ostream& out, bool verbose, const std::string& indent) const @@ -223,15 +215,13 @@ namespace { DocumentUpdate::UP DocumentUpdate::create42(const DocumentTypeRepo& repo, ByteBuffer& buffer) { - return std::make_unique<DocumentUpdate>(repo, buffer, - SerializeVersion::SERIALIZE_42); + return std::make_unique<DocumentUpdate>(repo, buffer, SerializeVersion::SERIALIZE_42); } DocumentUpdate::UP DocumentUpdate::createHEAD(const DocumentTypeRepo& repo, ByteBuffer& buffer) { - return std::make_unique<DocumentUpdate>(repo, buffer, - SerializeVersion::SERIALIZE_HEAD); + return std::make_unique<DocumentUpdate>(repo, buffer, SerializeVersion::SERIALIZE_HEAD); } void diff --git a/document/src/vespa/document/update/documentupdate.h b/document/src/vespa/document/update/documentupdate.h index 328ab622f25..759e0131694 100644 --- a/document/src/vespa/document/update/documentupdate.h +++ b/document/src/vespa/document/update/documentupdate.h @@ -41,9 +41,7 @@ class Document; * path updates was added, and a new serialization format was * introduced while keeping the old one. */ -class DocumentUpdate : public vespalib::Identifiable, - public Printable, - public XmlSerializable +class DocumentUpdate final : public Printable, public XmlSerializable { public: typedef std::unique_ptr<DocumentUpdate> UP; @@ -90,10 +88,11 @@ public: * @param buffer The buffer containing the serialized document update * @param serializeVersion Selector between serialization formats. */ - DocumentUpdate(const DocumentTypeRepo &repo, ByteBuffer &buffer, - SerializeVersion serializeVersion); + DocumentUpdate(const DocumentTypeRepo &repo, ByteBuffer &buffer, SerializeVersion serializeVersion); - ~DocumentUpdate(); + DocumentUpdate(const DocumentUpdate &) = delete; + DocumentUpdate & operator = (const DocumentUpdate &) = delete; + ~DocumentUpdate() override; bool operator==(const DocumentUpdate&) const; bool operator!=(const DocumentUpdate & rhs) const { return ! (*this == rhs); } @@ -139,8 +138,6 @@ public: void printXml(XmlOutputStream&) const override; - virtual DocumentUpdate* clone() const; - /** * Sets whether this update should create the document it updates if that document does not exist. * In this case an empty document is created before the update is applied. @@ -159,7 +156,6 @@ public: int serializeFlags(int size_) const; int16_t getVersion() const { return _version; } - DECLARE_IDENTIFIABLE(DocumentUpdate); private: DocumentId _documentId; // The ID of the document to update. const DataType *_type; // The type of document this update is for. |