aboutsummaryrefslogtreecommitdiffstats
path: root/storage/src/vespa/storageapi/mbusprot/protocolserialization6_0.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'storage/src/vespa/storageapi/mbusprot/protocolserialization6_0.cpp')
-rw-r--r--storage/src/vespa/storageapi/mbusprot/protocolserialization6_0.cpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/storage/src/vespa/storageapi/mbusprot/protocolserialization6_0.cpp b/storage/src/vespa/storageapi/mbusprot/protocolserialization6_0.cpp
new file mode 100644
index 00000000000..799aff8f8b3
--- /dev/null
+++ b/storage/src/vespa/storageapi/mbusprot/protocolserialization6_0.cpp
@@ -0,0 +1,40 @@
+// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+
+#include "protocolserialization6_0.h"
+#include "serializationhelper.h"
+
+namespace storage::mbusprot {
+
+ProtocolSerialization6_0::ProtocolSerialization6_0(const std::shared_ptr<const document::DocumentTypeRepo> &repo)
+ : ProtocolSerialization5_2(repo)
+{
+}
+
+document::Bucket
+ProtocolSerialization6_0::getBucket(document::ByteBuffer &buf) const
+{
+ document::BucketSpace bucketSpace(SH::getLong(buf));
+ document::BucketId bucketId(SH::getLong(buf));
+ return document::Bucket(bucketSpace, bucketId);
+}
+
+void
+ProtocolSerialization6_0::putBucket(const document::Bucket &bucket, vespalib::GrowableByteBuffer &buf) const
+{
+ buf.putLong(bucket.getBucketSpace().getId());
+ buf.putLong(bucket.getBucketId().getRawId());
+}
+
+document::BucketSpace
+ProtocolSerialization6_0::getBucketSpace(document::ByteBuffer &buf) const
+{
+ return document::BucketSpace(SH::getLong(buf));
+}
+
+void
+ProtocolSerialization6_0::putBucketSpace(document::BucketSpace bucketSpace, vespalib::GrowableByteBuffer &buf) const
+{
+ buf.putLong(bucketSpace.getId());
+}
+
+}