summaryrefslogtreecommitdiffstats
path: root/document/src
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@oath.com>2018-05-31 00:24:42 +0200
committerHenning Baldersheim <balder@oath.com>2018-05-31 13:51:20 +0200
commit3fb431aae0aabffd151ce44492d1be2727ad4bc5 (patch)
tree2d0d5c8c4c65c41a73d41196a43d5cd0b35d15b2 /document/src
parentf6cc918be775094726aa3c241ab4340e8363342f (diff)
GC some more unused code and properly test old formats without exposing production code.
Diffstat (limited to 'document/src')
-rw-r--r--document/src/vespa/document/update/documentupdate.h39
1 files changed, 20 insertions, 19 deletions
diff --git a/document/src/vespa/document/update/documentupdate.h b/document/src/vespa/document/update/documentupdate.h
index c84834e1a75..e2b72db2c2d 100644
--- a/document/src/vespa/document/update/documentupdate.h
+++ b/document/src/vespa/document/update/documentupdate.h
@@ -43,6 +43,16 @@ class Document;
*/
class DocumentUpdate final : public Printable, public XmlSerializable
{
+private:
+ /**
+ * Enum class containing the legal serialization version for
+ * document updates. This version is not encoded in the serialized
+ * document update.
+ */
+ enum class SerializeVersion {
+ SERIALIZE_42, // old style format, before vespa 5.0
+ SERIALIZE_HEAD // new style format, since vespa 5.0
+ };
public:
typedef std::unique_ptr<DocumentUpdate> UP;
typedef std::shared_ptr<DocumentUpdate> SP;
@@ -58,7 +68,16 @@ public:
* Create new style document update, possibly with field path updates.
*/
static DocumentUpdate::UP createHEAD(const DocumentTypeRepo&, ByteBuffer&);
-
+
+ /**
+ * Create a document update from a byte buffer containing a serialized
+ * document update. Public to allow useage in std::make_unique/shared.
+ *
+ * @param repo Document type repo used to find proper document type
+ * @param buffer The buffer containing the serialized document update
+ * @param serializeVersion Selector between serialization formats.
+ */
+ DocumentUpdate(const DocumentTypeRepo &repo, ByteBuffer &buffer, SerializeVersion serializeVersion);
/**
* The document type is not strictly needed, as we know this at applyTo()
* time, but search does not use applyTo() code to do the update, and don't
@@ -145,24 +164,6 @@ private:
bool _createIfNonExistent;
int deserializeFlags(int sizeAndFlags);
- /**
- * Enum class containing the legal serialization version for
- * document updates. This version is not encoded in the serialized
- * document update.
- */
- enum class SerializeVersion {
- SERIALIZE_42, // old style format, before vespa 5.0
- SERIALIZE_HEAD // new style format, since vespa 5.0
- };
- /**
- * Create a document update from a byte buffer containing a serialized
- * document update.
- *
- * @param repo Document type repo used to find proper document type
- * @param buffer The buffer containing the serialized document update
- * @param serializeVersion Selector between serialization formats.
- */
- DocumentUpdate(const DocumentTypeRepo &repo, ByteBuffer &buffer, SerializeVersion serializeVersion);
};
} // document