Skip to content

Commit

Permalink
Merge pull request #31497 from vespa-engine/toregge/add-const-attribu…
Browse files Browse the repository at this point in the history
…tes-to-mock-attribute-context

Add const attributes to mock attribute context.
  • Loading branch information
baldersheim authored Jun 9, 2024
2 parents d94bb52 + 0b0ca9d commit 16f41ff
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ MockAttributeContext::getAttributeList(std::vector<const IAttributeVector *> & l
MockAttributeContext::~MockAttributeContext() = default;

void
MockAttributeContext::add(std::shared_ptr<IAttributeVector> attr) {
MockAttributeContext::add(std::shared_ptr<const IAttributeVector> attr) {
_vectors[attr->getName()] = attr;
}

Expand Down
4 changes: 2 additions & 2 deletions searchlib/src/vespa/searchlib/test/mock_attribute_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ namespace search::attribute::test {
class MockAttributeContext : public IAttributeContext
{
private:
using Map = std::map<string, std::shared_ptr<IAttributeVector>>;
using Map = std::map<string, std::shared_ptr<const IAttributeVector>>;
Map _vectors;

public:
~MockAttributeContext() override;
void add(std::shared_ptr<IAttributeVector> attr);
void add(std::shared_ptr<const IAttributeVector> attr);

const IAttributeVector *get(const string &name) const;
const IAttributeVector * getAttribute(const string &name) const override;
Expand Down

0 comments on commit 16f41ff

Please sign in to comment.