rwlenvelope

RWLEnvelope API Documentation

Build Status

Welcome to RWLEnvelope Documentation

This is the complete API documentation for RWLEnvelope, a header-only C++ template library providing thread-safe access to objects using reader-writer locks.

Quick Navigation

What is RWLEnvelope?

RWLEnvelope simplifies thread-safe access to shared objects by:

  1. Wrapping your object with automatic lock management
  2. Providing clear APIs: observe() for reads, mutate() for writes
  3. Ensuring thread safety: Multiple concurrent readers, exclusive writers
  4. Maintaining exception safety: Locks released properly even if callbacks throw

Quick Example

#include "siddiqsoft/RWLEnvelope.hpp"

siddiqsoft::RWLEnvelope<std::map<std::string, int>> data;

// Read-only access (multiple threads can do this concurrently)
data.observe([](const auto& m) noexcept {
    return m.find("key") != m.end();
});

// Read-write access (exclusive access)
data.mutate([](auto& m) noexcept {
    m["key"] = 42;
});

Key Features

Documentation Structure

The documentation is organized as follows:

Requirements

Installation

Via NuGet:

Install-Package SiddiqSoft.RWLEnvelope

Header-only: Copy include/siddiqsoft/RWLEnvelope.hpp to your project.

Getting Started

  1. Read the API Reference for complete documentation
  2. Check the Examples for common usage patterns
  3. Review Performance Considerations for best practices
  4. See Limitations for important constraints

Support

License

BSD 3-Clause License - See LICENSE for details.


Generated with Doxygen and Doxygen Awesome CSS