|
JH-Toolkit v1.4.1
An engineering-oriented C++20 toolkit with duck-typed concepts, static design, async coroutines, and semantic containers — header-only, RTTI-free, and concurrency-friendly.
|
Compile-time validation utilities for IPC object naming and POSIX-style path safety. More...
Go to the source code of this file.
Namespaces | |
| namespace | jh::sync |
| Aggregated entry point for synchronization and coordination facilities. | |
| namespace | jh::sync::ipc |
| Synchronous inter-process coordination primitives. | |
| namespace | jh::sync::ipc::limits |
Compile-time constraint and validation utilities for jh::sync::ipc. | |
Functions | |
| template<jh::meta::TStr S, std::uint64_t MaxLen = max_name_length> | |
| consteval bool | jh::sync::ipc::limits::valid_object_name () |
| Validate compile-time IPC object name (for semaphores, shared memory, etc.). | |
| template<jh::meta::TStr S> | |
| consteval bool | jh::sync::ipc::limits::valid_relative_path () noexcept |
| Compile-time validation for POSIX-style relative paths. | |
Variables | |
| constexpr std::uint64_t | jh::sync::ipc::limits::max_name_length = 128 |
Compile-time validation utilities for IPC object naming and POSIX-style path safety.
This header defines consteval (compile-time evaluated) utilities to enforce platform-aware constraints for inter-process communication (IPC) primitives implemented under jh::sync::ipc.
It validates:
All validation occurs entirely at compile time — no runtime overhead is introduced.
JH_FORCE_SHORT_SEM_NAME is defined as 1, the name length is treated as "same as BSD" (30) regardless of platform. This is used if a non-detected BSD-like environment is targeted or developing cross-platform code on non-BSD systems. The limit is automatically selected at compile time using jh/macros/platform.h.
These checks are performed via consteval functions, ensuring:
This design provides early failure detection for illegal resource names and guarantees identical IPC namespace semantics across all supported platforms.