TRLC Platform Library
1.0.0
Header-only C++ library for compile-time platform detection and abstraction
|
Functions | |
static CpuArchitecture | detectCpuArchitecture () |
Detects CPU architecture using compiler predefined macros. More... | |
static int | detectPointerSize () |
Determines pointer size based on architecture. More... | |
static size_t | detectCacheLineSize () |
Determines typical cache line size for architecture. More... | |
static const char * | getArchitectureName () |
Gets human-readable architecture name. More... | |
static CppStandard | detectCppStandard () |
Detects C++ standard using __cplusplus macro. More... | |
static long | getCppVersionMacroValue () |
Gets the __cplusplus macro value. More... | |
static const char * | getCppStandardName () |
Gets human-readable standard name. More... | |
static ByteOrder | detectByteOrderCompileTime () |
Compile-time endianness detection using preprocessor macros. More... | |
ByteOrder | detectByteOrderRuntime () |
Runtime endianness detection using union method. More... | |
static uint16_t | byteSwap16Impl (uint16_t value) |
16-bit byte swap implementation More... | |
static uint32_t | byteSwap32Impl (uint32_t value) |
32-bit byte swap implementation More... | |
static uint64_t | byteSwap64Impl (uint64_t value) |
64-bit byte swap implementation More... | |
static size_t | detectPageSize () |
Detect page size (implementation detail) More... | |
template<typename Type > | |
static size_t | calculateTypePadding () |
Calculate padding for a type (implementation detail) More... | |
template<typename Type > | |
static bool | hasTypePadding () |
Check if a type has padding (implementation detail) More... | |
Variables | |
std::atomic< bool > | g_platform_initialized {false} |
Internal initialization state tracking (inline to avoid ODR violations) More... | |
std::atomic< bool > | g_initialization_in_progress {false} |
|
static |
16-bit byte swap implementation
Uses compiler intrinsics when available, falls back to manual implementation.
Definition at line 212 of file endianness.hpp.
|
static |
32-bit byte swap implementation
Definition at line 233 of file endianness.hpp.
|
static |
64-bit byte swap implementation
Definition at line 254 of file endianness.hpp.
|
static |
Calculate padding for a type (implementation detail)
This is a simplified implementation that works for fundamental types and some simple cases. For complex types, the calculation may be approximate due to the difficulty of determining exact member layouts at compile time without reflection.
Definition at line 475 of file typeinfo.hpp.
|
static |
Compile-time endianness detection using preprocessor macros.
This function attempts to determine byte order at compile time using standard preprocessor macros. Falls back to runtime detection if needed.
Definition at line 79 of file endianness.hpp.
|
inline |
Runtime endianness detection using union method.
This function performs runtime byte order detection when compile-time detection is not possible or returns unknown.
Definition at line 134 of file endianness.hpp.
|
static |
Determines typical cache line size for architecture.
Definition at line 422 of file architecture.hpp.
|
static |
Detects C++ standard using __cplusplus macro.
Definition at line 104 of file cpp_standard.hpp.
|
static |
Detects CPU architecture using compiler predefined macros.
Definition at line 321 of file architecture.hpp.
|
static |
Detect page size (implementation detail)
Attempts to detect the actual page size using platform-specific methods. Falls back to common defaults.
Definition at line 510 of file typeinfo.hpp.
|
static |
Determines pointer size based on architecture.
Definition at line 392 of file architecture.hpp.
|
static |
Gets human-readable architecture name.
Definition at line 458 of file architecture.hpp.
|
static |
Gets human-readable standard name.
Definition at line 147 of file cpp_standard.hpp.
|
static |
Gets the __cplusplus macro value.
Definition at line 133 of file cpp_standard.hpp.
|
static |
Check if a type has padding (implementation detail)
Definition at line 498 of file typeinfo.hpp.
|
inline |
|
inline |
Internal initialization state tracking (inline to avoid ODR violations)