diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2017-07-25 13:32:10 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2017-07-31 17:04:16 +0200 |
commit | 4cc809b6574a2ec15e32e7e94993b688d9bd545e (patch) | |
tree | 436f6744fd09c01f8105162c0ecfe8d9c773b1bb /document | |
parent | b4fc7b0ea0f710b04ebe64c6c4a9f981b6b0c25d (diff) |
Add interface to anable stealing the underlying value.
Diffstat (limited to 'document')
-rw-r--r-- | document/src/vespa/document/base/fieldpath.cpp | 5 | ||||
-rw-r--r-- | document/src/vespa/document/base/fieldpath.h | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/document/src/vespa/document/base/fieldpath.cpp b/document/src/vespa/document/base/fieldpath.cpp index 1d3d10ca730..041da6ad520 100644 --- a/document/src/vespa/document/base/fieldpath.cpp +++ b/document/src/vespa/document/base/fieldpath.cpp @@ -115,6 +115,11 @@ const DataType &FieldPathEntry::getDataType() const : *_dataType; } +FieldValue::UP FieldPathEntry::stealFieldValueToSet() const +{ + return FieldValue::UP(_fillInVal.release()); +} + void FieldPathEntry::visitMembers(vespalib::ObjectVisitor &visitor) const { diff --git a/document/src/vespa/document/base/fieldpath.h b/document/src/vespa/document/base/fieldpath.h index 42d03884645..25c6a4ce448 100644 --- a/document/src/vespa/document/base/fieldpath.h +++ b/document/src/vespa/document/base/fieldpath.h @@ -83,7 +83,8 @@ public: const vespalib::string& getVariableName() const { return _variableName; } FieldValue * getFieldValueToSetPtr() const { return _fillInVal.get(); } - FieldValue& getFieldValueToSet() const { return *_fillInVal; } + FieldValue & getFieldValueToSet() const { return *_fillInVal; } + std::unique_ptr<FieldValue> stealFieldValueToSet() const; void visitMembers(vespalib::ObjectVisitor &visitor) const override; /** * Parses a string of the format {["]escaped string["]} to its unescaped value. |