summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArne Juul <arnej@verizonmedia.com>2020-11-24 13:24:21 +0000
committerArne Juul <arnej@verizonmedia.com>2020-11-24 13:24:21 +0000
commitd73cb9413b0b39943395a717ec20ce6cd89fa47f (patch)
tree81acb942876e38364115bc90a12af5daea3aaa6a
parent11e57b2a0ba2e68f654d2369c79024e44d321bd7 (diff)
add documentation comments
-rw-r--r--eval/src/vespa/eval/streamed/streamed_value.h6
-rw-r--r--eval/src/vespa/eval/streamed/streamed_value_builder.h3
-rw-r--r--eval/src/vespa/eval/streamed/streamed_value_index.h4
-rw-r--r--eval/src/vespa/eval/streamed/streamed_value_utils.h12
-rw-r--r--eval/src/vespa/eval/streamed/streamed_value_view.h5
5 files changed, 30 insertions, 0 deletions
diff --git a/eval/src/vespa/eval/streamed/streamed_value.h b/eval/src/vespa/eval/streamed/streamed_value.h
index bb9bb1f30b8..aac18c07066 100644
--- a/eval/src/vespa/eval/streamed/streamed_value.h
+++ b/eval/src/vespa/eval/streamed/streamed_value.h
@@ -8,6 +8,12 @@
namespace vespalib::eval {
+/**
+ * A very simple Value implementation.
+ * Cheap to construct from serialized data,
+ * and cheap to serialize or iterate through.
+ * Slow for full or partial lookups.
+ **/
template <typename T>
class StreamedValue : public Value
{
diff --git a/eval/src/vespa/eval/streamed/streamed_value_builder.h b/eval/src/vespa/eval/streamed/streamed_value_builder.h
index ca75dac840b..f60d485d6a3 100644
--- a/eval/src/vespa/eval/streamed/streamed_value_builder.h
+++ b/eval/src/vespa/eval/streamed/streamed_value_builder.h
@@ -7,6 +7,9 @@
namespace vespalib::eval {
+ /**
+ * Builder for StreamedValue objects.
+ **/
template <typename T>
class StreamedValueBuilder : public ValueBuilder<T>
{
diff --git a/eval/src/vespa/eval/streamed/streamed_value_index.h b/eval/src/vespa/eval/streamed/streamed_value_index.h
index f2571bd27c4..fdc1b813852 100644
--- a/eval/src/vespa/eval/streamed/streamed_value_index.h
+++ b/eval/src/vespa/eval/streamed/streamed_value_index.h
@@ -6,6 +6,10 @@
namespace vespalib::eval {
+ /**
+ * Implements Value::Index by reading a stream of serialized
+ * labels.
+ **/
class StreamedValueIndex : public Value::Index
{
public:
diff --git a/eval/src/vespa/eval/streamed/streamed_value_utils.h b/eval/src/vespa/eval/streamed/streamed_value_utils.h
index 7610e2cacd4..f314dc3f44e 100644
--- a/eval/src/vespa/eval/streamed/streamed_value_utils.h
+++ b/eval/src/vespa/eval/streamed/streamed_value_utils.h
@@ -7,6 +7,11 @@
namespace vespalib::eval {
+/**
+ * Reads a stream of serialized labels.
+ * Reading more labels than available will
+ * throw an exception.
+ **/
struct LabelStream {
nbostream_longlivedbuf source;
LabelStream(ConstArrayRef<char> data) : source(data.begin(), data.size()) {}
@@ -19,6 +24,9 @@ struct LabelStream {
void reset() { source.rp(0); }
};
+/**
+ * Represents an address (set of labels) mapping to a subspace index
+ **/
struct LabelBlock {
static constexpr size_t npos = -1;
size_t ss_idx;
@@ -26,6 +34,10 @@ struct LabelBlock {
operator bool() const { return ss_idx != npos; }
};
+/**
+ * Utility for reading a buffer with serialized labels
+ * as a stream of LabelBlock objects.
+ **/
class LabelBlockStream {
private:
size_t _num_subspaces;
diff --git a/eval/src/vespa/eval/streamed/streamed_value_view.h b/eval/src/vespa/eval/streamed/streamed_value_view.h
index 5dd428bee38..718519e44d3 100644
--- a/eval/src/vespa/eval/streamed/streamed_value_view.h
+++ b/eval/src/vespa/eval/streamed/streamed_value_view.h
@@ -8,6 +8,11 @@
namespace vespalib::eval {
+ /**
+ * Same characteristics as StreamedValue, but does not
+ * own its data - refers to type, cells and serialized
+ * labels that must be kept outside the Value.
+ **/
class StreamedValueView : public Value
{
private: