SiddiqSoft.RWLContainer 1.3.2

dotnet add package SiddiqSoft.RWLContainer --version 1.3.2                
NuGet\Install-Package SiddiqSoft.RWLContainer -Version 1.3.2                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SiddiqSoft.RWLContainer" Version="1.3.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SiddiqSoft.RWLContainer --version 1.3.2                
#r "nuget: SiddiqSoft.RWLContainer, 1.3.2"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install SiddiqSoft.RWLContainer as a Cake Addin
#addin nuget:?package=SiddiqSoft.RWLContainer&version=1.3.2

// Install SiddiqSoft.RWLContainer as a Cake Tool
#tool nuget:?package=SiddiqSoft.RWLContainer&version=1.3.2                

RWLContainer : Reader-writer protected containers

Build Status alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

Objective

WaitableQueue

  • Implements a thread-safe queue
  • Any number of threads can tryWaitItem with a given timeout on the object.
  • The queue must be given ownership of the StorageType and the thread receiving the object is going to destroy the object.

RWLContainer

  • Avoid re-implementing the rw-lock; standard C++ (since C++14) has a good reader-writer lock implementation.
  • Provide a simple, convenience layer for dictionary containers.
  • The internal storage type is a std::shared_ptr<>

Requirements

  • You must be able to use <shared_mutex> and <mutex>.
  • Minimal target is C++20.
  • We use nlohmann::json only in our tests and the library is aware to provide a conversion operator if library is detected.
  • CMake build system with development on MacOSX, Linux (Fedora) and Windows (VS2022).

Usage

Examples

#include "gtest/gtest.h"
#include "nlohmann/json.hpp"
#include "siddiqsoft/RWLContainer.hpp"


TEST(examples, Example1)
{
    try
    {
        siddiqsoft::RWLContainer<std::string, std::string> myContainer;

        auto item = myContainer.add("foo", "bar");
        ASSERT_TRUE(item);
        EXPECT_EQ("bar", *item);
    }
    catch (...)
    {
        EXPECT_TRUE(false); // if we throw then the test fails.
    }
}

<small align="right">

© 2021 Siddiq Software LLC. All rights reserved.

</small>

Product Compatible and additional computed target framework versions.
native native is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.3.2 96 12/17/2024
1.3.1 67 12/16/2024
1.3.0 74 12/15/2024
1.2.0 82 12/7/2024
1.1.3 600 11/20/2021
1.1.2 379 7/22/2021
1.1.1 372 7/22/2021