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/*
2 © 2014 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#ifndef SIMICS_SYSTEMC_AWARENESS_PROXY_BLOCKLIST_TRAVERSER_H
15#define SIMICS_SYSTEMC_AWARENESS_PROXY_BLOCKLIST_TRAVERSER_H
16
19
20#include <set>
21
22namespace simics {
23namespace systemc {
24namespace awareness {
25
27 public:
29 : factory_(factory), traverser_(NULL) {
30 }
32 traverser_ = traverser;
33 }
34 void applyOn(sc_core::sc_object *obj) override {
35 if (passlist_.find(obj) != passlist_.end()) {
36 traverser_->applyOn(obj);
37 return;
38 }
39 if (blocklist_.find(obj) != blocklist_.end()) {
40 return;
41 }
42 // Object encountered for the first time. Iterate over all registered
43 // factories and see if there is one that does not want a proxy instance
44 // created for this object.
45 if (factory_->mapToProxy(obj)) {
46 passlist_.insert(obj);
47 traverser_->applyOn(obj);
48 } else {
49 blocklist_.insert(obj);
50 }
51 }
52 void done() override {
53 traverser_->done();
54 }
55
56 private:
57 ProxyFactoryInterface *factory_;
58 TraverserInterface *traverser_;
59 std::set<sc_core::sc_object *> blocklist_;
60 std::set<sc_core::sc_object *> passlist_;
61};
62
63// Define a deprecated alias for the old class name
65[[deprecated("Use ProxyBlocklistTraverser instead")]] = ProxyBlocklistTraverser;
66
67} // namespace awareness
68} // namespace systemc
69} // namespace simics
70
71#endif
Definition: traverser_interface.h:24
virtual void applyOn(sc_core::sc_object *obj)=0
Definition: traverser.h:25
Definition: proxy_blocklist_traverser.h:26
void done() override
Definition: proxy_blocklist_traverser.h:52
void applyOn(sc_core::sc_object *obj) override
Definition: proxy_blocklist_traverser.h:34
void setTraverser(TraverserInterface *traverser)
Definition: proxy_blocklist_traverser.h:31
ProxyBlocklistTraverser(ProxyFactoryInterface *factory)
Definition: proxy_blocklist_traverser.h:28
Definition: proxy_factory_interface.h:29
virtual bool mapToProxy(sc_core::sc_object *object) const =0
Definition: adapter.h:79