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/*
2 © 2017 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_INSTRUMENTATION_TOOL_CONNECTION_INTERFACE_H
15#define SIMICS_SYSTEMC_INSTRUMENTATION_TOOL_CONNECTION_INTERFACE_H
16
17#include <simics/cc-api.h>
18
19#include <string>
20#include <vector>
21
22namespace simics {
23namespace systemc {
24namespace instrumentation {
25
28 public:
30 virtual void set_functions(std::vector<std::string> *functions) = 0;
31 virtual const std::vector<std::string> &functions() const = 0;
32 virtual bool enabled() const = 0;
33 virtual void set_tool(ConfObjectRef tool) = 0;
34 virtual ConfObjectRef tool() const = 0;
35 virtual void set_controller(ConfObjectRef controller) = 0;
36 virtual ConfObjectRef controller() const = 0;
37 template<class TInterface>
38 TInterface *get_interface() {
39 // Check if ToolConnection implemented the interface
40 if (!tool())
41 return dynamic_cast<TInterface *>(this);
42
43 simics::ConfObject *obj = simics::from_obj<simics::ConfObject>(
44 tool());
45 return dynamic_cast<TInterface *>(obj);
46 }
47};
48
49} // namespace instrumentation
50} // namespace systemc
51} // namespace simics
52
53#endif
Definition: tool_connection_interface.h:27
virtual void set_functions(std::vector< std::string > *functions)=0
TInterface * get_interface()
Definition: tool_connection_interface.h:38
virtual void set_controller(ConfObjectRef controller)=0
virtual ~ToolConnectionInterface()
Definition: tool_connection_interface.h:29
virtual const std::vector< std::string > & functions() const =0
Definition: adapter.h:79