16#ifndef SIMICS_SYSTEMC_AWARENESS_EXPORT_SPY_FACTORY_H
17#define SIMICS_SYSTEMC_AWARENESS_EXPORT_SPY_FACTORY_H
23#include <sysc/intc/communication/sc_export_spy.h>
33template <
typename IF,
typename HANDLER>
36 typedef typename std::vector<HANDLER *>::iterator handler_iterator;
37 typedef typename std::map<IF*, intc::sc_export_spy<IF> *>::iterator
40 ExportSpyFactory(
const ExportSpyFactory &f) {}
41 ExportSpyFactory &operator = (
const ExportSpyFactory &f) {}
42 virtual ~ExportSpyFactory() {
43 for (handler_iterator i = handlers_.begin(); i != handlers_.end(); ++i)
45 for (spy_iterator i = spies_.begin(); i != spies_.end(); ++i)
48 virtual void applyOn(sc_core::sc_object *sc_object) {
49 if (sc_core::sc_export<IF> *if_
50 =
dynamic_cast<sc_core::sc_export<IF> *
>(sc_object)) {
51 intc::sc_export_spy<IF> *spy =
new intc::sc_export_spy<IF>(if_);
52 HANDLER *handler =
new HANDLER(spy);
53 handlers_.push_back(handler);
54 spy->set_spy_interface(handler);
55 spies_[spy->get_interface()] = spy;
58 virtual void done() {}
59 std::map<IF*, intc::sc_export_spy<IF> *> *get_spies() {
64 std::vector<HANDLER *> handlers_;
65 std::map<IF*, intc::sc_export_spy<IF> *> spies_;
Definition: traverser_interface.h:26
Definition: pci_bus_interface.h:24