SystemC Library API Reference Manual
Reference documentation for the Simics SystemC Library.
 
Loading...
Searching...
No Matches
proxy_blocklist_traverser.h
Go to the documentation of this file.
1// -*- mode: C++; c-file-style: "virtutech-c++" -*-
2
3/*
4 © 2014 Intel Corporation
5
6 This software and the related documents are Intel copyrighted materials, and
7 your use of them is governed by the express license under which they were
8 provided to you ("License"). Unless the License provides otherwise, you may
9 not use, modify, copy, publish, distribute, disclose or transmit this software
10 or the related documents without Intel's prior written permission.
11
12 This software and the related documents are provided as is, with no express or
13 implied warranties, other than those that are expressly stated in the License.
14*/
15
16#ifndef SIMICS_SYSTEMC_AWARENESS_PROXY_BLOCKLIST_TRAVERSER_H
17#define SIMICS_SYSTEMC_AWARENESS_PROXY_BLOCKLIST_TRAVERSER_H
18
21
22#include <set>
23
24namespace simics {
25namespace systemc {
26namespace awareness {
27
29 public:
31 : factory_(factory), traverser_(NULL) {
32 }
34 traverser_ = traverser;
35 }
36 virtual void applyOn(sc_core::sc_object *obj) {
37 if (passlist_.find(obj) != passlist_.end()) {
38 traverser_->applyOn(obj);
39 return;
40 }
41 if (blocklist_.find(obj) != blocklist_.end()) {
42 return;
43 }
44 // Object encountered for the first time. Iterate over all registered
45 // factories and see if there is one that does not want a proxy instance
46 // created for this object.
47 if (factory_->mapToProxy(obj)) {
48 passlist_.insert(obj);
49 traverser_->applyOn(obj);
50 } else {
51 blocklist_.insert(obj);
52 }
53 }
54 virtual void done() {
55 traverser_->done();
56 }
57
58 private:
59 ProxyFactoryInterface *factory_;
60 TraverserInterface *traverser_;
61 std::set<sc_core::sc_object *> blocklist_;
62 std::set<sc_core::sc_object *> passlist_;
63};
64
65// Define a deprecated alias for the old class name
66#if __cplusplus >= 201402L || _MSVC_LANG >= 201402L
68[[deprecated("Use ProxyBlocklistTraverser instead")]] = ProxyBlocklistTraverser;
69#else
70// C++11 or earlier
71using ProxyBlacklistTraverser = ProxyDenylistTraverser;
72#endif
73
74} // namespace awareness
75} // namespace systemc
76} // namespace simics
77
78#endif
Definition: traverser_interface.h:26
virtual void applyOn(sc_core::sc_object *obj)=0
Definition: traverser.h:27
Definition: proxy_blocklist_traverser.h:28
virtual void applyOn(sc_core::sc_object *obj)
Definition: proxy_blocklist_traverser.h:36
void setTraverser(TraverserInterface *traverser)
Definition: proxy_blocklist_traverser.h:33
virtual void done()
Definition: proxy_blocklist_traverser.h:54
ProxyBlocklistTraverser(ProxyFactoryInterface *factory)
Definition: proxy_blocklist_traverser.h:30
Definition: proxy_factory_interface.h:31
virtual bool mapToProxy(sc_core::sc_object *object) const =0
ProxyDenylistTraverser ProxyBlacklistTraverser
Definition: proxy_blocklist_traverser.h:71
Definition: adapter.h:80