C++ Device API Reference Manual
Reference documentation for the Simics C++ Device API.
 
Loading...
Searching...
No Matches
after.h File Reference
#include <iostream>
#include <string>
#include <tuple>
#include <typeinfo>
#include <unordered_set>
#include <utility>
#include "simics/after-interface.h"
#include "simics/attr-value.h"
#include "simics/attribute-traits.h"
#include "simics/event.h"

Go to the source code of this file.

Classes

class  simics::AfterCall
 
class  simics::FunctionCall< Args >
 
class  simics::MemberFunctionCall< Class, Args >
 
class  simics::AfterEvent
 
class  simics::EnableAfterCall< T >
 

Namespaces

namespace  simics
 

Macros

#define FUNC_AND_NAME(f)   f, #f
 
#define REGISTER_AFTER_CALL(f)    simics::AfterCall::addIface(simics::make_function_call(FUNC_AND_NAME(f)));
 
#define AFTER_CALL(dev, t, f, ...)
 

Functions

template<typename... Args>
constexpr void simics::check_function_call (void(*func)(Args...))
 
template<typename Class , typename... Args>
constexpr void simics::check_function_call (void(Class::*func)(Args...))
 
template<typename... Args>
constexpr auto simics::make_function_call (void(*func)(Args...), const std::string &name)
 
template<typename Class , typename... Args>
constexpr auto simics::make_function_call (void(Class::*func)(Args...), const std::string &name)
 

Macro Definition Documentation

◆ AFTER_CALL

#define AFTER_CALL (   dev,
  t,
  f,
  ... 
)
Value:
{ \
simics::check_function_call(f); \
auto *iface = dynamic_cast<simics::AfterInterface *>(dev); \
if (iface == nullptr) { \
std::cerr << "The first argument to the AFTER_CALL does " \
<< "not implement AfterInterface*" \
<< std::endl; \
} else { \
iface->schedule(t, std::string(#f) + typeid(f).name(), \
std::forward_as_tuple(__VA_ARGS__)))); \
} \
}
Definition: after-interface.h:44
virtual void schedule(double seconds, const std::string &name, const attr_value_t &args)=0
Definition: attr-value.h:33
std::enable_if< std::is_enum< T >::value, attr_value_t >::type std_to_attr(const T &src)
Function transforms C++ enum type T to Simics attr_value_t.
Definition: attribute-traits.h:163

◆ FUNC_AND_NAME

#define FUNC_AND_NAME (   f)    f, #f

◆ REGISTER_AFTER_CALL

#define REGISTER_AFTER_CALL (   f)     simics::AfterCall::addIface(simics::make_function_call(FUNC_AND_NAME(f)));