C++ Device API Reference Manual
Reference documentation for the Simics C++ Device API.
 
Loading...
Searching...
No Matches
I_pattern_rule.h
Go to the documentation of this file.
1/*
2 © 2023 Intel Corporation
3
4 This software and the related documents are Intel copyrighted materials, and
5 your use of them is governed by the express license under which they were
6 provided to you ("License"). Unless the License provides otherwise, you may
7 not use, modify, copy, publish, distribute, disclose or transmit this software
8 or the related documents without Intel's prior written permission.
9
10 This software and the related documents are provided as is, with no express or
11 implied warranties, other than those that are expressly stated in the License.
12*/
13
14// -*- C++ -*-
15
16#ifndef CPP_API_EXTENSIONS_SRC_SME_PATTERN_RULES_I_PATTERN_RULE_H
17#define CPP_API_EXTENSIONS_SRC_SME_PATTERN_RULES_I_PATTERN_RULE_H
18
19#include <cstdint>
20#include <functional>
22
23namespace sme
24{
25class pattern_rule_container;
26
32{
33protected:
38 std::function<void()> m_lambda;
39
45
46public:
51
56 virtual ~I_pattern_rule() {;}
57
64 virtual void process_rule( std::uint64_t _old_value, std::uint64_t & _new_value) = 0;
65
71 void action( std::function<void()> _action) { m_lambda = _action; }
72
79
85 _always_inline bool is_bound() { return( m_lambda != nullptr); }
86
88};
89
90}
91
92#endif /* I_PATTERN_RULE_H */
#define _always_inline
Definition: _inline.h:30
Interface and base class for all notification rule types.
Definition: I_pattern_rule.h:32
bool m_is_active
stores is active
Definition: I_pattern_rule.h:44
_always_inline bool is_active()
reports if rule is active for processing.
Definition: I_pattern_rule.h:78
virtual void process_rule(std::uint64_t _old_value, std::uint64_t &_new_value)=0
process rule evaluation between old and new values.
I_pattern_rule()
Interface parent constructor for a new i pattern rule object.
Definition: I_pattern_rule.h:50
std::function< void()> m_lambda
placeholder for lambda
Definition: I_pattern_rule.h:38
void action(std::function< void()> _action)
Binds a void(void) lambda as the callback action to this rule.
Definition: I_pattern_rule.h:71
virtual ~I_pattern_rule()
Destroy the i pattern rule object.
Definition: I_pattern_rule.h:56
_always_inline bool is_bound()
has the lambda callback been bound.
Definition: I_pattern_rule.h:85
tracks all rules of a single type for a particular target.
Definition: pattern_rule_container.h:38
Definition: expression_vector.h:25