SystemC Library API Reference Manual
Reference documentation for the Simics SystemC Library.
 
Loading...
Searching...
No Matches
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_TRAVERSER_H
15#define SIMICS_SYSTEMC_TRAVERSER_H
16
18
19#include <vector>
20
21namespace simics {
22namespace systemc {
23
26 public:
27 void traverseAll() {
28 const std::vector<sc_core::sc_object*> &v
29 = sc_core::sc_get_top_level_objects();
30 for (auto *obj : v) {
31 traverseTree(obj);
32 }
33 done();
34 }
35 void traverseTree(sc_core::sc_object *obj) {
36 applyOn(obj);
37 const std::vector<sc_core::sc_object*> &v = obj->get_child_objects();
38 for (auto *child : v) {
39 traverseTree(child);
40 }
41 }
42};
43
44} // namespace systemc
45} // namespace simics
46
47#endif
Definition: traverser_interface.h:24
virtual void applyOn(sc_core::sc_object *obj)=0
Definition: traverser.h:25
void traverseTree(sc_core::sc_object *obj)
Definition: traverser.h:35
void traverseAll()
Definition: traverser.h:27
Definition: adapter.h:79