1 #include <attn/attention.hpp>
2 #include <attn/attn_config.hpp>
3 
4 namespace attn
5 {
6 
7 /** @brief Main constructor. */
Attention(AttentionType i_type,int (* i_handler)(Attention *),pdbg_target * i_target,Config * i_config)8 Attention::Attention(AttentionType i_type, int (*i_handler)(Attention*),
9                      pdbg_target* i_target, Config* i_config) :
10     iv_type(i_type), iv_handler(i_handler), iv_target(i_target),
11     iv_config(i_config)
12 
13 {}
14 
15 /** @brief Get attention priority */
getPriority() const16 int Attention::getPriority() const
17 {
18     return iv_type;
19 }
20 
21 /* @brief Get config object */
getConfig() const22 Config* Attention::getConfig() const
23 {
24     return iv_config;
25 }
26 
27 /* @brief Call attention handler function */
handle()28 int Attention::handle()
29 {
30     return iv_handler(this);
31 }
32 
33 /* @brief Get attention handler target */
getTarget() const34 pdbg_target* Attention::getTarget() const
35 {
36     return iv_target;
37 }
38 
39 /** @brief less than operator, for heap creation */
operator <(const Attention & right) const40 bool Attention::operator<(const Attention& right) const
41 {
42     return (getPriority() < right.getPriority());
43 }
44 
45 } // namespace attn
46