SystemC Library API Reference Manual
Reference documentation for the Simics SystemC Library.
 
Loading...
Searching...
No Matches
tlm_multi_handler_registry.h
Go to the documentation of this file.
1// -*- mode: C++; c-file-style: "virtutech-c++" -*-
2
3/*
4 © 2020 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_AWARENESS_TLM_MULTI_HANDLER_REGISTRY_H
17#define SIMICS_SYSTEMC_AWARENESS_TLM_MULTI_HANDLER_REGISTRY_H
18
20
21#include <systemc>
22
23#include <set>
24#include <map>
25
26namespace simics {
27namespace systemc {
28namespace awareness {
29
31 public:
32 TlmMultiHandlerRegistry() : binder_(NULL) {}
33 TlmMultiHandlerRegistry(sc_core::sc_interface *binder,
35 : binder_(binder) {
36 handler_by_binder_[binder] = handler;
37 }
39 handler_by_binder_.erase(binder_);
40 }
41 static TlmMultiHandlerInterface *getHandler(sc_core::sc_interface *binder) {
42 std::map<sc_core::sc_interface *,
43 TlmMultiHandlerInterface *>::iterator i;
44 i = handler_by_binder_.find(binder);
45 if (i != handler_by_binder_.end())
46 return i->second;
47
48 return NULL;
49 }
50
51 private:
52 static std::map<sc_core::sc_interface *,
53 TlmMultiHandlerInterface *> handler_by_binder_;
54
55 sc_core::sc_interface *binder_;
56};
57
58
59} // namespace awareness
60} // namespace systemc
61} // namespace simics
62
63#endif
Definition: tlm_multi_handler_interface.h:25
Definition: tlm_multi_handler_registry.h:30
TlmMultiHandlerRegistry()
Definition: tlm_multi_handler_registry.h:32
static TlmMultiHandlerInterface * getHandler(sc_core::sc_interface *binder)
Definition: tlm_multi_handler_registry.h:41
virtual ~TlmMultiHandlerRegistry()
Definition: tlm_multi_handler_registry.h:38
TlmMultiHandlerRegistry(sc_core::sc_interface *binder, TlmMultiHandlerInterface *handler)
Definition: tlm_multi_handler_registry.h:33
Definition: pci_bus_interface.h:24