diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2020-08-14 16:08:20 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2020-08-14 16:08:20 +0000 |
commit | bbc768d6ef92f166717d65e67689f6aa15c98952 (patch) | |
tree | e8c891cb5e4a45df93a58eb39c5e10988b0afe7d /document | |
parent | e98b5a77300eda52f082b9c17b9cf4915b3fe4b0 (diff) |
Change api so that we can drop clone from the interface and prepare for using a true repo.
Diffstat (limited to 'document')
-rw-r--r-- | document/src/vespa/document/base/field.h | 1 | ||||
-rw-r--r-- | document/src/vespa/document/fieldset/fieldset.h | 8 | ||||
-rw-r--r-- | document/src/vespa/document/fieldset/fieldsetrepo.h | 3 | ||||
-rw-r--r-- | document/src/vespa/document/fieldset/fieldsets.h | 17 |
4 files changed, 4 insertions, 25 deletions
diff --git a/document/src/vespa/document/base/field.h b/document/src/vespa/document/base/field.h index 7580b2b692f..305021ef29a 100644 --- a/document/src/vespa/document/base/field.h +++ b/document/src/vespa/document/base/field.h @@ -88,7 +88,6 @@ public: */ Field(vespalib::stringref name, const DataType &dataType); - Field* clone() const override { return new Field(*this); } std::unique_ptr<FieldValue> createValue() const; // Note that only id is checked for equality. diff --git a/document/src/vespa/document/fieldset/fieldset.h b/document/src/vespa/document/fieldset/fieldset.h index 35c912c5e45..3d74659ebf5 100644 --- a/document/src/vespa/document/fieldset/fieldset.h +++ b/document/src/vespa/document/fieldset/fieldset.h @@ -23,7 +23,8 @@ public: DOCID }; - typedef std::unique_ptr<FieldSet> UP; + using SP = std::shared_ptr<FieldSet>; + using UP = std::unique_ptr<FieldSet>; virtual ~FieldSet() = default; @@ -39,11 +40,6 @@ public: virtual Type getType() const = 0; /** - * @return Returns a copy of this object. - */ - virtual FieldSet* clone() const = 0; - - /** * Copy all fields from src into dest that are contained within the * given field set. If any copied field pre-exists in dest, it will * be overwritten. diff --git a/document/src/vespa/document/fieldset/fieldsetrepo.h b/document/src/vespa/document/fieldset/fieldsetrepo.h index a744aa572e5..bfe9c05d1ca 100644 --- a/document/src/vespa/document/fieldset/fieldsetrepo.h +++ b/document/src/vespa/document/fieldset/fieldsetrepo.h @@ -16,8 +16,7 @@ class DocumentTypeRepo; class FieldSetRepo { public: - static FieldSet::UP parse(const DocumentTypeRepo& repo, - vespalib::stringref fieldSetString); + static FieldSet::UP parse(const DocumentTypeRepo& repo, vespalib::stringref fieldSetString); static vespalib::string serialize(const FieldSet& fs); }; diff --git a/document/src/vespa/document/fieldset/fieldsets.h b/document/src/vespa/document/fieldset/fieldsets.h index 9537a5bdf61..e71a96e5a7e 100644 --- a/document/src/vespa/document/fieldset/fieldsets.h +++ b/document/src/vespa/document/fieldset/fieldsets.h @@ -13,7 +13,6 @@ public: static constexpr const char * NAME = "[all]"; bool contains(const FieldSet&) const override { return true; } Type getType() const override { return Type::ALL; } - FieldSet* clone() const override { return new AllFields(); } }; class NoFields final : public FieldSet @@ -22,7 +21,6 @@ public: static constexpr const char * NAME = "[none]"; bool contains(const FieldSet& f) const override { return f.getType() == Type::NONE; } Type getType() const override { return Type::NONE; } - FieldSet* clone() const override { return new NoFields(); } }; class DocIdOnly final : public FieldSet @@ -33,7 +31,6 @@ public: return fields.getType() == Type::DOCID || fields.getType() == Type::NONE; } Type getType() const override { return Type::DOCID; } - FieldSet* clone() const override { return new DocIdOnly(); } }; class FieldCollection : public FieldSet @@ -49,20 +46,8 @@ public: bool contains(const FieldSet& fields) const override; Type getType() const override { return Type::SET; } - /** - * @return Returns the document type the collection is associated with. - */ - const DocumentType& getDocumentType() const { - return _docType; - } - - /** - * Returns all the fields contained in this collection. - */ + const DocumentType& getDocumentType() const { return _docType; } const Field::Set& getFields() const { return _set; } - - FieldSet* clone() const override { return new FieldCollection(*this); } - uint64_t hash() const { return _hash; } private: Field::Set _set; |