C++ Device API Reference Manual
Reference documentation for the Simics C++ Device API.
 
Loading...
Searching...
No Matches
user_defined.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_USER_DEFINED_H
17#define CPP_API_EXTENSIONS_SRC_SME_PATTERN_RULES_USER_DEFINED_H
18
20#include "sme/aqpp/print/sme_print.hpp"
21
22namespace sme {
23
24 namespace rules {
25
31 {
32 public:
38
43 virtual ~user_defined() {;}
44
51 virtual void process_rule( uint64_t _old_value, uint64_t & _new_value) {
52 if( is_active() && is_bound()) {
53 SIM_DEBUG_END( "true");
54 m_lambda( _old_value, _new_value);
55 } else {
56 SIM_DEBUG_END( "false");
57 }
58 }
59 };
60
61 }
62
63}
64
65#endif /*NOTIFICATION_RULE_NOTIFY_H_*/
Definition: I_pattern_rule.h:103
virtual _always_inline bool is_bound()
has the lambda callback been bound.
Definition: I_pattern_rule.h:116
std::function< void(uint64_t _old, uint64_t _new)> m_lambda
Definition: I_pattern_rule.h:105
_always_inline bool is_active()
reports if rule is active for processing.
Definition: I_pattern_rule.h:73
Basic rule executes with access (no change required).
Definition: user_defined.h:31
virtual void process_rule(uint64_t _old_value, uint64_t &_new_value)
process rule evaluation between old and new values.
Definition: user_defined.h:51
user_defined()
Construct a new notify object.
Definition: user_defined.h:37
virtual ~user_defined()
Destroy the notify object.
Definition: user_defined.h:43
Definition: expression_vector.h:25