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// -*- 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_TRAVERSER_H
17#define SIMICS_SYSTEMC_TRAVERSER_H
18
20
21#include <vector>
22
23namespace simics {
24namespace systemc {
25
28 public:
29 void traverseAll() {
30 const std::vector<sc_core::sc_object*> &v
31 = sc_core::sc_get_top_level_objects();
32 for (std::vector<sc_core::sc_object*>::const_iterator i = v.begin();
33 i != v.end(); ++i) {
34 traverseTree(*i);
35 }
36 done();
37 }
38 void traverseTree(sc_core::sc_object *obj) {
39 applyOn(obj);
40 const std::vector<sc_core::sc_object*> &v = obj->get_child_objects();
41 for (std::vector<sc_core::sc_object*>::const_iterator i = v.begin();
42 i != v.end(); ++i) {
43 traverseTree(*i);
44 }
45 }
46};
47
48} // namespace systemc
49} // namespace simics
50
51#endif
Definition: traverser_interface.h:26
virtual void applyOn(sc_core::sc_object *obj)=0
Definition: traverser.h:27
void traverseTree(sc_core::sc_object *obj)
Definition: traverser.h:38
void traverseAll()
Definition: traverser.h:29
Definition: pci_bus_interface.h:24