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/*
2 © 2015 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_IFACE_EXTENSION_DISPATCHER_H
15#define SIMICS_SYSTEMC_IFACE_EXTENSION_DISPATCHER_H
16
18
19#include <vector>
20
21namespace simics {
22namespace systemc {
23namespace iface {
24
32 public:
33 void subscribe(ReceiverInterface *receiver) {
34 receivers_.push_back(receiver);
35 }
36 bool handle(tlm::tlm_generic_payload *payload) override {
37 for (auto i : receivers_) {
38 if (i->handle(payload))
39 return true;
40 }
41 return false;
42 }
43 bool probe(tlm::tlm_generic_payload *payload) override {
44 for (auto i : receivers_) {
45 if (i->probe(payload))
46 return true;
47 }
48 return false;
49 }
51 for (auto i : receivers_)
52 delete i;
53 }
54
55 protected:
56 std::vector<ReceiverInterface *> receivers_;
57};
58
59} // namespace iface
60} // namespace systemc
61} // namespace simics
62
63#endif
Utility class that can unmarshal a Simics interface embedded as an Extension in the tlm::tlm_generic_...
Definition: extension_dispatcher.h:31
bool handle(tlm::tlm_generic_payload *payload) override
Definition: extension_dispatcher.h:36
bool probe(tlm::tlm_generic_payload *payload) override
Definition: extension_dispatcher.h:43
std::vector< ReceiverInterface * > receivers_
Definition: extension_dispatcher.h:56
virtual ~ExtensionDispatcher()
Definition: extension_dispatcher.h:50
void subscribe(ReceiverInterface *receiver)
Definition: extension_dispatcher.h:33
Interface implemented by the ExtensionReceiver class, used by the ExtensionDispatcher.
Definition: receiver_interface.h:27
Definition: adapter.h:79