14#ifndef SIMICS_SYSTEMC_INSTRUMENTATION_TOOL_CONTROLLER_H
15#define SIMICS_SYSTEMC_INSTRUMENTATION_TOOL_CONTROLLER_H
20#pragma warning(disable:4503)
23#include <simics/cc-api.h>
26#include <simics/simulator-iface/instrumentation-tool.h>
34#define internal_DISPATCH_TOOL_CHAIN_NONNULL(controller, iface_type, func, ...)\
36 for (auto c : controller->get_connections()) { \
39 auto iface = c->template get_interface<iface_type>(); \
42 auto functions = c->functions(); \
43 if (!functions.empty()) { \
44 auto f = std::find(functions.begin(), functions.end(), #func); \
45 if (f == functions.end()) \
48 iface->func(__VA_ARGS__); \
52#define DISPATCH_TOOL_CHAIN(controller, iface_type, func, ...) \
54 namespace ssi = simics::systemc::instrumentation; \
55 using state_t = ssi::ToolController::ConnectionListState; \
57 && controller->get_connections_state() != state_t::EMPTY) \
58 internal_DISPATCH_TOOL_CHAIN_NONNULL(controller, iface_type, \
59 func, ##__VA_ARGS__); \
62#define DISPATCH_TOOL_CHAIN_THIS(iface_type, func, ...) \
63 internal_DISPATCH_TOOL_CHAIN_NONNULL(this, iface_type, func, \
68namespace instrumentation {
99 std::vector<ToolConnectionInterface *> connections_;
101 CallbackInterface *callback_;
Definition: provider_controller_interface.h:30