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/*
2 © 2020 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_AWARENESS_TLM_MULTI_HANDLER_REGISTRY_H
15#define SIMICS_SYSTEMC_AWARENESS_TLM_MULTI_HANDLER_REGISTRY_H
16
18
19#include <systemc>
20
21#include <set>
22#include <map>
23
24namespace simics {
25namespace systemc {
26namespace awareness {
27
29 public:
30 TlmMultiHandlerRegistry() : binder_(NULL) {}
31 TlmMultiHandlerRegistry(sc_core::sc_interface *binder,
33 : binder_(binder) {
34 handler_by_binder_[binder] = handler;
35 }
37 handler_by_binder_.erase(binder_);
38 }
39 static TlmMultiHandlerInterface *getHandler(sc_core::sc_interface *binder) {
40 std::map<sc_core::sc_interface *,
41 TlmMultiHandlerInterface *>::iterator i;
42 i = handler_by_binder_.find(binder);
43 if (i != handler_by_binder_.end())
44 return i->second;
45
46 return NULL;
47 }
48
49 private:
50 static std::map<sc_core::sc_interface *,
51 TlmMultiHandlerInterface *> handler_by_binder_;
52
53 sc_core::sc_interface *binder_;
54};
55
56
57} // namespace awareness
58} // namespace systemc
59} // namespace simics
60
61#endif
Definition: tlm_multi_handler_interface.h:23
Definition: tlm_multi_handler_registry.h:28
TlmMultiHandlerRegistry()
Definition: tlm_multi_handler_registry.h:30
static TlmMultiHandlerInterface * getHandler(sc_core::sc_interface *binder)
Definition: tlm_multi_handler_registry.h:39
virtual ~TlmMultiHandlerRegistry()
Definition: tlm_multi_handler_registry.h:36
TlmMultiHandlerRegistry(sc_core::sc_interface *binder, TlmMultiHandlerInterface *handler)
Definition: tlm_multi_handler_registry.h:31
Definition: adapter.h:79