SystemC Library API Reference Manual
Reference documentation for the Simics SystemC Library.
 
Loading...
Searching...
No Matches
proxy_factory_event.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_AWARENESS_PROXY_FACTORY_EVENT_H
17#define SIMICS_SYSTEMC_AWARENESS_PROXY_FACTORY_EVENT_H
18
19
25
26#include <string>
27
28namespace simics {
29namespace systemc {
30namespace awareness {
31
33 public:
34 std::string name(sc_core::sc_object *object) const override {
35 sc_core::sc_event *event = get_event(object);
36 if (!event)
37 return InstanceAttributes::name(object);
38
39 return event->name();
40 }
41 std::string basename(sc_core::sc_object *object) const override {
42 sc_core::sc_event *event = get_event(object);
43 if (!event)
44 return InstanceAttributes::basename(object);
45
46 return event->basename();
47 }
48 protected:
49 sc_core::sc_event *get_event(sc_core::sc_object *object) const {
50 ScEventObject *eventProxy = dynamic_cast<ScEventObject *> (object);
51 if (!eventProxy)
52 return NULL;
53
54 return eventProxy->get_event();
55 }
56};
57
58class ProxyFactoryEvent : public ProxyFactory<ProxyEvent> {
59 public:
60 bool canManufacture(sc_core::sc_object *object) const override {
61 return std::string("ScEventObject") == object->kind();
62 }
64 sc_core::sc_object *object) const override {
65 return &instance_attributes_;
66 }
67 void registerInterfaces(sc_core::sc_object *object,
68 conf_class_t *cls) const override {
70 registerInterface<iface::ScEventSimicsAdapter<ProxyEvent> >(cls);
73 ProxyEvent> >(cls);
74 }
75
76 private:
77 EventInstanceAttributes instance_attributes_;
78};
79
80} // namespace awareness
81} // namespace systemc
82} // namespace simics
83
84#endif
Definition: proxy_factory_event.h:32
sc_core::sc_event * get_event(sc_core::sc_object *object) const
Definition: proxy_factory_event.h:49
std::string basename(sc_core::sc_object *object) const override
Definition: proxy_factory_event.h:41
std::string name(sc_core::sc_object *object) const override
Definition: proxy_factory_event.h:34
Definition: instance_attributes_interface.h:26
Definition: instance_attributes.h:27
std::string name(sc_core::sc_object *object) const override
Definition: instance_attributes.h:29
std::string basename(sc_core::sc_object *object) const override
Definition: instance_attributes.h:32
Definition: proxy_event.h:32
Definition: proxy_factory_event.h:58
void registerInterfaces(sc_core::sc_object *object, conf_class_t *cls) const override
Definition: proxy_factory_event.h:67
bool canManufacture(sc_core::sc_object *object) const override
Definition: proxy_factory_event.h:60
const InstanceAttributesInterface * instanceAttributes(sc_core::sc_object *object) const override
Definition: proxy_factory_event.h:63
Definition: proxy_factory.h:44
void registerInterface(conf_class_t *cls) const
Definition: proxy_factory.h:179
void registerInterfaces(sc_core::sc_object *object, conf_class_t *cls) const override
Definition: proxy_factory.h:117
Definition: sc_event_object.h:27
sc_core::sc_event * get_event()
Definition: sc_event_object.h:35
Definition: provider_controller_simics_adapter.h:36
Definition: adapter.h:81