#include <arion/common/logger.hpp>
#include <cstdint>
#include <memory>
#include <string>
Go to the source code of this file.
|
| using | arion_type::InitFn = std::function< void()> |
| | Function type used for initializing a kernel type.
|
| |
◆ ARION_REGISTER_KERNEL_TYPE
| #define ARION_REGISTER_KERNEL_TYPE |
( |
|
VAR, |
|
|
|
TYPE, |
|
|
|
PRIORITY |
|
) |
| |
Value: static_assert(std::is_same_v<decltype(VAR), std::shared_ptr<TYPE>>, \
"ARION_REGISTER_KERNEL_TYPE expects shared_ptr<TYPE>"); \
static struct KernelTypeRegistrar_##VAR \
{ \
KernelTypeRegistrar_##VAR() \
{ \
KernelTypeRegistry::instance().register_type(PRIORITY, [] { VAR = std::make_shared<TYPE>(); }); \
} \
} KernelTypeRegistrarInstance_##VAR;
Macro to automatically register a shared pointer to a KernelType derived class. This ensures that type objects are correctly instantiated in the required order via the KernelTypeRegistry.
- Parameters
-
| VAR | The std::shared_ptr<TYPE> variable to initialize. |
| TYPE | The concrete class of the kernel type. |
| PRIORITY | The initialization priority (lower numbers initialize first). |
◆ COMMON_TYPE_PRIORITY
| #define COMMON_TYPE_PRIORITY 0 |
◆ OS_BASE_TYPE_PRIORITY
| #define OS_BASE_TYPE_PRIORITY 1 |
◆ OS_STRUCT_FACTORY_PRIORITY
| #define OS_STRUCT_FACTORY_PRIORITY 2 |
◆ OS_STRUCT_TYPE_PRIORITY
| #define OS_STRUCT_TYPE_PRIORITY 3 |
◆ OS_VARIABLE_STRUCT_TYPE_PRIORITY
| #define OS_VARIABLE_STRUCT_TYPE_PRIORITY 4 |