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 virtual std::string name(sc_core::sc_object *object) const {
35 sc_core::sc_event *event = get_event(object);
36 if (!event)
37 return InstanceAttributes::name(object);
38
39 return event->name();
40 }
41 virtual std::string basename(sc_core::sc_object *object) const {
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 virtual bool canManufacture(sc_core::sc_object *object) const {
61 return std::string("ScEventObject") == object->kind();
62 }
64 sc_core::sc_object *object) const {
65 return &instance_attributes_;
66 }
67 void registerInterfaces(sc_core::sc_object *object,
68 conf_class_t *cls) const {
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
virtual std::string basename(sc_core::sc_object *object) const
Definition: proxy_factory_event.h:41
virtual std::string name(sc_core::sc_object *object) const
Definition: proxy_factory_event.h:34
Definition: instance_attributes_interface.h:26
Definition: instance_attributes.h:27
virtual std::string basename(sc_core::sc_object *object) const
Definition: instance_attributes.h:32
virtual std::string name(sc_core::sc_object *object) const
Definition: instance_attributes.h:29
Definition: proxy_event.h:32
Definition: proxy_factory_event.h:58
virtual bool canManufacture(sc_core::sc_object *object) const
Definition: proxy_factory_event.h:60
void registerInterfaces(sc_core::sc_object *object, conf_class_t *cls) const
Definition: proxy_factory_event.h:67
virtual const InstanceAttributesInterface * instanceAttributes(sc_core::sc_object *object) const
Definition: proxy_factory_event.h:63
Definition: proxy_factory.h:44
virtual void registerInterfaces(sc_core::sc_object *object, conf_class_t *cls) const
Definition: proxy_factory.h:117
void registerInterface(conf_class_t *cls) const
Definition: proxy_factory.h:179
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: pci_bus_interface.h:24