Albert
Loading...
Searching...
No Matches
rankitem.h
1// SPDX-FileCopyrightText: 2025 Manuel Schneider
2// SPDX-License-Identifier: MIT
3
4#pragma once
5#include <albert/export.h>
6#include <albert/item.h>
7#include <memory>
8
9namespace albert
10{
11
19class ALBERT_EXPORT RankItem
20{
21public:
22
26 RankItem(const std::shared_ptr<Item> &item, double score) noexcept;
27
31 RankItem(std::shared_ptr<Item> &&item, double score) noexcept;
32
33 // RankItem(const RankItem &other) = delete;
34 // RankItem(RankItem &&other) = default;
35 // RankItem &operator=(const RankItem &other) = delete;
36 // RankItem &operator=(RankItem &&other) = default;
37
41 bool operator<(const RankItem &other) const;
42
46 bool operator>(const RankItem &other) const;
47
51 std::shared_ptr<Item> item;
52
62 double score;
63};
64
65}
An Item with a score.
Definition rankitem.h:20
bool operator>(const RankItem &other) const
The greater operator.
RankItem(const std::shared_ptr< Item > &item, double score) noexcept
Constructs a RankItem with the given item and score.
double score
The match score.
Definition rankitem.h:62
std::shared_ptr< Item > item
The matched item.
Definition rankitem.h:51
bool operator<(const RankItem &other) const
The less operator.
RankItem(std::shared_ptr< Item > &&item, double score) noexcept
Constructs a RankItem with the given item and score using move semantics.
The Albert namespace.
Definition app.h:55