SystemC Library API Reference Manual
Reference documentation for the Simics SystemC Library.
 
Loading...
Searching...
No Matches
tool_controller.h File Reference
#include <simics/cc-api.h>
#include <simics/systemc/iface/instrumentation/provider_controller_interface.h>
#include <simics/systemc/instrumentation/tool_connection_interface.h>
#include <simics/simulator-iface/instrumentation-tool.h>
#include <functional>
#include <utility>
#include <vector>

Go to the source code of this file.

Classes

class  simics::systemc::instrumentation::ToolController
 
class  simics::systemc::instrumentation::ToolController::CallbackInterface
 

Namespaces

namespace  simics
 
namespace  simics::systemc
 
namespace  simics::systemc::instrumentation
 

Macros

#define internal_DISPATCH_TOOL_CHAIN_NONNULL(controller, iface_type, func, ...)
 
#define DISPATCH_TOOL_CHAIN(controller, iface_type, func, ...)
 
#define DISPATCH_TOOL_CHAIN_THIS(iface_type, func, ...)
 

Macro Definition Documentation

◆ DISPATCH_TOOL_CHAIN

#define DISPATCH_TOOL_CHAIN (   controller,
  iface_type,
  func,
  ... 
)
Value:
do { \
using state_t = ssi::ToolController::ConnectionListState; \
if (controller \
&& controller->get_connections_state() != state_t::EMPTY) \
internal_DISPATCH_TOOL_CHAIN_NONNULL(controller, iface_type, \
func, ##__VA_ARGS__); \
} while (0)
Definition: tool_connection.h:30

◆ DISPATCH_TOOL_CHAIN_THIS

#define DISPATCH_TOOL_CHAIN_THIS (   iface_type,
  func,
  ... 
)
Value:
internal_DISPATCH_TOOL_CHAIN_NONNULL(this, iface_type, func, \
##__VA_ARGS__);
#define internal_DISPATCH_TOOL_CHAIN_NONNULL(controller, iface_type, func,...)
Definition: tool_controller.h:36

◆ internal_DISPATCH_TOOL_CHAIN_NONNULL

#define internal_DISPATCH_TOOL_CHAIN_NONNULL (   controller,
  iface_type,
  func,
  ... 
)
Value:
do { \
for (auto c : controller->get_connections()) { \
if (!c->enabled()) \
continue; \
auto iface = c->template get_interface<iface_type>(); \
if (!iface) \
continue; \
auto functions = c->functions(); \
if (!functions.empty()) { \
auto f = std::find(functions.begin(), functions.end(), #func); \
if (f == functions.end()) \
continue; \
} \
iface->func(__VA_ARGS__); \
} \
} while (0)