summaryrefslogtreecommitdiffstats
path: root/document
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2020-01-28 15:00:35 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2020-01-28 15:00:35 +0000
commit489e9a99b1df2608413028e90e47cb3f4342ccfe (patch)
tree84849a50e7181a207dbf1a62166e1e3f991e383f /document
parenta5903ad899e38041cfe20f0acc110bbfd9d21d2b (diff)
Add comment about optimisation and object lifetime
Diffstat (limited to 'document')
-rw-r--r--document/src/vespa/document/fieldvalue/structuredfieldvalue.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/document/src/vespa/document/fieldvalue/structuredfieldvalue.h b/document/src/vespa/document/fieldvalue/structuredfieldvalue.h
index 867aabca537..54036566a26 100644
--- a/document/src/vespa/document/fieldvalue/structuredfieldvalue.h
+++ b/document/src/vespa/document/fieldvalue/structuredfieldvalue.h
@@ -94,6 +94,11 @@ protected:
virtual bool hasFieldValue(const Field&) const = 0;
virtual void removeFieldValue(const Field&) = 0;
virtual FieldValue::UP getFieldValue(const Field&) const = 0;
+ /**
+ * Fetches the value of the field and return true if present.
+ * The document, or the buffer the document was constructed from must live longer than the value.
+ * This restriction allows lightweight object representation and is significantly faster in many cases.
+ */
virtual bool getFieldValue(const Field& field, FieldValue& value) const = 0;
virtual void setFieldValue(const Field&, FieldValue::UP value) = 0;
void setFieldValue(const Field & field, const FieldValue & value);