SystemC Library API Reference Manual
Reference documentation for the Simics SystemC Library.
 
Loading...
Searching...
No Matches
multi_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_MULTI_TRAVERSER_H
15#define SIMICS_SYSTEMC_MULTI_TRAVERSER_H
16
17#include <simics/base/types.h>
18#include <systemc>
19
21
22#include <vector>
23
24namespace simics {
25namespace systemc {
26
28class MultiTraverser : public Traverser {
29 public:
30 template<class T>
31 T *add(T *traverser) {
32 traversers_.push_back(traverser);
33 return traverser;
34 }
35 void applyOn(sc_core::sc_object *obj) override {
36 for (auto *traverser : traversers_)
37 traverser->applyOn(obj);
38 }
39 void done() override {
40 for (auto *traverser : traversers_)
41 traverser->done();
42 }
43 protected:
44 std::vector<TraverserInterface *> traversers_;
45};
46
47} // namespace systemc
48} // namespace simics
49
50#endif
Definition: multi_traverser.h:28
T * add(T *traverser)
Definition: multi_traverser.h:31
void done() override
Definition: multi_traverser.h:39
std::vector< TraverserInterface * > traversers_
Definition: multi_traverser.h:44
void applyOn(sc_core::sc_object *obj) override
Definition: multi_traverser.h:35
Definition: traverser.h:25
Definition: adapter.h:79