API Reference Overview¶
All public types and concepts in arrp reside within the namespace siddiqsoft::arrp.
Include the complete public API with:
Core API Elements¶
resource_pool<T>
Thread-safe resource container template managing available resources, factory callbacks, timeouts, and JSON metrics.
resource_guard<T>
Move-only RAII handle returned by borrowing. Automatically returns the resource on scope exit or discards it if invalidated.
Types & Enumerations
Capacity limits, error codes (pool_error), release reasons (release_reason), and std::formatter specializations.
Type Constraints: NonNumericMoveConstructible Concept¶
resource_pool<T> and resource_guard<T> require that T satisfies the concept NonNumericMoveConstructible.
template <typename T>
concept NonNumericMoveConstructible =
std::move_constructible<T> &&
std::is_move_assignable_v<T> &&
!std::is_arithmetic_v<T>;
Type Requirements¶
- Move Constructible:
Tmust be movable (std::move_constructible<T>). - Move Assignable:
Tmust be move assignable (std::is_move_assignable_v<T>). - Non-Arithmetic:
Tcannot be a primitive numeric or boolean type (!std::is_arithmetic_v<T>).
Suitable resource types include smart pointers (std::unique_ptr, std::shared_ptr), container objects (std::string, std::vector), network sockets, file handles, and custom database connection classes.