Fix emulator build error
[platform/framework/web/chromium-efl.git] / components / browsing_topics / candidate_topic.h
1 // Copyright 2022 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_BROWSING_TOPICS_CANDIDATE_TOPIC_H_
6 #define COMPONENTS_BROWSING_TOPICS_CANDIDATE_TOPIC_H_
7
8 #include "components/browsing_topics/common/common_types.h"
9
10 namespace browsing_topics {
11
12 // Contains a topic, the associated attributes, and flags that determine how
13 // the topic should be handled. This is used as the intermediate result type
14 // when calculating the topics for a site.
15 class CandidateTopic {
16  public:
17   static CandidateTopic Create(Topic topic,
18                                bool is_true_topic,
19                                bool should_be_filtered,
20                                int config_version,
21                                int taxonomy_version,
22                                int64_t model_version);
23
24   static CandidateTopic CreateInvalid();
25
26   CandidateTopic(const CandidateTopic&) = delete;
27   CandidateTopic& operator=(const CandidateTopic&) = delete;
28
29   CandidateTopic(CandidateTopic&&) = default;
30   CandidateTopic& operator=(CandidateTopic&&) = default;
31
32   bool IsValid() const { return topic_ != Topic(0); }
33
34   const Topic& topic() const { return topic_; }
35
36   bool is_true_topic() const { return is_true_topic_; }
37
38   bool should_be_filtered() const { return should_be_filtered_; }
39
40   int config_version() const { return config_version_; }
41
42   int taxonomy_version() const { return taxonomy_version_; }
43
44   int64_t model_version() const { return model_version_; }
45
46  private:
47   CandidateTopic(Topic topic,
48                  bool is_true_topic,
49                  bool should_be_filtered,
50                  int config_version,
51                  int taxonomy_version,
52                  int64_t model_version);
53
54   Topic topic_;
55   bool is_true_topic_;
56   bool should_be_filtered_;
57   int config_version_;
58   int taxonomy_version_;
59   int64_t model_version_;
60 };
61
62 }  // namespace browsing_topics
63
64 #endif  // COMPONENTS_BROWSING_TOPICS_UTIL_H_