SystemC Library API Reference Manual
Reference documentation for the Simics SystemC Library.
 
Loading...
Searching...
No Matches
tool_connection_interface.h
Go to the documentation of this file.
1// -*- mode: C++; c-file-style: "virtutech-c++" -*-
2
3/*
4 © 2017 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_INSTRUMENTATION_TOOL_CONNECTION_INTERFACE_H
17#define SIMICS_SYSTEMC_INSTRUMENTATION_TOOL_CONNECTION_INTERFACE_H
18
19#include <simics/device-api.h>
20
21#include <string>
22#include <vector>
23
24namespace simics {
25namespace systemc {
26namespace instrumentation {
27
30 public:
32 virtual void set_functions(std::vector<std::string> *functions) = 0;
33 virtual const std::vector<std::string> &functions() const = 0;
34 virtual bool enabled() const = 0;
35 virtual void set_tool(ConfObjectRef tool) = 0;
36 virtual ConfObjectRef tool() const = 0;
37 virtual void set_controller(ConfObjectRef controller) = 0;
38 virtual ConfObjectRef controller() const = 0;
39 template<class TInterface>
40 TInterface *get_interface() {
41 // Check if ToolConnection implemented the interface
42 if (!tool())
43 return dynamic_cast<TInterface *>(this);
44
45 simics::ConfObject *obj = static_cast<simics::ConfObject *>(
46 SIM_object_data(tool()));
47 return dynamic_cast<TInterface *>(obj);
48 }
49};
50
51} // namespace instrumentation
52} // namespace systemc
53} // namespace simics
54
55#endif
Definition: tool_connection_interface.h:29
virtual void set_functions(std::vector< std::string > *functions)=0
TInterface * get_interface()
Definition: tool_connection_interface.h:40
virtual void set_controller(ConfObjectRef controller)=0
virtual ~ToolConnectionInterface()
Definition: tool_connection_interface.h:31
virtual const std::vector< std::string > & functions() const =0
Definition: pci_bus_interface.h:24