Albert
Loading...
Searching...
No Matches
rankitem.h
Go to the documentation of this file.
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 explicit RankItem(const std::shared_ptr<Item> &item, double score) noexcept;
27
31 explicit RankItem(std::shared_ptr<Item> &&item, double score) noexcept;
32
36 bool operator<(const RankItem &other) const;
37
41 bool operator>(const RankItem &other) const;
42
46 std::shared_ptr<Item> item;
47
57 double score;
58};
59
60}
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:57
std::shared_ptr< Item > item
The matched item.
Definition rankitem.h:46
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.
Definition app.h:56