Arion 1.0.2-alpha
A high-performance C++ framework for emulating executable binaries.
 
Loading...
Searching...
No Matches
type_utils.hpp File Reference
#include <arion/common/logger.hpp>
#include <cstdint>
#include <memory>
#include <string>

Go to the source code of this file.

Classes

class  arion_type::KernelType
 Abstract base class for all kernel-related data types used for visualization/logging. More...
 
class  arion_type::KernelTypeRegistry
 Singleton class responsible for managing the initialization order of all kernel type objects. More...
 
class  arion_type::FlagType
 Class for data types represented as a set of bit flags or discrete symbolic constants. More...
 
class  arion_type::IntType
 Concrete type representing a generic integer value. More...
 
class  arion_type::RawStringType
 Concrete type representing a memory address pointing to a null-terminated string. More...
 

Namespaces

namespace  arion
 
namespace  arion_type
 

Macros

#define COMMON_TYPE_PRIORITY   0
 
#define OS_BASE_TYPE_PRIORITY   1
 
#define OS_STRUCT_FACTORY_PRIORITY   2
 
#define OS_STRUCT_TYPE_PRIORITY   3
 
#define OS_VARIABLE_STRUCT_TYPE_PRIORITY   4
 
#define ARION_REGISTER_KERNEL_TYPE(VAR, TYPE, PRIORITY)
 

Typedefs

using arion_type::InitFn = std::function< void()>
 Function type used for initializing a kernel type.
 

Variables

std::shared_ptr< IntTypearion_type::INT_TYPE
 Shared pointer to the singleton instance of IntType.
 
std::shared_ptr< RawStringTypearion_type::RAW_STRING_TYPE
 Shared pointer to the singleton instance of RawStringType.
 

Macro Definition Documentation

◆ 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
VARThe std::shared_ptr<TYPE> variable to initialize.
TYPEThe concrete class of the kernel type.
PRIORITYThe 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