aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src/vespa/searchlib/tensor/tensor_store_saver.h
diff options
context:
space:
mode:
Diffstat (limited to 'searchlib/src/vespa/searchlib/tensor/tensor_store_saver.h')
-rw-r--r--searchlib/src/vespa/searchlib/tensor/tensor_store_saver.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/searchlib/src/vespa/searchlib/tensor/tensor_store_saver.h b/searchlib/src/vespa/searchlib/tensor/tensor_store_saver.h
new file mode 100644
index 00000000000..a4bf6e07519
--- /dev/null
+++ b/searchlib/src/vespa/searchlib/tensor/tensor_store_saver.h
@@ -0,0 +1,33 @@
+// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+
+#pragma once
+
+#include <vespa/searchlib/attribute/attributesaver.h>
+#include "tensor_attribute.h"
+
+namespace search::tensor {
+
+/*
+ * Class for saving a tensor attribute.
+ */
+class TensorStoreSaver : public AttributeSaver
+{
+public:
+ using RefCopyVector = TensorAttribute::RefCopyVector;
+private:
+ using GenerationHandler = vespalib::GenerationHandler;
+
+ RefCopyVector _refs;
+ const TensorStore& _tensorStore;
+
+ bool onSave(IAttributeSaveTarget &saveTarget) override;
+public:
+ TensorStoreSaver(GenerationHandler::Guard &&guard,
+ const attribute::AttributeHeader &header,
+ RefCopyVector &&refs,
+ const TensorStore &tensorStore);
+
+ virtual ~TensorStoreSaver();
+};
+
+} // namespace search::tensor