C++ Device API Reference Manual
Reference documentation for the Simics C++ Device API.
 
Loading...
Searching...
No Matches
masked.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_MASKED_H
17#define CPP_API_EXTENSIONS_SRC_SME_PATTERN_RULES_MASKED_H
18
20
21namespace sme {
22
23 namespace rules {
24
29 class masked : public I_pattern_rule
30 {
31 public:
36 uint64_t m_mask;
37
43 masked( uint64_t _mask)
45 , m_mask( _mask)
46 {;}
47
52 virtual ~masked() {;}
53
60 virtual void process_rule( uint64_t _old_value, uint64_t & _new_value) {
61 if( is_active() && is_bound() && (_old_value & m_mask) != (_new_value & m_mask)) {
62 m_lambda();
63 }
64 }
65 };
66
67 }
68
69}
70
71#endif /*NOTIFICATION_RULE_MASKED_H_*/
Interface and base class for all notification rule types.
Definition: I_pattern_rule.h:32
_always_inline bool is_active()
reports if rule is active for processing.
Definition: I_pattern_rule.h:78
std::function< void()> m_lambda
placeholder for lambda
Definition: I_pattern_rule.h:38
_always_inline bool is_bound()
has the lambda callback been bound.
Definition: I_pattern_rule.h:85
rule executes if anything "masked" changes between the old and new value.
Definition: masked.h:30
virtual ~masked()
Destroy the masked object.
Definition: masked.h:52
uint64_t m_mask
mask to apply for rule evaluation.
Definition: masked.h:36
virtual void process_rule(uint64_t _old_value, uint64_t &_new_value)
process rule evaluation between old and new values.
Definition: masked.h:60
masked(uint64_t _mask)
Construct a new masked object.
Definition: masked.h:43
Definition: expression_vector.h:25