C++ Device API Reference Manual
Reference documentation for the Simics C++ Device API.
 
Loading...
Searching...
No Matches
simics::RegisterClassWithSimics< T, A > Class Template Reference

Utility class for automatic registration of C++ classes with Simics. More...

#include <conf-class.h>

Public Member Functions

template<typename U = A, EnableIfNone< U > = 0>
constexpr RegisterClassWithSimics (const std::string &name, const std::string &short_desc, const std::string &description, const class_kind_t kind=Sim_Class_Kind_Vanilla)
 
template<typename U = A, EnableIfNotNone< U > = 0>
constexpr RegisterClassWithSimics (const std::string &name, const std::string &short_desc, const std::string &description, A *constructor_arg, const class_kind_t kind=Sim_Class_Kind_Vanilla)
 

Detailed Description

template<typename T, typename A = None>
class simics::RegisterClassWithSimics< T, A >

Utility class for automatic registration of C++ classes with Simics.

This class template provides a convenient way to register C++ classes with the Simics simulation framework. It automatically calls the appropriate make_class function during static initialization, ensuring that the class is properly registered when the module is loaded.

Template Parameters
TThe C++ class to be registered with Simics.
A(optional) Additional argument type for the class constructor.

Usage example:

static RegisterClassWithSimics<MyClass> register_my_class(
"my_class", "Short description", "Detailed description");
Utility class for automatic registration of C++ classes with Simics.
Definition: conf-class.h:274
Note
Using a static global instance of this class may trigger a Coverity warning such as global_init_order or ctor_dtor_global_ordering due to potential global initialization order issues. As there are no dependencies on the initialization order for registration object, you can safely suppress this warning by adding the following comment immediately before the static variable: // coverity[ctor_dtor_global_ordering]

Constructor & Destructor Documentation

◆ RegisterClassWithSimics() [1/2]

template<typename T , typename A = None>
template<typename U = A, EnableIfNone< U > = 0>
constexpr simics::RegisterClassWithSimics< T, A >::RegisterClassWithSimics ( const std::string &  name,
const std::string &  short_desc,
const std::string &  description,
const class_kind_t  kind = Sim_Class_Kind_Vanilla 
)
inlineconstexpr

◆ RegisterClassWithSimics() [2/2]

template<typename T , typename A = None>
template<typename U = A, EnableIfNotNone< U > = 0>
constexpr simics::RegisterClassWithSimics< T, A >::RegisterClassWithSimics ( const std::string &  name,
const std::string &  short_desc,
const std::string &  description,
A *  constructor_arg,
const class_kind_t  kind = Sim_Class_Kind_Vanilla 
)
inlineconstexpr

The documentation for this class was generated from the following file: