Albert
Loading...
Searching...
No Matches
rankitem.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2024 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
17class ALBERT_EXPORT RankItem
18{
19public:
21 explicit RankItem(const std::shared_ptr<Item> &item, double score) noexcept;
22
24 explicit RankItem(std::shared_ptr<Item> &&item, double score) noexcept;
25
27 bool operator<(const RankItem &other) const;
28
30 bool operator>(const RankItem &other) const;
31
33 std::shared_ptr<Item> item;
34
44 double score;
45};
46
47}
An Item with a score.
Definition rankitem.h:18
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:44
std::shared_ptr< Item > item
The matched item.
Definition rankitem.h:33
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 action.h:10