Skip to content

API Reference Overview

All public types and concepts in arrp reside within the namespace siddiqsoft::arrp.

Include the complete public API with:

#include <siddiqsoft/arrp.hpp>

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

  1. Move Constructible: T must be movable (std::move_constructible<T>).
  2. Move Assignable: T must be move assignable (std::is_move_assignable_v<T>).
  3. Non-Arithmetic: T cannot 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.