SystemC Library API Reference Manual
Reference documentation for the Simics SystemC Library.
 
Loading...
Searching...
No Matches
extension_dispatcher.h
Go to the documentation of this file.
1// -*- mode: C++; c-file-style: "virtutech-c++" -*-
2
3/*
4 © 2015 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_IFACE_EXTENSION_DISPATCHER_H
17#define SIMICS_SYSTEMC_IFACE_EXTENSION_DISPATCHER_H
18
20
21#include <vector>
22
23namespace simics {
24namespace systemc {
25namespace iface {
26
34 public:
35 void subscribe(ReceiverInterface *receiver) {
36 receivers_.push_back(receiver);
37 }
38 bool handle(tlm::tlm_generic_payload *payload) override {
39 for (auto i : receivers_) {
40 if (i->handle(payload))
41 return true;
42 }
43 return false;
44 }
45 bool probe(tlm::tlm_generic_payload *payload) override {
46 for (auto i : receivers_) {
47 if (i->probe(payload))
48 return true;
49 }
50 return false;
51 }
53 for (auto i : receivers_)
54 delete i;
55 }
56
57 protected:
58 std::vector<ReceiverInterface *> receivers_;
59};
60
61} // namespace iface
62} // namespace systemc
63} // namespace simics
64
65#endif
Utility class that can unmarshal a Simics interface embedded as an Extension in the tlm::tlm_generic_...
Definition: extension_dispatcher.h:33
bool handle(tlm::tlm_generic_payload *payload) override
Definition: extension_dispatcher.h:38
bool probe(tlm::tlm_generic_payload *payload) override
Definition: extension_dispatcher.h:45
std::vector< ReceiverInterface * > receivers_
Definition: extension_dispatcher.h:58
virtual ~ExtensionDispatcher()
Definition: extension_dispatcher.h:52
void subscribe(ReceiverInterface *receiver)
Definition: extension_dispatcher.h:35
Interface implemented by the ExtensionReceiver class, used by the ExtensionDispatcher.
Definition: receiver_interface.h:29
Definition: pci_bus_interface.h:24