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
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#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
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
RWLContainer : Reader-writer protected containers
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
- Use the nuget SiddiqSoft.RWLContainer
- Use CPM to integrate into you CMake project
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 | Versions 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.