summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKirk Shoop <kirk.shoop@microsoft.com>2014-06-12 08:51:57 -0700
committerKirk Shoop <kirk.shoop@microsoft.com>2014-06-12 08:51:57 -0700
commit9c9d3fb77cb242a862d1da978a8cc101dcaf663c (patch)
tree78962f0a8d945e5788e96c37028e3dfcb18d3e13
parent06ea43bbc04b4a1a743d3c129a5ba8a9e1254e20 (diff)
downloadRxCpp-9c9d3fb77cb242a862d1da978a8cc101dcaf663c.tar.gz
remove v1 from master and update readme
also adds one example
-rw-r--r--AUTHORS.txt9
-rw-r--r--README.md106
-rw-r--r--Rx/CPP/.gitattributes22
-rw-r--r--Rx/CPP/.gitignore165
-rw-r--r--Rx/CPP/MfcTimeFliesLikeAnArrow/MainFrm.cpp200
-rw-r--r--Rx/CPP/MfcTimeFliesLikeAnArrow/MainFrm.h91
-rw-r--r--Rx/CPP/MfcTimeFliesLikeAnArrow/MfcTimeFliesLikeAnArrow.cpp153
-rw-r--r--Rx/CPP/MfcTimeFliesLikeAnArrow/MfcTimeFliesLikeAnArrow.h37
-rw-r--r--Rx/CPP/MfcTimeFliesLikeAnArrow/MfcTimeFliesLikeAnArrow.rc276
-rw-r--r--Rx/CPP/MfcTimeFliesLikeAnArrow/MfcTimeFliesLikeAnArrow.vcxproj137
-rw-r--r--Rx/CPP/MfcTimeFliesLikeAnArrow/MfcTimeFliesLikeAnArrow.vcxproj.filters63
-rw-r--r--Rx/CPP/MfcTimeFliesLikeAnArrow/ReadMe.txt95
-rw-r--r--Rx/CPP/MfcTimeFliesLikeAnArrow/Resource.h20
-rw-r--r--Rx/CPP/MfcTimeFliesLikeAnArrow/res/MfcTimeFliesLikeAnArrow.icobin67777 -> 0 bytes
-rw-r--r--Rx/CPP/MfcTimeFliesLikeAnArrow/res/MfcTimeFliesLikeAnArrow.rc2bin830 -> 0 bytes
-rw-r--r--Rx/CPP/MfcTimeFliesLikeAnArrow/stdafx.cpp9
-rw-r--r--Rx/CPP/MfcTimeFliesLikeAnArrow/stdafx.h64
-rw-r--r--Rx/CPP/MfcTimeFliesLikeAnArrow/targetver.h10
-rw-r--r--Rx/CPP/RxCpp.sln26
-rw-r--r--Rx/CPP/license.txt15
-rw-r--r--Rx/CPP/src/RxCpp.vcxproj61
-rw-r--r--Rx/CPP/src/RxCpp.vcxproj.filters43
-rw-r--r--Rx/CPP/src/cpprx/operators/CombineLatest.hpp168
-rw-r--r--Rx/CPP/src/cpprx/operators/Concat.hpp161
-rw-r--r--Rx/CPP/src/cpprx/operators/ConnectForever.hpp22
-rw-r--r--Rx/CPP/src/cpprx/operators/Delay.hpp79
-rw-r--r--Rx/CPP/src/cpprx/operators/Dematerialize.hpp93
-rw-r--r--Rx/CPP/src/cpprx/operators/DistinctUntilChanged.hpp55
-rw-r--r--Rx/CPP/src/cpprx/operators/Empty.hpp74
-rw-r--r--Rx/CPP/src/cpprx/operators/ForEach.hpp49
-rw-r--r--Rx/CPP/src/cpprx/operators/GroupBy.hpp102
-rw-r--r--Rx/CPP/src/cpprx/operators/Interval.hpp62
-rw-r--r--Rx/CPP/src/cpprx/operators/Iterate.hpp86
-rw-r--r--Rx/CPP/src/cpprx/operators/Materialize.hpp87
-rw-r--r--Rx/CPP/src/cpprx/operators/Merge.hpp121
-rw-r--r--Rx/CPP/src/cpprx/operators/Multicast.hpp20
-rw-r--r--Rx/CPP/src/cpprx/operators/Never.hpp22
-rw-r--r--Rx/CPP/src/cpprx/operators/ObserveOnObserver.hpp53
-rw-r--r--Rx/CPP/src/cpprx/operators/Publish.hpp34
-rw-r--r--Rx/CPP/src/cpprx/operators/Random.hpp70
-rw-r--r--Rx/CPP/src/cpprx/operators/Range.hpp65
-rw-r--r--Rx/CPP/src/cpprx/operators/RefCount.hpp102
-rw-r--r--Rx/CPP/src/cpprx/operators/Return.hpp78
-rw-r--r--Rx/CPP/src/cpprx/operators/Scan.hpp127
-rw-r--r--Rx/CPP/src/cpprx/operators/Select.hpp89
-rw-r--r--Rx/CPP/src/cpprx/operators/SelectMany.hpp118
-rw-r--r--Rx/CPP/src/cpprx/operators/Skip.hpp132
-rw-r--r--Rx/CPP/src/cpprx/operators/Subscribe.hpp27
-rw-r--r--Rx/CPP/src/cpprx/operators/SubscribeOnObservable.hpp35
-rw-r--r--Rx/CPP/src/cpprx/operators/Take.hpp173
-rw-r--r--Rx/CPP/src/cpprx/operators/Throttle.hpp97
-rw-r--r--Rx/CPP/src/cpprx/operators/Throw.hpp104
-rw-r--r--Rx/CPP/src/cpprx/operators/ToAsync.hpp48
-rw-r--r--Rx/CPP/src/cpprx/operators/ToStdCollection.hpp44
-rw-r--r--Rx/CPP/src/cpprx/operators/Using.hpp112
-rw-r--r--Rx/CPP/src/cpprx/operators/Where.hpp86
-rw-r--r--Rx/CPP/src/cpprx/operators/Zip.hpp223
-rw-r--r--Rx/CPP/src/cpprx/rx-base.hpp1029
-rw-r--r--Rx/CPP/src/cpprx/rx-includes.hpp100
-rw-r--r--Rx/CPP/src/cpprx/rx-operators.hpp1018
-rw-r--r--Rx/CPP/src/cpprx/rx-scheduler.hpp947
-rw-r--r--Rx/CPP/src/cpprx/rx-util.hpp509
-rw-r--r--Rx/CPP/src/cpprx/rx-windows.hpp282
-rw-r--r--Rx/CPP/src/cpprx/rx-winrt.hpp667
-rw-r--r--Rx/CPP/src/cpprx/rx.hpp587
-rw-r--r--Rx/CPP/test/operators/Merge.cpp60
-rw-r--r--Rx/CPP/test/operators/Publish.cpp111
-rw-r--r--Rx/CPP/test/operators/Return.cpp119
-rw-r--r--Rx/CPP/test/operators/Select.cpp181
-rw-r--r--Rx/CPP/test/operators/SelectMany.cpp279
-rw-r--r--Rx/CPP/test/operators/Where.cpp389
-rw-r--r--Rx/CPP/test/test.cpp2
-rw-r--r--Rx/CPP/testbench/data.txt655
-rw-r--r--Rx/CPP/testbench/testbench.cpp652
-rw-r--r--Rx/CPP/testbench/testbench.vcxproj93
-rw-r--r--Rx/CPP/testbench/testbench.vcxproj.filters22
-rw-r--r--Rx/v2/examples/pythagorian/main.cpp50
-rw-r--r--Rx/v2/test/operators/flat_map.cpp2
-rw-r--r--projects/CMake/CMakeLists.txt76
-rw-r--r--projects/nuget/rxcpp.autoconfig4
80 files changed, 190 insertions, 12264 deletions
diff --git a/AUTHORS.txt b/AUTHORS.txt
index 160efcc..7da61e0 100644
--- a/AUTHORS.txt
+++ b/AUTHORS.txt
@@ -2,9 +2,9 @@ List of contributors to the Rx libraries
Rx and Ix.NET:
Wes Dyer
-Jeffrey van Gogh
-Matthew Podwysocki
-Bart de Smet
+Jeffrey van Gogh
+Matthew Podwysocki
+Bart de Smet
Danny van Velzen
Erik Meijer
Brian Beckman
@@ -24,7 +24,7 @@ Erik Meijer
Tx:
Georgi Chkodrov
-Bart de Smet
+Bart de Smet
Aaron Lahman
Erik Meijer
Brian Grunkemeyer
@@ -38,3 +38,4 @@ Zach Kramer
Rx++ and Ix++:
Aaron Lahman
+Kirk Shoop
diff --git a/README.md b/README.md
index 122be88..9140c1d 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,7 @@ Rxcpp Build status [![Build Status](https://travis-ci.org/Reactive-Extensions/Rx
* Rx.NET: The Reactive Extensions (Rx) is a library for composing asynchronous and event-based programs using observable sequences and LINQ-style query operators.
* RxJS: The Reactive Extensions for JavaScript (RxJS) is a library for composing asynchronous and event-based programs using observable sequences and LINQ-style query operators in JavaScript which can target both the browser and Node.js.
-* Rx++: The Reactive Extensions for Native (RxC) is a library for composing asynchronous and event-based programs using observable sequences and LINQ-style query operators in both C and C++.
+* RxCpp: The Reactive Extensions for Native (RxC) is a library for composing asynchronous and event-based programs using observable sequences and LINQ-style query operators in both C and C++.
# Interactive Extensions
* Ix: The Interactive Extensions (Ix) is a .NET library which extends LINQ to Objects to provide many of the operators available in Rx but targeted for IEnumerable<T>.
@@ -15,8 +15,110 @@ Rxcpp Build status [![Build Status](https://travis-ci.org/Reactive-Extensions/Rx
* Tx: a set of code samples showing how to use LINQ to events, such as real-time standing queries and queries on past history from trace and log files, which targets ETW, Windows Event Logs and SQL Server Extended Events.
* LINQ2Charts: an example for Rx bindings. Similar to existing APIs like LINQ to XML, it allows developers to use LINQ to create/change/update charts in an easy way and avoid having to deal with XML or other underneath data structures. We would love to see more Rx bindings like this one.
+#Building RxCpp
+
+RxCpp is regularly tested on OSX and Windows.
+RxCpp is regularly built with Clang and VC
+RxCpp depends on the latest compiler releases.
+RxCpp does not compile with gcc at this time. Contributions are welcome.
+
+RxCpp uses CMake to create build files for several platforms and IDE's
+
+```cmake projects\CMake```
+
+This will create the default build for the platform.
+
+##Ide builds
+###XCode
+```cmake -G"Xcode" projects\CMake```
+
+###Visual Studio 13
+```cmake -G"Visual Studio 12" projects\CMake```
+Then open in VC2013 and upgrade to the 2013 toolset
+
+##makefile builds
+
+##OSX
+```
+cmake -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=RelWithDebInfo projects\CMake
+make
+```
+
+##Windows
+```
+cmake -G"NMake Makefiles" -DCMAKE_BUILD_TYPE=RelWithDebInfo projects\CMake
+nmake
+```
+
+The build only produces a test binary.
+
+#Running tests
+
+You can use the CMake test runner ```ctest```
+You can run the test binary directly ```rxcppv2_test```
+Tests can be selected by name or tag
+Example of by-tag
+
+```rxcppv2_test [perf]```
+
+#Using RxCpp
+Add ```Rx/v2/src``` to the include paths
+
+```
+#include "rxcpp/rx.hpp"
+// create alias' to simplify code
+// these are owned by the user so that
+// conflicts can be managed by the user.
+namespace rx=rxcpp;
+namespace rxu=rxcpp::util;
+namespace rxsc=rxcpp::schedulers;
+namespace rxsub=rxcpp::subjects;
+
+// At this time, RxCpp will fail to compile if the contents
+// of the std namespace are merged into the global namespace
+// DO NOT USE: 'using namespace std;'
+
+#ifdef UNICODE
+int wmain(int argc, wchar_t** argv)
+#else
+int main(int argc, char** argv)
+#endif
+{
+ int c = 0;
+
+ auto triples =
+ rx::observable<>::range(1)
+ .concat_map(
+ [&c](int z){
+ return rx::observable<>::range(1, z)
+ .concat_map(
+ [=, &c](int x){
+ return rx::observable<>::range(x, z)
+ .filter([=, &c](int y){++c; return x*x + y*y == z*z;})
+ .map([=](int y){return std::make_tuple(x, y, z);})
+ // forget type to workaround lambda deduction bug on msvc 2013
+ .as_dynamic();},
+ [](int x, std::tuple<int,int,int> triplet){return triplet;})
+ // forget type to workaround lambda deduction bug on msvc 2013
+ .as_dynamic();},
+ [](int z, std::tuple<int,int,int> triplet){return triplet;});
+
+ int ct = 0;
+
+ triples
+ .take(100)
+ .subscribe(rxu::apply_to([&ct](int x,int y,int z){
+ ++ct;
+ }));
+
+ std::cout << "concat_map pythagorian range : " << c << " filtered to, " << ct << " triplets" << std::endl;
+
+ return 0;
+}
+```
+
#Contributing Code
Before submitting a feature or substantial code contribution please discuss it with the team and ensure it follows the product roadmap. Note that all code submissions will be rigorously reviewed and tested by the Rx Team, and only those that meet an extremely high bar for both quality and design/roadmap appropriateness will be merged into the source.
-You will need to submit a Contributor License Agreement form before submitting your pull request. This needs to only be done once for any Microsoft OSS project. Download the Contributor License Agreement (CLA). Please fill in, sign, scan and email it to msopentech-cla@microsoft.com.
+You will need to submit a Contributor License Agreement form before submitting your pull request. This needs to only be done once for any Microsoft OSS project. Fill in the [Contributor License Agreement](https://cla.msopentech.com/) (CLA).
diff --git a/Rx/CPP/.gitattributes b/Rx/CPP/.gitattributes
deleted file mode 100644
index 412eeda..0000000
--- a/Rx/CPP/.gitattributes
+++ /dev/null
@@ -1,22 +0,0 @@
-# Auto detect text files and perform LF normalization
-* text=auto
-
-# Custom for Visual Studio
-*.cs diff=csharp
-*.sln merge=union
-*.csproj merge=union
-*.vbproj merge=union
-*.fsproj merge=union
-*.dbproj merge=union
-
-# Standard to msysgit
-*.doc diff=astextplain
-*.DOC diff=astextplain
-*.docx diff=astextplain
-*.DOCX diff=astextplain
-*.dot diff=astextplain
-*.DOT diff=astextplain
-*.pdf diff=astextplain
-*.PDF diff=astextplain
-*.rtf diff=astextplain
-*.RTF diff=astextplain
diff --git a/Rx/CPP/.gitignore b/Rx/CPP/.gitignore
deleted file mode 100644
index 4822a56..0000000
--- a/Rx/CPP/.gitignore
+++ /dev/null
@@ -1,165 +0,0 @@
-#################
-## Eclipse
-#################
-
-*.pydevproject
-.project
-.metadata
-bin/
-tmp/
-*.tmp
-*.bak
-*.swp
-*~.nib
-local.properties
-.classpath
-.settings/
-.loadpath
-
-# External tool builders
-.externalToolBuilders/
-
-# Locally stored "Eclipse launch configurations"
-*.launch
-
-# CDT-specific
-.cproject
-
-# PDT-specific
-.buildpath
-
-
-#################
-## Visual Studio
-#################
-
-## Ignore Visual Studio temporary files, build results, and
-## files generated by popular Visual Studio add-ons.
-
-# User-specific files
-*.suo
-*.user
-*.sln.docstates
-
-# Build results
-[Dd]ebug/
-[Rr]elease/
-*_i.c
-*_p.c
-*.ilk
-*.meta
-*.obj
-*.pch
-*.pdb
-*.pgc
-*.pgd
-*.rsp
-*.sbr
-*.tlb
-*.tli
-*.tlh
-*.tmp
-*.vspscc
-.builds
-*.dotCover
-
-## TODO: If you have NuGet Package Restore enabled, uncomment this
-#packages/
-
-# Visual C++ cache files
-ipch/
-*.aps
-*.ncb
-*.opensdf
-*.sdf
-
-# Visual Studio profiler
-*.psess
-*.vsp
-
-# ReSharper is a .NET coding add-in
-_ReSharper*
-
-# Installshield output folder
-[Ee]xpress
-
-# DocProject is a documentation generator add-in
-DocProject/buildhelp/
-DocProject/Help/*.HxT
-DocProject/Help/*.HxC
-DocProject/Help/*.hhc
-DocProject/Help/*.hhk
-DocProject/Help/*.hhp
-DocProject/Help/Html2
-DocProject/Help/html
-
-# Click-Once directory
-publish
-
-# Others
-[Bb]in
-[Oo]bj
-sql
-TestResults
-*.Cache
-ClientBin
-stylecop.*
-~$*
-*.dbmdl
-Generated_Code #added for RIA/Silverlight projects
-
-# Backup & report files from converting an old project file to a newer
-# Visual Studio version. Backup files are not needed, because we have git ;-)
-_UpgradeReport_Files/
-Backup*/
-UpgradeLog*.XML
-
-
-
-############
-## Windows
-############
-
-# Windows image file caches
-Thumbs.db
-
-# Folder config file
-Desktop.ini
-
-
-#############
-## Python
-#############
-
-*.py[co]
-
-# Packages
-*.egg
-*.egg-info
-dist
-build
-eggs
-parts
-bin
-var
-sdist
-develop-eggs
-.installed.cfg
-
-# Installer logs
-pip-log.txt
-
-# Unit test / coverage reports
-.coverage
-.tox
-
-#Translations
-*.mo
-
-#Mr Developer
-.mr.developer.cfg
-
-# Mac crap
-.DS_Store
-
-a.out
diff --git a/Rx/CPP/MfcTimeFliesLikeAnArrow/MainFrm.cpp b/Rx/CPP/MfcTimeFliesLikeAnArrow/MainFrm.cpp
deleted file mode 100644
index 4fc260d..0000000
--- a/Rx/CPP/MfcTimeFliesLikeAnArrow/MainFrm.cpp
+++ /dev/null
@@ -1,200 +0,0 @@
-// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-
-// MainFrm.cpp : implementation of the CMainFrame class
-//
-
-#include "stdafx.h"
-#include "MfcTimeFliesLikeAnArrow.h"
-
-#include "MainFrm.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#endif
-
-// CMainFrame
-
-IMPLEMENT_DYNAMIC(CMainFrame, CFrameWnd)
-
-BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
- ON_WM_CREATE()
-// ON_WM_SETFOCUS()
- ON_WM_CLOSE()
- ON_WM_MOUSEMOVE()
- ON_WM_PAINT()
-END_MESSAGE_MAP()
-
-static UINT indicators[] =
-{
- ID_SEPARATOR, // status line indicator
- ID_INDICATOR_CAPS,
- ID_INDICATOR_NUM,
- ID_INDICATOR_SCRL,
-};
-
-// CMainFrame construction/destruction
-
-CMainFrame::CMainFrame()
-{
- // TODO: add member initialization code here
-}
-
-CMainFrame::~CMainFrame()
-{
-}
-
-
-// inspired by: http://minirx.codeplex.com/
-void CMainFrame::UserInit()
-{
- auto worker = std::make_shared<rxcpp::EventLoopScheduler>();
- auto mainFormScheduler = std::make_shared<rxcpp::win32::WindowScheduler>();
- auto mouseMove = BindEventToObservable(mouseMoveEvent);
-
- // set up labels and query
- auto msg = L"Time flies like an arrow";
-
-#if LABEL_EXPRESSION_TRACING
- auto start = worker->Now();
- auto ms = std::chrono::milliseconds(1);
-#endif
-
- for (int i = 0; msg[i]; ++i)
- {
- auto label = CreateLabelFromLetter(msg[i], this);
-
- // note: distinct_until_changed is necessary; while
- // Winforms filters duplicate mouse moves,
- // user32 doesn't filter this for you: http://blogs.msdn.com/b/oldnewthing/archive/2003/10/01/55108.aspx
-
- auto s = rxcpp::from(mouseMove)
- .select([=](MouseMoveEventValue e) {
- auto now = worker->Now();
-#if LABEL_EXPRESSION_TRACING
- {std::wstringstream out;
- out << L"input index: " << i << L", ms: " << ((now - start) / ms)
- << L", x: " << e.point.x << L", y: " << e.point.y
- << L", x: " << e.point.x+20*i << L", y: " << e.point.y-20 << std::endl;
- OutputDebugString(out.str().c_str());}
-#endif
- return std::make_tuple(now, e.point); })
- .distinct_until_changed()
- .delay(std::chrono::milliseconds(i * 100 + 1), worker)
-#if LABEL_EXPRESSION_TRACING
- .select(rxcpp::MakeTupleDispatch([=](rxcpp::Scheduler::clock::time_point time, CPoint point) {
- {std::wstringstream out;
- out << L"delayed index: " << i << L", ms: " << ((time - start) / ms)
- << L", x: " << point.x << L", y: " << point.y
- << L", x: " << point.x+20*i << L", y: " << point.y-20 << std::endl;
- OutputDebugString(out.str().c_str());}
- return std::make_tuple(time, point);;}))
-#endif
- .observe_on(mainFormScheduler)
- .subscribe(rxcpp::MakeTupleDispatch([=](rxcpp::Scheduler::clock::time_point time, CPoint point)
- {
-#if LABEL_EXPRESSION_TRACING
- {std::wstringstream out;
- out << L"observed index: " << i << L", ms: " << ((time - start) / ms)
- << L", x: " << point.x << L", y: " << point.y
- << L", x: " << point.x+20*i << L", y: " << point.y-20 << std::endl;
- OutputDebugString(out.str().c_str());}
-#endif
- label->SetWindowPos(nullptr, point.x+20*i, point.y-20, 20, 30, SWP_NOOWNERZORDER);
- label->Invalidate();
-
- // repaint early, for fluid animation
- //label->UpdateWindow();
- this->UpdateWindow();
- }));
-
- composableDisposable.Add(std::move(s));
- }
-}
-
-void CMainFrame::OnClose()
-{
- // shutdown subscription.
- composableDisposable.Dispose();
-
- CFrameWnd::OnClose();
-}
-
-
-int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
-{
- if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
- return -1;
-
- if (!m_wndStatusBar.Create(this))
- {
- TRACE0("Failed to create status bar\n");
- return -1; // fail to create
- }
- m_wndStatusBar.SetIndicators(indicators, sizeof(indicators)/sizeof(UINT));
-
- UserInit();
-
- return 0;
-}
-
-BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
-{
- if( !CFrameWnd::PreCreateWindow(cs) )
- return FALSE;
-
- cs.dwExStyle &= ~WS_EX_CLIENTEDGE;
- cs.lpszClass = AfxRegisterWndClass(CS_HREDRAW|CS_VREDRAW|CS_DBLCLKS, ::LoadCursor(NULL, IDC_ARROW));
- return TRUE;
-}
-
-// CMainFrame diagnostics
-
-#ifdef _DEBUG
-void CMainFrame::AssertValid() const
-{
- CFrameWnd::AssertValid();
-}
-
-void CMainFrame::Dump(CDumpContext& dc) const
-{
- CFrameWnd::Dump(dc);
-}
-#endif //_DEBUG
-
-
-// CMainFrame message handlers
-
-void CMainFrame::OnSetFocus(CWnd* /*pOldWnd*/)
-{
- // forward focus to the view window
- //m_wndView.SetFocus();
-}
-
-BOOL CMainFrame::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo)
-{
- // let the view have first crack at the command
- //if (m_wndView.OnCmdMsg(nID, nCode, pExtra, pHandlerInfo))
- // return TRUE;
-
- // otherwise, do default handling
- return CFrameWnd::OnCmdMsg(nID, nCode, pExtra, pHandlerInfo);
-}
-
-void CMainFrame::OnMouseMove(UINT nFlags, CPoint point)
-{
- MouseMoveEventValue v = {nFlags, point};
- this->mouseMoveEvent(v);
-}
-
-void CMainFrame::OnPaint( )
-{
- CPaintDC dc(this); // device context for painting
-
- RECT rc;
- this->GetClientRect(&rc);
- CBrush brush;
- brush.CreateSolidBrush(RGB(240,240,240));
- dc.FillRect(&rc, &brush);
-}
-
diff --git a/Rx/CPP/MfcTimeFliesLikeAnArrow/MainFrm.h b/Rx/CPP/MfcTimeFliesLikeAnArrow/MainFrm.h
deleted file mode 100644
index 040bc7d..0000000
--- a/Rx/CPP/MfcTimeFliesLikeAnArrow/MainFrm.h
+++ /dev/null
@@ -1,91 +0,0 @@
-// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-
-// MainFrm.h : interface of the CMainFrame class
-//
-
-#pragma once
-
-
-template <class T>
-static std::shared_ptr<rxcpp::Observable<T>>
- BindEventToObservable(std::function<void(T)>& event)
-{
- auto eSubject = rxcpp::CreateSubject<T>();
- event = [=](const T& eventValue) {
- eSubject->OnNext(eventValue);
- };
- return eSubject;
-}
-
-inline CStatic* CreateLabelFromLetter(wchar_t c, CWnd* parent)
-{
- CStatic* label;
- label = new CStatic();
-
- RECT r = { 0, 0, };
- r.right = r.left+20;
- r.bottom = r.top + 30;
-
- auto message = new std::wstring(&c, &c+1);
- label->Create(
- message->c_str(),
- WS_CHILD | WS_VISIBLE,
- r,
- parent);
- return label;
-}
-
-class CMainFrame : public CFrameWnd
-{
-
-public:
- CMainFrame();
-protected:
- DECLARE_DYNAMIC(CMainFrame)
-
-// Attributes
-public:
-
-// Operations
-public:
-
-// Overrides
-public:
- virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
- virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo);
-
-// Implementation
-public:
- virtual ~CMainFrame();
-#ifdef _DEBUG
- virtual void AssertValid() const;
- virtual void Dump(CDumpContext& dc) const;
-#endif
-
-protected: // control bar embedded members
- CStatusBar m_wndStatusBar;
-
- struct MouseMoveEventValue
- {
- UINT nFlags;
- CPoint point;
- };
-
- std::function<void(MouseMoveEventValue)> mouseMoveEvent;
-
-// Generated message map functions
-protected:
- afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
- afx_msg void OnSetFocus(CWnd *pOldWnd);
- afx_msg void OnClose();
- afx_msg void OnMouseMove(UINT nFlags, CPoint point);
- afx_msg void OnPaint( );
-
- DECLARE_MESSAGE_MAP()
-
- void UserInit();
- rxcpp::ComposableDisposable composableDisposable;
-};
-
-
diff --git a/Rx/CPP/MfcTimeFliesLikeAnArrow/MfcTimeFliesLikeAnArrow.cpp b/Rx/CPP/MfcTimeFliesLikeAnArrow/MfcTimeFliesLikeAnArrow.cpp
deleted file mode 100644
index 59c726a..0000000
--- a/Rx/CPP/MfcTimeFliesLikeAnArrow/MfcTimeFliesLikeAnArrow.cpp
+++ /dev/null
@@ -1,153 +0,0 @@
-// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-// MfcTimeFliesLikeAnArrow.cpp : Defines the class behaviors for the application.
-//
-
-#include "stdafx.h"
-#include "afxwinappex.h"
-#include "afxdialogex.h"
-#include "MfcTimeFliesLikeAnArrow.h"
-#include "MainFrm.h"
-
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#endif
-
-
-// CMfcTimeFliesLikeAnArrowApp
-
-BEGIN_MESSAGE_MAP(CMfcTimeFliesLikeAnArrowApp, CWinApp)
- ON_COMMAND(ID_APP_ABOUT, &CMfcTimeFliesLikeAnArrowApp::OnAppAbout)
-END_MESSAGE_MAP()
-
-
-// CMfcTimeFliesLikeAnArrowApp construction
-
-CMfcTimeFliesLikeAnArrowApp::CMfcTimeFliesLikeAnArrowApp()
-{
- // support Restart Manager
- m_dwRestartManagerSupportFlags = AFX_RESTART_MANAGER_SUPPORT_RESTART;
-#ifdef _MANAGED
- // If the application is built using Common Language Runtime support (/clr):
- // 1) This additional setting is needed for Restart Manager support to work properly.
- // 2) In your project, you must add a reference to System.Windows.Forms in order to build.
- System::Windows::Forms::Application::SetUnhandledExceptionMode(System::Windows::Forms::UnhandledExceptionMode::ThrowException);
-#endif
-
- // TODO: replace application ID string below with unique ID string; recommended
- // format for string is CompanyName.ProductName.SubProduct.VersionInformation
- SetAppID(_T("MfcTimeFliesLikeAnArrow.AppID.NoVersion"));
-
- // TODO: add construction code here,
- // Place all significant initialization in InitInstance
-}
-
-// The one and only CMfcTimeFliesLikeAnArrowApp object
-
-CMfcTimeFliesLikeAnArrowApp theApp;
-
-
-// CMfcTimeFliesLikeAnArrowApp initialization
-
-BOOL CMfcTimeFliesLikeAnArrowApp::InitInstance()
-{
- // InitCommonControlsEx() is required on Windows XP if an application
- // manifest specifies use of ComCtl32.dll version 6 or later to enable
- // visual styles. Otherwise, any window creation will fail.
- INITCOMMONCONTROLSEX InitCtrls;
- InitCtrls.dwSize = sizeof(InitCtrls);
- // Set this to include all the common control classes you want to use
- // in your application.
- InitCtrls.dwICC = ICC_WIN95_CLASSES;
- InitCommonControlsEx(&InitCtrls);
-
- CWinApp::InitInstance();
-
-
- EnableTaskbarInteraction(FALSE);
-
- // AfxInitRichEdit2() is required to use RichEdit control
- // AfxInitRichEdit2();
-
- // Standard initialization
- // If you are not using these features and wish to reduce the size
- // of your final executable, you should remove from the following
- // the specific initialization routines you do not need
- // Change the registry key under which our settings are stored
- // TODO: You should modify this string to be something appropriate
- // such as the name of your company or organization
- SetRegistryKey(_T("Local AppWizard-Generated Applications"));
-
-
- // To create the main window, this code creates a new frame window
- // object and then sets it as the application's main window object
- CMainFrame* pFrame = new CMainFrame;
- if (!pFrame)
- return FALSE;
- m_pMainWnd = pFrame;
- // create and load the frame with its resources
- pFrame->LoadFrame(IDR_MAINFRAME,
- WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE, NULL,
- NULL);
-
-
-
-
-
- // The one and only window has been initialized, so show and update it
- pFrame->ShowWindow(SW_SHOW);
- pFrame->UpdateWindow();
- return TRUE;
-}
-
-int CMfcTimeFliesLikeAnArrowApp::ExitInstance()
-{
- //TODO: handle additional resources you may have added
- return CWinApp::ExitInstance();
-}
-
-// CMfcTimeFliesLikeAnArrowApp message handlers
-
-
-// CAboutDlg dialog used for App About
-
-class CAboutDlg : public CDialogEx
-{
-public:
- CAboutDlg();
-
-// Dialog Data
- enum { IDD = IDD_ABOUTBOX };
-
-protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
-
-// Implementation
-protected:
- DECLARE_MESSAGE_MAP()
-};
-
-CAboutDlg::CAboutDlg() : CDialogEx(CAboutDlg::IDD)
-{
-}
-
-void CAboutDlg::DoDataExchange(CDataExchange* pDX)
-{
- CDialogEx::DoDataExchange(pDX);
-}
-
-BEGIN_MESSAGE_MAP(CAboutDlg, CDialogEx)
-END_MESSAGE_MAP()
-
-// App command to run the dialog
-void CMfcTimeFliesLikeAnArrowApp::OnAppAbout()
-{
- CAboutDlg aboutDlg;
- aboutDlg.DoModal();
-}
-
-// CMfcTimeFliesLikeAnArrowApp message handlers
-
-
-
diff --git a/Rx/CPP/MfcTimeFliesLikeAnArrow/MfcTimeFliesLikeAnArrow.h b/Rx/CPP/MfcTimeFliesLikeAnArrow/MfcTimeFliesLikeAnArrow.h
deleted file mode 100644
index b13b068..0000000
--- a/Rx/CPP/MfcTimeFliesLikeAnArrow/MfcTimeFliesLikeAnArrow.h
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-
-// MfcTimeFliesLikeAnArrow.h : main header file for the MfcTimeFliesLikeAnArrow application
-//
-#pragma once
-
-#ifndef __AFXWIN_H__
- #error "include 'stdafx.h' before including this file for PCH"
-#endif
-
-#include "resource.h" // main symbols
-
-
-// CMfcTimeFliesLikeAnArrowApp:
-// See MfcTimeFliesLikeAnArrow.cpp for the implementation of this class
-//
-
-class CMfcTimeFliesLikeAnArrowApp : public CWinApp
-{
-public:
- CMfcTimeFliesLikeAnArrowApp();
-
-
-// Overrides
-public:
- virtual BOOL InitInstance();
- virtual int ExitInstance();
-
-// Implementation
-
-public:
- afx_msg void OnAppAbout();
- DECLARE_MESSAGE_MAP()
-};
-
-extern CMfcTimeFliesLikeAnArrowApp theApp;
diff --git a/Rx/CPP/MfcTimeFliesLikeAnArrow/MfcTimeFliesLikeAnArrow.rc b/Rx/CPP/MfcTimeFliesLikeAnArrow/MfcTimeFliesLikeAnArrow.rc
deleted file mode 100644
index 928bb2f..0000000
--- a/Rx/CPP/MfcTimeFliesLikeAnArrow/MfcTimeFliesLikeAnArrow.rc
+++ /dev/null
@@ -1,276 +0,0 @@
-//Microsoft Visual C++ generated resource script.
-//
-#include "resource.h"
-
-#define APSTUDIO_READONLY_SYMBOLS
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 2 resource.
-//
-#ifndef APSTUDIO_INVOKED
-#include "targetver.h"
-#endif
-#include "afxres.h"
-#include "verrsrc.h"
-
-/////////////////////////////////////////////////////////////////////////////
-#undef APSTUDIO_READONLY_SYMBOLS
-
-#ifdef APSTUDIO_INVOKED
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// TEXTINCLUDE
-//
-
-1 TEXTINCLUDE
-BEGIN
- "resource.h\0"
-END
-
-2 TEXTINCLUDE
-BEGIN
- "#ifndef APSTUDIO_INVOKED\r\n"
- "#include ""targetver.h""\r\n"
- "#endif\r\n"
- "#include ""afxres.h""\r\n"
- "#include ""verrsrc.h""\r\n"
- "\0"
-END
-
-3 TEXTINCLUDE
-BEGIN
- "#define _AFX_NO_OLE_RESOURCES\r\n"
- "#define _AFX_NO_TRACKER_RESOURCES\r\n"
- "#define _AFX_NO_PROPERTY_RESOURCES\r\n"
- "\r\n"
- "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
- "LANGUAGE 9, 1\r\n"
- "#include ""res\\MfcTimeFliesLikeAnArrow.rc2"" // non-Microsoft Visual C++ edited resources\r\n"
- "#include ""afxres.rc"" // Standard components\r\n"
- "#endif\r\n"
- "\0"
-END
-
-#endif // APSTUDIO_INVOKED
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Icon
-//
-
-// Icon with lowest ID value placed first to ensure application icon
-// remains consistent on all systems.
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
-LANGUAGE 9, 1
-IDR_MAINFRAME ICON "res\\MfcTimeFliesLikeAnArrow.ico"
-#endif
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
-LANGUAGE 9, 1
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Menu
-//
-
-IDR_MAINFRAME MENU
-BEGIN
- POPUP "&File"
- BEGIN
- MENUITEM "E&xit", ID_APP_EXIT
- END
- POPUP "&Edit"
- BEGIN
- MENUITEM "&Undo\tCtrl+Z", ID_EDIT_UNDO
- MENUITEM SEPARATOR
- MENUITEM "Cu&t\tCtrl+X", ID_EDIT_CUT
- MENUITEM "&Copy\tCtrl+C", ID_EDIT_COPY
- MENUITEM "&Paste\tCtrl+V", ID_EDIT_PASTE
- END
- POPUP "&View"
- BEGIN
- MENUITEM "&Status Bar", ID_VIEW_STATUS_BAR
- END
- POPUP "&Help"
- BEGIN
- MENUITEM "&About MfcTimeFliesLikeAnArrow...", ID_APP_ABOUT
- END
-END
-
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Accelerator
-//
-
-IDR_MAINFRAME ACCELERATORS
-BEGIN
- "C", ID_EDIT_COPY, VIRTKEY,CONTROL,NOINVERT
- "V", ID_EDIT_PASTE, VIRTKEY,CONTROL,NOINVERT
- VK_BACK, ID_EDIT_UNDO, VIRTKEY,ALT,NOINVERT
- VK_DELETE, ID_EDIT_CUT, VIRTKEY,SHIFT,NOINVERT
- VK_F6, ID_NEXT_PANE, VIRTKEY ,NOINVERT
- VK_F6, ID_PREV_PANE, VIRTKEY,SHIFT,NOINVERT
- VK_INSERT, ID_EDIT_COPY, VIRTKEY,CONTROL,NOINVERT
- VK_INSERT, ID_EDIT_PASTE, VIRTKEY,SHIFT,NOINVERT
- "X", ID_EDIT_CUT, VIRTKEY,CONTROL,NOINVERT
- "Z", ID_EDIT_UNDO, VIRTKEY,CONTROL,NOINVERT
-END
-
-
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Dialog
-//
-
-IDD_ABOUTBOX DIALOGEX 0, 0, 170, 62
-STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
-CAPTION "About MfcTimeFliesLikeAnArrow"
-FONT 8, "MS Shell Dlg"
-BEGIN
- ICON IDR_MAINFRAME,IDC_STATIC,14,14,21,20
- LTEXT "MfcTimeFliesLikeAnArrow, Version 1.0",IDC_STATIC,42,14,114,8,SS_NOPREFIX
- LTEXT "Copyright (C) 2012",IDC_STATIC,42,26,114,8
- DEFPUSHBUTTON "OK",IDOK,113,41,50,14,WS_GROUP
-END
-
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Version
-//
-
-VS_VERSION_INFO VERSIONINFO
- FILEVERSION 1,0,0,1
- PRODUCTVERSION 1,0,0,1
- FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
-#ifdef _DEBUG
- FILEFLAGS VS_FF_DEBUG
-#else
- FILEFLAGS 0x0L
-#endif
- FILEOS VOS_NT_WINDOWS32
- FILETYPE VFT_APP
- FILESUBTYPE VFT2_UNKNOWN
-BEGIN
- BLOCK "StringFileInfo"
- BEGIN
- BLOCK "040904B0"
- BEGIN
- VALUE "CompanyName", "TODO: <Company name>"
- VALUE "FileDescription", "MfcTimeFliesLikeAnArrow"
- VALUE "FileVersion", "1.0.0.1"
- VALUE "InternalName", "MfcTimeFliesLikeAnArrow.exe"
- VALUE "LegalCopyright", "TODO: (c) <Company name>. All rights reserved."
- VALUE "OriginalFilename","MfcTimeFliesLikeAnArrow.exe"
- VALUE "ProductName", "TODO: <Product name>"
- VALUE "ProductVersion", "1.0.0.1"
- END
- END
- BLOCK "VarFileInfo"
- BEGIN
- VALUE "Translation", 0x0409, 1200
- END
-END
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// DESIGNINFO
-//
-
-#ifdef APSTUDIO_INVOKED
-GUIDELINES DESIGNINFO
-BEGIN
- IDD_ABOUTBOX, DIALOG
- BEGIN
- LEFTMARGIN, 7
- RIGHTMARGIN, 163
- TOPMARGIN, 7
- BOTTOMMARGIN, 55
- END
-END
-#endif // APSTUDIO_INVOKED
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// String Table
-//
-
-STRINGTABLE
-BEGIN
-// Non-mac-targeting apps remove the two extra substrings
- IDR_MAINFRAME "MfcTimeFliesLikeAnArrow"
-END
-STRINGTABLE
-BEGIN
- AFX_IDS_APP_TITLE "MfcTimeFliesLikeAnArrow"
- AFX_IDS_IDLEMESSAGE "Ready"
-END
-STRINGTABLE
-BEGIN
- ID_INDICATOR_EXT "EXT"
- ID_INDICATOR_CAPS "CAP"
- ID_INDICATOR_NUM "NUM"
- ID_INDICATOR_SCRL "SCRL"
- ID_INDICATOR_OVR "OVR"
- ID_INDICATOR_REC "REC"
-END
-STRINGTABLE
-BEGIN
- ID_APP_ABOUT "Display program information, version number and copyright\nAbout"
- ID_APP_EXIT "Quit the application; prompts to save documents\nExit"
- ID_NEXT_PANE "Switch to the next window pane\nNext Pane"
- ID_PREV_PANE "Switch back to the previous window pane\nPrevious Pane"
- ID_WINDOW_SPLIT "Split the active window into panes\nSplit"
- ID_EDIT_CLEAR "Erase the selection\nErase"
- ID_EDIT_CLEAR_ALL "Erase everything\nErase All"
- ID_EDIT_COPY "Copy the selection and put it on the Clipboard\nCopy"
- ID_EDIT_CUT "Cut the selection and put it on the Clipboard\nCut"
- ID_EDIT_FIND "Find the specified text\nFind"
- ID_EDIT_PASTE "Insert Clipboard contents\nPaste"
- ID_EDIT_REPEAT "Repeat the last action\nRepeat"
- ID_EDIT_REPLACE "Replace specific text with different text\nReplace"
- ID_EDIT_SELECT_ALL "Select the entire document\nSelect All"
- ID_EDIT_UNDO "Undo the last action\nUndo"
- ID_EDIT_REDO "Redo the previously undone action\nRedo"
- ID_VIEW_STATUS_BAR "Show or hide the status bar\nToggle Status Bar"
-END
-
-STRINGTABLE
-BEGIN
- AFX_IDS_SCSIZE "Change the window size"
- AFX_IDS_SCMOVE "Change the window position"
- AFX_IDS_SCMINIMIZE "Reduce the window to an icon"
- AFX_IDS_SCMAXIMIZE "Enlarge the window to full size"
- AFX_IDS_SCNEXTWINDOW "Switch to the next document window"
- AFX_IDS_SCPREVWINDOW "Switch to the previous document window"
- AFX_IDS_SCCLOSE "Close the active window and prompts to save the documents"
- AFX_IDS_SCRESTORE "Restore the window to normal size"
- AFX_IDS_SCTASKLIST "Activate Task List"
-END
-
-
-#endif
-
-#ifndef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 3 resource.
-//
-
-#define _AFX_NO_OLE_RESOURCES
-#define _AFX_NO_TRACKER_RESOURCES
-#define _AFX_NO_PROPERTY_RESOURCES
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
-LANGUAGE 9, 1
-#include "res\\MfcTimeFliesLikeAnArrow.rc2" // non-Microsoft Visual C++ edited resources
-#include "afxres.rc" // Standard components
-#endif
-#endif // not APSTUDIO_INVOKED
diff --git a/Rx/CPP/MfcTimeFliesLikeAnArrow/MfcTimeFliesLikeAnArrow.vcxproj b/Rx/CPP/MfcTimeFliesLikeAnArrow/MfcTimeFliesLikeAnArrow.vcxproj
deleted file mode 100644
index 01bf711..0000000
--- a/Rx/CPP/MfcTimeFliesLikeAnArrow/MfcTimeFliesLikeAnArrow.vcxproj
+++ /dev/null
@@ -1,137 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup Label="ProjectConfigurations">
- <ProjectConfiguration Include="Debug|Win32">
- <Configuration>Debug</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Release|Win32">
- <Configuration>Release</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- </ItemGroup>
- <PropertyGroup Label="Globals">
- <VCTargetsPath Condition="'$(VCTargetsPath11)' != '' and '$(VSVersion)' == '' and '$(VisualStudioVersion)' == ''">$(VCTargetsPath11)</VCTargetsPath>
- </PropertyGroup>
- <PropertyGroup Label="Globals">
- <ProjectGuid>{E773817F-F3E5-4E78-ADD3-B70E11F611B6}</ProjectGuid>
- <RootNamespace>MfcTimeFliesLikeAnArrow</RootNamespace>
- <Keyword>MFCProj</Keyword>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <UseDebugLibraries>true</UseDebugLibraries>
- <PlatformToolset>v110</PlatformToolset>
- <CharacterSet>Unicode</CharacterSet>
- <UseOfMfc>Static</UseOfMfc>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <UseDebugLibraries>false</UseDebugLibraries>
- <PlatformToolset>v110</PlatformToolset>
- <WholeProgramOptimization>true</WholeProgramOptimization>
- <CharacterSet>Unicode</CharacterSet>
- <UseOfMfc>Static</UseOfMfc>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
- <ImportGroup Label="ExtensionSettings">
- </ImportGroup>
- <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <PropertyGroup Label="UserMacros" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <LinkIncremental>true</LinkIncremental>
- <IncludePath>$(VCInstallDir)include;..\src;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath);</IncludePath>
- <OutDir>$(SolutionDir)\bin\$(Configuration)\</OutDir>
- <IntDir>obj\$(Configuration)\</IntDir>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <LinkIncremental>false</LinkIncremental>
- <IncludePath>$(VCInstallDir)include;..\src;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath);</IncludePath>
- <OutDir>$(SolutionDir)\bin\$(Configuration)\</OutDir>
- <IntDir>obj\$(Configuration)\</IntDir>
- </PropertyGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <ClCompile>
- <PrecompiledHeader>Use</PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <Optimization>Disabled</Optimization>
- <PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- </ClCompile>
- <Link>
- <SubSystem>Windows</SubSystem>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- </Link>
- <Midl>
- <MkTypLibCompatible>false</MkTypLibCompatible>
- <ValidateAllParameters>true</ValidateAllParameters>
- <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- </Midl>
- <ResourceCompile>
- <Culture>0x0409</Culture>
- <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- </ResourceCompile>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <ClCompile>
- <WarningLevel>Level3</WarningLevel>
- <PrecompiledHeader>Use</PrecompiledHeader>
- <Optimization>MaxSpeed</Optimization>
- <FunctionLevelLinking>true</FunctionLevelLinking>
- <IntrinsicFunctions>true</IntrinsicFunctions>
- <PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- </ClCompile>
- <Link>
- <SubSystem>Windows</SubSystem>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <EnableCOMDATFolding>true</EnableCOMDATFolding>
- <OptimizeReferences>true</OptimizeReferences>
- </Link>
- <Midl>
- <MkTypLibCompatible>false</MkTypLibCompatible>
- <ValidateAllParameters>true</ValidateAllParameters>
- <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- </Midl>
- <ResourceCompile>
- <Culture>0x0409</Culture>
- <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- </ResourceCompile>
- </ItemDefinitionGroup>
- <ItemGroup>
- <Text Include="ReadMe.txt" />
- </ItemGroup>
- <ItemGroup>
- <ClInclude Include="MainFrm.h" />
- <ClInclude Include="MfcTimeFliesLikeAnArrow.h" />
- <ClInclude Include="Resource.h" />
- <ClInclude Include="stdafx.h" />
- <ClInclude Include="targetver.h" />
- </ItemGroup>
- <ItemGroup>
- <ClCompile Include="MainFrm.cpp" />
- <ClCompile Include="MfcTimeFliesLikeAnArrow.cpp" />
- <ClCompile Include="stdafx.cpp">
- <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
- <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
- </ClCompile>
- </ItemGroup>
- <ItemGroup>
- <ResourceCompile Include="MfcTimeFliesLikeAnArrow.rc" />
- </ItemGroup>
- <ItemGroup>
- <None Include="res\MfcTimeFliesLikeAnArrow.rc2" />
- </ItemGroup>
- <ItemGroup>
- <Image Include="res\MfcTimeFliesLikeAnArrow.ico" />
- </ItemGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
- <ImportGroup Label="ExtensionTargets">
- </ImportGroup>
-</Project> \ No newline at end of file
diff --git a/Rx/CPP/MfcTimeFliesLikeAnArrow/MfcTimeFliesLikeAnArrow.vcxproj.filters b/Rx/CPP/MfcTimeFliesLikeAnArrow/MfcTimeFliesLikeAnArrow.vcxproj.filters
deleted file mode 100644
index 0b65204..0000000
--- a/Rx/CPP/MfcTimeFliesLikeAnArrow/MfcTimeFliesLikeAnArrow.vcxproj.filters
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup>
- <Filter Include="Source Files">
- <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
- <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
- </Filter>
- <Filter Include="Header Files">
- <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
- <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
- </Filter>
- <Filter Include="Resource Files">
- <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
- <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
- </Filter>
- </ItemGroup>
- <ItemGroup>
- <Text Include="ReadMe.txt" />
- </ItemGroup>
- <ItemGroup>
- <ClInclude Include="MfcTimeFliesLikeAnArrow.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="stdafx.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="targetver.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="MainFrm.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="Resource.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- </ItemGroup>
- <ItemGroup>
- <ClCompile Include="MfcTimeFliesLikeAnArrow.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="stdafx.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="MainFrm.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
- </ItemGroup>
- <ItemGroup>
- <ResourceCompile Include="MfcTimeFliesLikeAnArrow.rc">
- <Filter>Resource Files</Filter>
- </ResourceCompile>
- </ItemGroup>
- <ItemGroup>
- <None Include="res\MfcTimeFliesLikeAnArrow.rc2">
- <Filter>Resource Files</Filter>
- </None>
- </ItemGroup>
- <ItemGroup>
- <Image Include="res\MfcTimeFliesLikeAnArrow.ico">
- <Filter>Resource Files</Filter>
- </Image>
- </ItemGroup>
-</Project> \ No newline at end of file
diff --git a/Rx/CPP/MfcTimeFliesLikeAnArrow/ReadMe.txt b/Rx/CPP/MfcTimeFliesLikeAnArrow/ReadMe.txt
deleted file mode 100644
index 75971ad..0000000
--- a/Rx/CPP/MfcTimeFliesLikeAnArrow/ReadMe.txt
+++ /dev/null
@@ -1,95 +0,0 @@
-================================================================================
- MICROSOFT FOUNDATION CLASS LIBRARY : MfcTimeFliesLikeAnArrow Project Overview
-===============================================================================
-
-The application wizard has created this MfcTimeFliesLikeAnArrow application for
-you. This application not only demonstrates the basics of using the Microsoft
-Foundation Classes but is also a starting point for writing your application.
-
-This file contains a summary of what you will find in each of the files that
-make up your MfcTimeFliesLikeAnArrow application.
-
-MfcTimeFliesLikeAnArrow.vcxproj
- This is the main project file for VC++ projects generated using an application wizard.
- It contains information about the version of Visual C++ that generated the file, and
- information about the platforms, configurations, and project features selected with the
- application wizard.
-
-MfcTimeFliesLikeAnArrow.vcxproj.filters
- This is the filters file for VC++ projects generated using an Application Wizard.
- It contains information about the association between the files in your project
- and the filters. This association is used in the IDE to show grouping of files with
- similar extensions under a specific node (for e.g. ".cpp" files are associated with the
- "Source Files" filter).
-
-MfcTimeFliesLikeAnArrow.h
- This is the main header file for the application. It includes other
- project specific headers (including Resource.h) and declares the
- CMfcTimeFliesLikeAnArrowApp application class.
-
-MfcTimeFliesLikeAnArrow.cpp
- This is the main application source file that contains the application
- class CMfcTimeFliesLikeAnArrowApp.
-
-MfcTimeFliesLikeAnArrow.rc
- This is a listing of all of the Microsoft Windows resources that the
- program uses. It includes the icons, bitmaps, and cursors that are stored
- in the RES subdirectory. This file can be directly edited in Microsoft
- Visual C++. Your project resources are in 1033.
-
-res\MfcTimeFliesLikeAnArrow.ico
- This is an icon file, which is used as the application's icon. This
- icon is included by the main resource file MfcTimeFliesLikeAnArrow.rc.
-
-res\MfcTimeFliesLikeAnArrow.rc2
- This file contains resources that are not edited by Microsoft
- Visual C++. You should place all resources not editable by
- the resource editor in this file.
-
-/////////////////////////////////////////////////////////////////////////////
-
-For the main frame window:
- The project includes a standard MFC interface.
-
-MainFrm.h, MainFrm.cpp
- These files contain the frame class CMainFrame, which is derived from
- CFrameWnd and controls all SDI frame features.
-
-/////////////////////////////////////////////////////////////////////////////
-
-
-
-/////////////////////////////////////////////////////////////////////////////
-
-Other standard files:
-
-StdAfx.h, StdAfx.cpp
- These files are used to build a precompiled header (PCH) file
- named MfcTimeFliesLikeAnArrow.pch and a precompiled types file named StdAfx.obj.
-
-Resource.h
- This is the standard header file, which defines new resource IDs.
- Microsoft Visual C++ reads and updates this file.
-
-MfcTimeFliesLikeAnArrow.manifest
- Application manifest files are used by Windows XP to describe an applications
- dependency on specific versions of Side-by-Side assemblies. The loader uses this
- information to load the appropriate assembly from the assembly cache or private
- from the application. The Application manifest maybe included for redistribution
- as an external .manifest file that is installed in the same folder as the application
- executable or it may be included in the executable in the form of a resource.
-/////////////////////////////////////////////////////////////////////////////
-
-Other notes:
-
-The application wizard uses "TODO:" to indicate parts of the source code you
-should add to or customize.
-
-If your application uses MFC in a shared DLL, you will need
-to redistribute the MFC DLLs. If your application is in a language
-other than the operating system's locale, you will also have to
-redistribute the corresponding localized resources mfc110XXX.DLL.
-For more information on both of these topics, please see the section on
-redistributing Visual C++ applications in MSDN documentation.
-
-/////////////////////////////////////////////////////////////////////////////
diff --git a/Rx/CPP/MfcTimeFliesLikeAnArrow/Resource.h b/Rx/CPP/MfcTimeFliesLikeAnArrow/Resource.h
deleted file mode 100644
index f5a491a..0000000
--- a/Rx/CPP/MfcTimeFliesLikeAnArrow/Resource.h
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-//{{NO_DEPENDENCIES}}
-// Microsoft Visual C++ generated include file.
-// Used by MfcTimeFliesLikeAnArrow.rc
-//
-#define IDD_ABOUTBOX 100
-#define IDR_MAINFRAME 128
-#define IDR_MfcTimeFliesLikTYPE 130
-
-// Next default values for new objects
-//
-#ifdef APSTUDIO_INVOKED
-#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 310
-#define _APS_NEXT_CONTROL_VALUE 1000
-#define _APS_NEXT_SYMED_VALUE 310
-#define _APS_NEXT_COMMAND_VALUE 32771
-#endif
-#endif
diff --git a/Rx/CPP/MfcTimeFliesLikeAnArrow/res/MfcTimeFliesLikeAnArrow.ico b/Rx/CPP/MfcTimeFliesLikeAnArrow/res/MfcTimeFliesLikeAnArrow.ico
deleted file mode 100644
index d56fbcd..0000000
--- a/Rx/CPP/MfcTimeFliesLikeAnArrow/res/MfcTimeFliesLikeAnArrow.ico
+++ /dev/null
Binary files differ
diff --git a/Rx/CPP/MfcTimeFliesLikeAnArrow/res/MfcTimeFliesLikeAnArrow.rc2 b/Rx/CPP/MfcTimeFliesLikeAnArrow/res/MfcTimeFliesLikeAnArrow.rc2
deleted file mode 100644
index 1273ef6..0000000
--- a/Rx/CPP/MfcTimeFliesLikeAnArrow/res/MfcTimeFliesLikeAnArrow.rc2
+++ /dev/null
Binary files differ
diff --git a/Rx/CPP/MfcTimeFliesLikeAnArrow/stdafx.cpp b/Rx/CPP/MfcTimeFliesLikeAnArrow/stdafx.cpp
deleted file mode 100644
index 4f165ae..0000000
--- a/Rx/CPP/MfcTimeFliesLikeAnArrow/stdafx.cpp
+++ /dev/null
@@ -1,9 +0,0 @@
-// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-// stdafx.cpp : source file that includes just the standard includes
-// MfcTimeFliesLikeAnArrow.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-
diff --git a/Rx/CPP/MfcTimeFliesLikeAnArrow/stdafx.h b/Rx/CPP/MfcTimeFliesLikeAnArrow/stdafx.h
deleted file mode 100644
index 32ab5ac..0000000
--- a/Rx/CPP/MfcTimeFliesLikeAnArrow/stdafx.h
+++ /dev/null
@@ -1,64 +0,0 @@
-// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently,
-// but are changed infrequently
-
-#pragma once
-
-#ifndef VC_EXTRALEAN
-#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
-#endif
-
-#include "targetver.h"
-
-#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit
-
-// turns off MFC's hiding of some common and often safely ignored warning messages
-#define _AFX_ALL_WARNINGS
-
-#include <afxwin.h> // MFC core and standard components
-#include <afxext.h> // MFC extensions
-
-
-
-
-
-#ifndef _AFX_NO_OLE_SUPPORT
-#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
-#endif
-#ifndef _AFX_NO_AFXCMN_SUPPORT
-#include <afxcmn.h> // MFC support for Windows Common Controls
-#endif // _AFX_NO_AFXCMN_SUPPORT
-
-#include <afxcontrolbars.h> // MFC support for ribbons and control bars
-
-
-
-
-
-
-
-
-
-#ifdef _UNICODE
-#if defined _M_IX86
-#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")
-#elif defined _M_X64
-#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"")
-#else
-#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
-#endif
-#endif
-
-// STL includes
-#include <memory>
-#include <functional>
-#include <algorithm>
-#include <exception>
-#include <string>
-#include <sstream>
-
-#include "cpprx/rx.hpp"
-
diff --git a/Rx/CPP/MfcTimeFliesLikeAnArrow/targetver.h b/Rx/CPP/MfcTimeFliesLikeAnArrow/targetver.h
deleted file mode 100644
index b447c86..0000000
--- a/Rx/CPP/MfcTimeFliesLikeAnArrow/targetver.h
+++ /dev/null
@@ -1,10 +0,0 @@
-// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-#pragma once
-
-// Including SDKDDKVer.h defines the highest available Windows platform.
-
-// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and
-// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.
-
-#include <SDKDDKVer.h>
diff --git a/Rx/CPP/RxCpp.sln b/Rx/CPP/RxCpp.sln
deleted file mode 100644
index 76d33c8..0000000
--- a/Rx/CPP/RxCpp.sln
+++ /dev/null
@@ -1,26 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 2012
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testbench", "testbench\testbench.vcxproj", "{6FC6DE04-1645-457E-9728-0E8E6FCDC9EB}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MfcTimeFliesLikeAnArrow", "MfcTimeFliesLikeAnArrow\MfcTimeFliesLikeAnArrow.vcxproj", "{E773817F-F3E5-4E78-ADD3-B70E11F611B6}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Win32 = Debug|Win32
- Release|Win32 = Release|Win32
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {6FC6DE04-1645-457E-9728-0E8E6FCDC9EB}.Debug|Win32.ActiveCfg = Debug|Win32
- {6FC6DE04-1645-457E-9728-0E8E6FCDC9EB}.Debug|Win32.Build.0 = Debug|Win32
- {6FC6DE04-1645-457E-9728-0E8E6FCDC9EB}.Release|Win32.ActiveCfg = Release|Win32
- {6FC6DE04-1645-457E-9728-0E8E6FCDC9EB}.Release|Win32.Build.0 = Release|Win32
- {E773817F-F3E5-4E78-ADD3-B70E11F611B6}.Debug|Win32.ActiveCfg = Debug|Win32
- {E773817F-F3E5-4E78-ADD3-B70E11F611B6}.Debug|Win32.Build.0 = Debug|Win32
- {E773817F-F3E5-4E78-ADD3-B70E11F611B6}.Release|Win32.ActiveCfg = Release|Win32
- {E773817F-F3E5-4E78-ADD3-B70E11F611B6}.Release|Win32.Build.0 = Release|Win32
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/Rx/CPP/license.txt b/Rx/CPP/license.txt
deleted file mode 100644
index 5b47fbd..0000000
--- a/Rx/CPP/license.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
-Microsoft Open Technologies would like to thank its contributors, a list
-of whom are at http://rx.codeplex.com/wikipage?title=Contributors.
-
-Licensed under the Apache License, Version 2.0 (the "License"); you
-may not use this file except in compliance with the License. You may
-obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-implied. See the License for the specific language governing permissions
-and limitations under the License. \ No newline at end of file
diff --git a/Rx/CPP/src/RxCpp.vcxproj b/Rx/CPP/src/RxCpp.vcxproj
deleted file mode 100644
index 7a7398f..0000000
--- a/Rx/CPP/src/RxCpp.vcxproj
+++ /dev/null
@@ -1,61 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup Label="ProjectConfigurations">
- <ProjectConfiguration Include="Debug|Win32">
- <Configuration>Debug</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Release|Win32">
- <Configuration>Release</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- </ItemGroup>
- <PropertyGroup Label="Globals">
- <ProjectGuid>{A912FB36-33A7-4DDA-A7D6-D17F9495A623}</ProjectGuid>
- <Keyword>MakeFileProj</Keyword>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
- <ConfigurationType>Makefile</ConfigurationType>
- <UseDebugLibraries>true</UseDebugLibraries>
- <PlatformToolset>v110</PlatformToolset>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
- <ConfigurationType>Makefile</ConfigurationType>
- <UseDebugLibraries>false</UseDebugLibraries>
- <PlatformToolset>v110</PlatformToolset>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
- <ImportGroup Label="ExtensionSettings">
- </ImportGroup>
- <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <PropertyGroup Label="UserMacros" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <NMakePreprocessorDefinitions>WIN32;_DEBUG;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <NMakePreprocessorDefinitions>WIN32;NDEBUG;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
- </PropertyGroup>
- <ItemDefinitionGroup>
- </ItemDefinitionGroup>
- <ItemGroup>
- <Text Include="readme.txt" />
- </ItemGroup>
- <ItemGroup>
- <ClInclude Include="cpprx\rx-base.hpp" />
- <ClInclude Include="cpprx\rx-includes.hpp" />
- <ClInclude Include="cpprx\rx-operators.hpp" />
- <ClInclude Include="cpprx\rx-scheduler.hpp" />
- <ClInclude Include="cpprx\rx-util.hpp" />
- <ClInclude Include="cpprx\rx-windows.hpp" />
- <ClInclude Include="cpprx\rx.hpp" />
- </ItemGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
- <ImportGroup Label="ExtensionTargets">
- </ImportGroup>
-</Project> \ No newline at end of file
diff --git a/Rx/CPP/src/RxCpp.vcxproj.filters b/Rx/CPP/src/RxCpp.vcxproj.filters
deleted file mode 100644
index 2ce3d34..0000000
--- a/Rx/CPP/src/RxCpp.vcxproj.filters
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup>
- <Filter Include="Source Files">
- <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
- <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
- </Filter>
- <Filter Include="Header Files">
- <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
- <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
- </Filter>
- <Filter Include="Resource Files">
- <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
- <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
- </Filter>
- </ItemGroup>
- <ItemGroup>
- <Text Include="readme.txt" />
- </ItemGroup>
- <ItemGroup>
- <ClInclude Include="cpprx\rx.hpp">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="cpprx\rx-base.hpp">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="cpprx\rx-includes.hpp">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="cpprx\rx-operators.hpp">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="cpprx\rx-scheduler.hpp">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="cpprx\rx-util.hpp">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="cpprx\rx-windows.hpp">
- <Filter>Header Files</Filter>
- </ClInclude>
- </ItemGroup>
-</Project> \ No newline at end of file
diff --git a/Rx/CPP/src/cpprx/operators/CombineLatest.hpp b/Rx/CPP/src/cpprx/operators/CombineLatest.hpp
deleted file mode 100644
index d847f9b..0000000
--- a/Rx/CPP/src/cpprx/operators/CombineLatest.hpp
+++ /dev/null
@@ -1,168 +0,0 @@
- // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-#pragma once
-#include "../rx-operators.hpp"
-
-#if !defined(CPPRX_RX_OPERATORS_COMBINELATEST_HPP)
-#define CPPRX_RX_OPERATORS_COMBINELATEST_HPP
-
-namespace rxcpp
-{
-
- namespace detail{
- template<size_t Index, size_t SourcesSize, class SubscribeState>
- struct CombineLatestSubscriber {
- typedef typename SubscribeState::Latest Latest;
- static void subscribe(
- ComposableDisposable& cd,
- const std::shared_ptr<Observer<typename SubscribeState::result_type>>& observer,
- const std::shared_ptr<SubscribeState>& state,
- const typename SubscribeState::Sources& sources) {
- cd.Add(Subscribe(
- std::get<Index>(sources),
- // on next
- [=](const typename std::tuple_element<Index, Latest>::type& element)
- {
- std::unique_lock<std::mutex> guard(state->lock);
- if (state->done) {return;}
- std::get<Index>(state->latest) = element;
- if (!std::get<Index>(state->latestValid)) {
- std::get<Index>(state->latestValid) = true;
- --state->pendingFirst;
- }
- if (state->pendingFirst == 0) {
- auto args = state->latest;
- typedef decltype(util::tuple_dispatch(state->selector, args)) U;
- util::maybe<U> result;
- try {
- result.set(util::tuple_dispatch(state->selector, args));
- } catch(...) {
- observer->OnError(std::current_exception());
- }
- if (!!result) {
- observer->OnNext(std::move(*result.get()));
- }
- }
- },
- // on completed
- [=]
- {
- std::unique_lock<std::mutex> guard(state->lock);
- if (state->done) {return;}
- state->done = true;
- observer->OnCompleted();
- cd.Dispose();
- },
- // on error
- [=](const std::exception_ptr& error)
- {
- std::unique_lock<std::mutex> guard(state->lock);
- if (state->done) {return;}
- state->done = true;
- observer->OnError(error);
- cd.Dispose();
- }));
- CombineLatestSubscriber<Index + 1, SourcesSize, SubscribeState>::
- subscribe(cd, observer, state, sources);
- }
- };
- template<size_t SourcesSize, class SubscribeState>
- struct CombineLatestSubscriber<SourcesSize, SourcesSize, SubscribeState> {
- static void subscribe(
- ComposableDisposable& ,
- const std::shared_ptr<Observer<typename SubscribeState::result_type>>& ,
- const std::shared_ptr<SubscribeState>& ,
- const typename SubscribeState::Sources& ) {}
- };
- }
-
-#if RXCPP_USE_VARIADIC_TEMPLATES
- template <class... CombineLSource, class S>
- auto CombineLatest(
- S selector,
- const std::shared_ptr<Observable<CombineLSource>>&... source
- )
- -> std::shared_ptr<Observable<typename std::result_of<S(const CombineLSource&...)>::type>>
- {
- typedef typename std::result_of<S(const CombineLSource&...)>::type result_type;
- typedef std::tuple<std::shared_ptr<Observable<CombineLSource>>...> Sources;
- typedef std::tuple<CombineLSource...> Latest;
- typedef decltype(std::make_tuple((source, true)...)) LatestValid;
- struct State {
- typedef Latest Latest;
- typedef Sources Sources;
- typedef result_type result_type;
- typedef std::tuple_size<Sources> SourcesSize;
- explicit State(S selector)
- : latestValid()
- , pendingFirst(SourcesSize::value)
- , done(false)
- , selector(std::move(selector))
- {}
- std::mutex lock;
- LatestValid latestValid;
- size_t pendingFirst;
- bool done;
- S selector;
- Latest latest;
- };
- Sources sources(source...);
- // bug on osx prevents using make_shared
- std::shared_ptr<State> state(new State(selector));
- return CreateObservable<result_type>(
- [=](std::shared_ptr<Observer<result_type>> observer) -> Disposable
- {
- ComposableDisposable cd;
- cd.Add(Disposable([state](){state->done = true;}));
- detail::CombineLatestSubscriber<0, State::SourcesSize::value, State>::subscribe(cd, observer, state, sources);
- return cd;
- });
- }
-#else
- template <class CombineLSource1, class CombineLSource2, class S>
- auto CombineLatest(
- S selector,
- const std::shared_ptr<Observable<CombineLSource1>>& source1,
- const std::shared_ptr<Observable<CombineLSource2>>& source2
- )
- -> std::shared_ptr<Observable<typename std::result_of<S(const CombineLSource1&, const CombineLSource2&)>::type>>
- {
- typedef typename std::result_of<S(const CombineLSource1&, const CombineLSource2&)>::type result_type;
- typedef std::tuple<std::shared_ptr<Observable<CombineLSource1>>, std::shared_ptr<Observable<CombineLSource2>>> Sources;
- typedef std::tuple<CombineLSource1, CombineLSource2> Latest;
- typedef std::tuple<bool, bool> LatestValid;
- struct State {
- typedef Latest Latest;
- typedef Sources Sources;
- typedef result_type result_type;
- typedef std::tuple_size<Sources> SourcesSize;
- explicit State(S selector)
- : latestValid()
- , pendingFirst(SourcesSize::value)
- , done(false)
- , selector(std::move(selector))
- {}
- std::mutex lock;
- LatestValid latestValid;
- size_t pendingFirst;
- bool done;
- S selector;
- Latest latest;
- };
- Sources sources(source1, source2);
- // bug on osx prevents using make_shared
- std::shared_ptr<State> state(new State(std::move(selector)));
- return CreateObservable<result_type>(
- [=](std::shared_ptr<Observer<result_type>> observer) -> Disposable
- {
- ComposableDisposable cd;
- cd.Add(Disposable([state](){state->done = true;}));
- detail::CombineLatestSubscriber<0, State::SourcesSize::value, State>::subscribe(cd, observer, state, sources);
- return cd;
- });
- }
-#endif
-
-}
-
-#endif \ No newline at end of file
diff --git a/Rx/CPP/src/cpprx/operators/Concat.hpp b/Rx/CPP/src/cpprx/operators/Concat.hpp
deleted file mode 100644
index e173732..0000000
--- a/Rx/CPP/src/cpprx/operators/Concat.hpp
+++ /dev/null
@@ -1,161 +0,0 @@
- // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-#pragma once
-#include "../rx-operators.hpp"
-
-#if !defined(CPPRX_RX_OPERATORS_CONCAT_HPP)
-#define CPPRX_RX_OPERATORS_CONCAT_HPP
-
-namespace rxcpp
-{
-
- template <class ObservableT>
- ObservableT Concat(
- const std::shared_ptr<Observable<ObservableT>>& source)
- {
- typedef typename observable_item<ObservableT>::type T;
- return CreateObservable<T>(
- [=](std::shared_ptr<Observer<T>> observer)
- -> Disposable
- {
- struct State {
- bool completed;
- bool subscribed;
- bool cancel;
- std::queue<ObservableT> queue;
- Scheduler::shared scheduler;
- std::mutex lock;
- };
- auto state = std::make_shared<State>();
- state->cancel = false;
- state->subscribed = 0;
- state->scheduler = std::make_shared<CurrentThreadScheduler>();
-
- ComposableDisposable cd;
-
- SerialDisposable sd;
- cd.Add(sd);
-
- cd.Add(Disposable([=]{
- std::unique_lock<std::mutex> guard(state->lock);
- state->cancel = true; })
- );
-
- cd.Add(Subscribe(
- source,
- // on next
- [=](const ObservableT& sourceElement)
- {
- bool cancel = false;
- bool subscribed = false;
- Scheduler::shared sched;
- {
- std::unique_lock<std::mutex> guard(state->lock);
- cancel = state->cancel;
- sched = state->scheduler;
- if (!cancel) {
- subscribed = state->subscribed;
- state->queue.push(sourceElement);
- state->subscribed = true;
- sched = state->scheduler;
- }
- }
- if (!cancel && !subscribed) {
- sd.Set(sched->Schedule(
- fix0([state, cd, sd, observer](Scheduler::shared s, std::function<Disposable(Scheduler::shared)> self) -> Disposable
- {
- bool cancel = false;
- bool finished = false;
- ObservableT next;
- {
- std::unique_lock<std::mutex> guard(state->lock);
- finished = state->queue.empty();
- cancel = state->cancel;
- if (!cancel && !finished) {next = state->queue.front(); state->queue.pop();}
- }
- if (!cancel && !finished) {
- sd.Set(Subscribe(
- next,
- // on next
- [=](const T& t)
- {
- bool cancel = false;
- {
- std::unique_lock<std::mutex> guard(state->lock);
- cancel = state->cancel;
- }
- if (!cancel) {
- observer->OnNext(std::move(t));
- }
- },
- // on completed
- [=]
- {
- bool cancel = false;
- bool finished = false;
- bool subscribe = false;
- {
- std::unique_lock<std::mutex> guard(state->lock);
- finished = state->queue.empty() && state->completed;
- subscribe = !state->queue.empty();
- state->subscribed = subscribe;
- cancel = state->cancel;
- }
- if (!cancel) {
- if (subscribe) {sd.Set(s->Schedule(std::move(self)));}
- else if (finished) {observer->OnCompleted(); cd.Dispose();}
- }
- },
- // on error
- [=](const std::exception_ptr& error)
- {
- bool cancel = false;
- {
- std::unique_lock<std::mutex> guard(state->lock);
- cancel = state->cancel;
- }
- if (!cancel) {
- observer->OnError(std::current_exception());
- }
- cd.Dispose();
- }));
- }
- return Disposable::Empty();
- })));
- }
- },
- // on completed
- [=]
- {
- bool cancel = false;
- bool finished = false;
- {
- std::unique_lock<std::mutex> guard(state->lock);
- state->completed = true;
- finished = state->queue.empty() && !state->subscribed;
- cancel = state->cancel;
- }
- if (!cancel && finished) {
- observer->OnCompleted();
- cd.Dispose();
- }
- },
- // on error
- [=](const std::exception_ptr& error)
- {
- bool cancel = false;
- {
- std::unique_lock<std::mutex> guard(state->lock);
- cancel = state->cancel;
- }
- if (!cancel) {
- observer->OnError(std::current_exception());
- }
- cd.Dispose();
- }));
- return cd;
- });
- }
-}
-
-#endif \ No newline at end of file
diff --git a/Rx/CPP/src/cpprx/operators/ConnectForever.hpp b/Rx/CPP/src/cpprx/operators/ConnectForever.hpp
deleted file mode 100644
index 1c873ee..0000000
--- a/Rx/CPP/src/cpprx/operators/ConnectForever.hpp
+++ /dev/null
@@ -1,22 +0,0 @@
- // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-#pragma once
-#include "../rx-operators.hpp"
-
-#if !defined(CPPRX_RX_OPERATORS_CONNECTFOREVER_HPP)
-#define CPPRX_RX_OPERATORS_CONNECTFOREVER_HPP
-
-namespace rxcpp
-{
-
- template <class T>
- const std::shared_ptr<Observable<T>> ConnectForever(
- const std::shared_ptr<ConnectableObservable<T>>& source
- )
- {
- source->Connect();
- return observable(source);
- }
-}
-
-#endif \ No newline at end of file
diff --git a/Rx/CPP/src/cpprx/operators/Delay.hpp b/Rx/CPP/src/cpprx/operators/Delay.hpp
deleted file mode 100644
index fe55f70..0000000
--- a/Rx/CPP/src/cpprx/operators/Delay.hpp
+++ /dev/null
@@ -1,79 +0,0 @@
- // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-#pragma once
-#include "../rx-operators.hpp"
-
-#if !defined(CPPRX_RX_OPERATORS_DELAY_HPP)
-#define CPPRX_RX_OPERATORS_DELAY_HPP
-
-namespace rxcpp
-{
-
- template <class T>
- std::shared_ptr<Observable<T>> Delay(
- const std::shared_ptr<Observable<T>>& source,
- Scheduler::clock::duration due,
- Scheduler::shared scheduler)
- {
- return CreateObservable<T>(
- [=](std::shared_ptr<Observer<T>> observer)
- -> Disposable
- {
- auto cancel = std::make_shared<bool>(false);
-
- ComposableDisposable cd;
-
- cd.Add(Disposable([=]{
- *cancel = true; }));
-
- SerialDisposable sd;
- auto wsd = cd.Add(sd);
-
- cd.Add(Subscribe(
- source,
- // on next
- [=](const T& element)
- {
- auto sched_disposable = scheduler->Schedule(
- due,
- [=] (Scheduler::shared) -> Disposable {
- if (!*cancel)
- observer->OnNext(element);
- return Disposable::Empty();
- }
- );
- auto ssd = wsd.lock();
- if (ssd)
- {
- *ssd.get() = std::move(sched_disposable);
- }
- },
- // on completed
- [=]
- {
- auto sched_disposable = scheduler->Schedule(
- due,
- [=](Scheduler::shared) -> Disposable {
- if (!*cancel)
- observer->OnCompleted();
- return Disposable::Empty();
- }
- );
- auto ssd = wsd.lock();
- if (ssd)
- {
- *ssd.get() = std::move(sched_disposable);
- }
- },
- // on error
- [=](const std::exception_ptr& error)
- {
- if (!*cancel)
- observer->OnError(error);
- }));
- return cd;
- });
- }
-}
-
-#endif \ No newline at end of file
diff --git a/Rx/CPP/src/cpprx/operators/Dematerialize.hpp b/Rx/CPP/src/cpprx/operators/Dematerialize.hpp
deleted file mode 100644
index 796a133..0000000
--- a/Rx/CPP/src/cpprx/operators/Dematerialize.hpp
+++ /dev/null
@@ -1,93 +0,0 @@
- // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-#pragma once
-#include "../rx-operators.hpp"
-
-#if !defined(CPPRX_RX_OPERATORS_DEMATERIALIZE_HPP)
-#define CPPRX_RX_OPERATORS_DEMATERIALIZE_HPP
-
-namespace rxcpp
-{
-
-namespace detail
-{
-
-template<class T>
-class DematerializeObservable : public Producer<DematerializeObservable<T>, T>
-{
- typedef DematerializeObservable<T> This;
- typedef std::shared_ptr<This> Parent;
- typedef std::shared_ptr<Observable<std::shared_ptr<Notification<T>>>> Source;
- typedef std::shared_ptr<Observer<T>> Destination;
-
-private:
-
- Source source;
-
- class _ : public Sink<_, T>, public Observer<std::shared_ptr<Notification<T>>>
- {
- Parent parent;
-
- public:
- typedef Sink<_, T> SinkBase;
-
- _(Parent parent, Destination observer, Disposable cancel) :
- SinkBase(std::move(observer), std::move(cancel)),
- parent(parent)
- {
- }
-
- virtual void OnNext(const std::shared_ptr<Notification<T>>& n)
- {
- n->Accept([this](const T& t){
- this->SinkBase::observer->OnNext(t);
- }, [this](){
- this->SinkBase::observer->OnCompleted();
- this->SinkBase::Dispose();
- }, [this](const std::exception_ptr& e){
- this->SinkBase::observer->OnError(e);
- this->SinkBase::Dispose();
- });
- }
- virtual void OnCompleted()
- {
- SinkBase::observer->OnCompleted();
- SinkBase::Dispose();
- }
- virtual void OnError(const std::exception_ptr& e)
- {
- SinkBase::observer->OnError(e);
- SinkBase::Dispose();
- }
- };
-
- typedef Producer<This, T> ProducerBase;
-public:
-
- DematerializeObservable(Source source) :
- ProducerBase([this](Parent parent, Destination observer, Disposable && cancel, typename ProducerBase::SetSink setSink) -> Disposable
- {
- auto sink = std::shared_ptr<_>(new _(parent, observer, std::move(cancel)));
- setSink(sink->GetDisposable());
- return this->source->Subscribe(sink);
- }),
- source(std::move(source))
- {
- }
-};
-
-}
-
-template <class T>
-std::shared_ptr<Observable<T>> Dematerialize(
- const std::shared_ptr<Observable<std::shared_ptr<Notification<T>>>>& source
-)
-{
- return std::make_shared<detail::DematerializeObservable<T>>(
- std::move(source)
- );
-}
-
-}
-
-#endif \ No newline at end of file
diff --git a/Rx/CPP/src/cpprx/operators/DistinctUntilChanged.hpp b/Rx/CPP/src/cpprx/operators/DistinctUntilChanged.hpp
deleted file mode 100644
index 1796ed9..0000000
--- a/Rx/CPP/src/cpprx/operators/DistinctUntilChanged.hpp
+++ /dev/null
@@ -1,55 +0,0 @@
- // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-#pragma once
-#include "../rx-operators.hpp"
-
-#if !defined(CPPRX_RX_OPERATORS_DISTINCTUNTILCHANGED_HPP)
-#define CPPRX_RX_OPERATORS_DISTINCTUNTILCHANGED_HPP
-
-namespace rxcpp
-{
-
- // removes duplicate-sequenced values. e.g. 1,2,2,3,1 ==> 1,2,3,1
- template <class T>
- std::shared_ptr<Observable<T>> DistinctUntilChanged(
- const std::shared_ptr<Observable<T>>& source)
- {
- return CreateObservable<T>(
- [=](std::shared_ptr<Observer<T>> observer)
- -> Disposable
- {
- struct State {
- State() : last(), hasValue(false) {}
- T last; bool hasValue;
- };
-
- auto state = std::make_shared<State>();
- state->hasValue = false;
-
- return Subscribe(
- source,
- // on next
- [=](const T& element)
- {
- if (!state->hasValue || !(state->last == element))
- {
- observer->OnNext(element);
- state->last = element;
- state->hasValue = true;
- }
- },
- // on completed
- [=]
- {
- observer->OnCompleted();
- },
- // on error
- [=](const std::exception_ptr& error)
- {
- observer->OnError(error);
- });
- });
- }
-}
-
-#endif \ No newline at end of file
diff --git a/Rx/CPP/src/cpprx/operators/Empty.hpp b/Rx/CPP/src/cpprx/operators/Empty.hpp
deleted file mode 100644
index 09466ca..0000000
--- a/Rx/CPP/src/cpprx/operators/Empty.hpp
+++ /dev/null
@@ -1,74 +0,0 @@
- // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-#pragma once
-#include "../rx-operators.hpp"
-
-#if !defined(CPPRX_RX_OPERATORS_EMPTY_HPP)
-#define CPPRX_RX_OPERATORS_EMPTY_HPP
-
-namespace rxcpp
-{
-
- namespace detail
- {
- template<class T>
- class EmptyObservable : public Producer<EmptyObservable<T>, T>
- {
- typedef std::shared_ptr<EmptyObservable<T>> Parent;
- Scheduler::shared scheduler;
-
- class _ : public Sink<_, T>
- {
- Parent parent;
-
- public:
- typedef Sink<_, T> SinkBase;
-
- _(Parent parent, std::shared_ptr < Observer < T >> observer, Disposable cancel) :
- SinkBase(std::move(observer), std::move(cancel)),
- parent(parent)
- {
- }
-
- Disposable Run()
- {
- auto local = parent;
- auto that = this->shared_from_this();
- return parent->scheduler->Schedule(
- [=](Scheduler::shared) -> Disposable {
- that->SinkBase::observer->OnCompleted();
- that->SinkBase::Dispose();
- return Disposable::Empty();
- });
- }
- };
-
- typedef Producer<EmptyObservable<T>, T> ProducerBase;
- public:
-
- EmptyObservable(Scheduler::shared scheduler) :
- ProducerBase([](Parent parent, std::shared_ptr < Observer < T >> observer, Disposable && cancel, typename ProducerBase::SetSink setSink) -> Disposable
- {
- auto sink = std::shared_ptr<_>(new _(parent, observer, std::move(cancel)));
- setSink(sink->GetDisposable());
- return sink->Run();
- }),
- scheduler(scheduler)
- {
- if (!scheduler)
- {
- this->scheduler = std::make_shared<CurrentThreadScheduler>();
- }
- }
- };
- }
- template <class T>
- std::shared_ptr<Observable<T>> Empty(
- Scheduler::shared scheduler = nullptr
- )
- {
- return std::make_shared<detail::EmptyObservable<T>>(std::move(scheduler));
- }
-}
-
-#endif
diff --git a/Rx/CPP/src/cpprx/operators/ForEach.hpp b/Rx/CPP/src/cpprx/operators/ForEach.hpp
deleted file mode 100644
index e2c815e..0000000
--- a/Rx/CPP/src/cpprx/operators/ForEach.hpp
+++ /dev/null
@@ -1,49 +0,0 @@
- // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-#pragma once
-#include "../rx-operators.hpp"
-
-#if !defined(CPPRX_RX_OPERATORS_FOREACH_HPP)
-#define CPPRX_RX_OPERATORS_FOREACH_HPP
-
-namespace rxcpp
-{
-
- template <class T>
- void ForEach(
- const std::shared_ptr<Observable<T>>& source,
- typename util::identity<std::function<void(const T&)>>::type onNext
- )
- {
- std::mutex lock;
- std::condition_variable wake;
- bool done = false;
- std::exception_ptr error;
- auto observer = CreateObserver<T>(std::move(onNext),
- //on completed
- [&]{
- std::unique_lock<std::mutex> guard(lock);
- done = true;
- wake.notify_one();
- },
- //on error
- [&](const std::exception_ptr& e){
- std::unique_lock<std::mutex> guard(lock);
- done = true;
- error = std::move(e);
- wake.notify_one();
- });
-
- source->Subscribe(observer);
-
- {
- std::unique_lock<std::mutex> guard(lock);
- wake.wait(guard, [&]{return done;});
- }
-
- if (error != std::exception_ptr()) {
- std::rethrow_exception(error);}
- }
-}
-
-#endif \ No newline at end of file
diff --git a/Rx/CPP/src/cpprx/operators/GroupBy.hpp b/Rx/CPP/src/cpprx/operators/GroupBy.hpp
deleted file mode 100644
index e9e7923..0000000
--- a/Rx/CPP/src/cpprx/operators/GroupBy.hpp
+++ /dev/null
@@ -1,102 +0,0 @@
- // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-#pragma once
-#include "../rx-operators.hpp"
-
-#if !defined(CPPRX_RX_OPERATORS_GROUPBY_HPP)
-#define CPPRX_RX_OPERATORS_GRUOPBY_HPP
-
-namespace rxcpp
-{
-
- template <class T, class KS, class VS, class L>
- auto GroupBy(
- const std::shared_ptr<Observable<T>>& source,
- KS keySelector,
- VS valueSelector,
- L less)
- -> std::shared_ptr<Observable<std::shared_ptr<GroupedObservable<
- typename std::decay<decltype(keySelector((*(T*)0)))>::type,
- typename std::decay<decltype(valueSelector((*(T*)0)))>::type>>>>
- {
- typedef typename std::decay<decltype(keySelector((*(T*)0)))>::type Key;
- typedef typename std::decay<decltype(valueSelector((*(T*)0)))>::type Value;
-
- typedef std::shared_ptr<GroupedObservable<Key, Value>> LocalGroupObservable;
-
- return CreateObservable<LocalGroupObservable>(
- [=](std::shared_ptr<Observer<LocalGroupObservable>> observer) -> Disposable
- {
- typedef std::map<Key, std::shared_ptr<GroupedSubject<Key, Value>>, L> Groups;
-
- struct State
- {
- explicit State(L less) : groups(std::move(less)) {}
- std::mutex lock;
- Groups groups;
- };
- auto state = std::make_shared<State>(std::move(less));
-
- return Subscribe(
- source,
- // on next
- [=](const T& element)
- {
- util::maybe<Key> key;
- try {
- key.set(keySelector(element));
- } catch(...) {
- observer->OnError(std::current_exception());
- }
-
- if (!!key) {
- auto keySubject = CreateGroupedSubject<Value>(*key.get());
-
- typename Groups::iterator groupIt;
- bool newGroup = false;
-
- {
- std::unique_lock<std::mutex> guard(state->lock);
- std::tie(groupIt, newGroup) = state->groups.insert(
- std::make_pair(*key.get(), keySubject)
- );
- }
-
- if (newGroup)
- {
- LocalGroupObservable nextGroup(std::move(keySubject));
- observer->OnNext(nextGroup);
- }
-
- util::maybe<Value> result;
- try {
- result.set(valueSelector(element));
- } catch(...) {
- observer->OnError(std::current_exception());
- }
- if (!!result) {
- groupIt->second->OnNext(std::move(*result.get()));
- }
- }
- },
- // on completed
- [=]
- {
- for(auto& group : state->groups) {
- group.second->OnCompleted();
- }
- observer->OnCompleted();
- },
- // on error
- [=](const std::exception_ptr& error)
- {
- for(auto& group : state->groups) {
- group.second->OnError(error);
- }
- observer->OnError(error);
- });
- });
- }
-}
-
-#endif \ No newline at end of file
diff --git a/Rx/CPP/src/cpprx/operators/Interval.hpp b/Rx/CPP/src/cpprx/operators/Interval.hpp
deleted file mode 100644
index cd5a3e9..0000000
--- a/Rx/CPP/src/cpprx/operators/Interval.hpp
+++ /dev/null
@@ -1,62 +0,0 @@
- // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-#pragma once
-#include "../rx-operators.hpp"
-
-#if !defined(CPPRX_RX_OPERATORS_INTERVAL_HPP)
-#define CPPRX_RX_OPERATORS_INTERVAL_HPP
-
-namespace rxcpp
-{
-
- inline std::shared_ptr<Observable<size_t>> Interval(
- Scheduler::clock::duration due,
- Scheduler::shared scheduler)
- {
- return CreateObservable<size_t>(
- [=](std::shared_ptr<Observer<size_t>> observer)
- -> Disposable
- {
- struct State : public std::enable_shared_from_this<State> {
- State(Scheduler::clock::duration due,
- Scheduler::clock::time_point last,
- std::shared_ptr<Observer<size_t>> observer) : due(due), last(last), cursor(0), observer(observer) {
- cd.Add(sd);}
-
- Scheduler::clock::duration due;
- Scheduler::clock::time_point last;
- size_t cursor;
- std::shared_ptr<Observer<size_t>> observer;
- ComposableDisposable cd;
- SerialDisposable sd;
-
- void Tick(Scheduler::shared s){
- observer->OnNext(cursor);
- last += due;
- ++cursor;
- auto keepAlive = this->shared_from_this();
- sd.Set(s->Schedule(
- last,
- [this, keepAlive] (Scheduler::shared s) -> Disposable {
- Tick(s);
- return Disposable::Empty();
- }
- ));
- }
- };
- auto state = std::make_shared<State>(due, scheduler->Now(), observer);
-
- state->last += state->due;
- state->sd.Set(scheduler->Schedule(
- state->last,
- [=] (Scheduler::shared s) -> Disposable {
- state->Tick(s);
- return Disposable::Empty();
- }
- ));
- return state->cd;
- });
- }
-}
-
-#endif \ No newline at end of file
diff --git a/Rx/CPP/src/cpprx/operators/Iterate.hpp b/Rx/CPP/src/cpprx/operators/Iterate.hpp
deleted file mode 100644
index 8478de1..0000000
--- a/Rx/CPP/src/cpprx/operators/Iterate.hpp
+++ /dev/null
@@ -1,86 +0,0 @@
- // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-#pragma once
-#include "../rx-operators.hpp"
-
-#if !defined(CPPRX_RX_OPERATORS_ITERATE_HPP)
-#define CPPRX_RX_OPERATORS_ITERATE_HPP
-
-namespace rxcpp
-{
-
- using std::begin;
- using std::end;
- template <class Range>
- auto Iterate(
- Range r,
- Scheduler::shared scheduler = nullptr)
- -> std::shared_ptr<Observable<typename std::decay<decltype(*begin(r))>::type>>
- {
- typedef decltype(begin(r)) It;
- typedef typename std::decay<decltype(*begin(r))>::type T;
-
- if (!scheduler) {scheduler = std::make_shared<CurrentThreadScheduler>();}
- auto range = std::make_shared<Range>(std::move(r));
-
- return CreateObservable<T>(
- [=](std::shared_ptr<Observer<T>> observer) -> Disposable
- {
- struct State
- {
- explicit State(std::shared_ptr<Range> rangeArg) {
- // finally tracked down issue caused by clang compiler bug.
- // initializing in the init list only works sometimes.
- // a breakpoint here would eventually show that
- // cancel was true instead of false.
- // initializing in the body instead works every time.
- // or using new instead of std::make_shared to create
- // State will cause the init list to work every time
- this->cancel = false;
- this->range = std::move(rangeArg);
- this->r_cursor = begin(*this->range);
- this->r_end = end(*this->range);
- }
- bool cancel;
- std::shared_ptr<Range> range;
- It r_cursor;
- It r_end;
- };
- auto state = std::make_shared<State>(range);
-
- ComposableDisposable cd;
-
- cd.Add(Disposable([=]{
- state->cancel = true;
- }));
-
- SerialDisposable sd;
-
- cd.Add(sd);
-
- sd.Set(scheduler->Schedule(
- fix0([=](Scheduler::shared s, std::function<Disposable(Scheduler::shared)> self) -> Disposable
- {
- if (state->cancel)
- return Disposable::Empty();
-
- if (state->r_cursor == state->r_end)
- {
- observer->OnCompleted();
- }
- else
- {
- observer->OnNext(*state->r_cursor);
- ++state->r_cursor;
- sd.Set(s->Schedule(std::move(self)));
- return cd;
- }
- return Disposable::Empty();
- })));
-
- return cd;
- });
- }
-}
-
-#endif \ No newline at end of file
diff --git a/Rx/CPP/src/cpprx/operators/Materialize.hpp b/Rx/CPP/src/cpprx/operators/Materialize.hpp
deleted file mode 100644
index ede4d6e..0000000
--- a/Rx/CPP/src/cpprx/operators/Materialize.hpp
+++ /dev/null
@@ -1,87 +0,0 @@
- // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-#pragma once
-#include "../rx-operators.hpp"
-
-#if !defined(CPPRX_RX_OPERATORS_MATERIALIZE_HPP)
-#define CPPRX_RX_OPERATORS_MATERIALIZE_HPP
-
-namespace rxcpp
-{
-
-namespace detail
-{
-
-template<class T>
-class MaterializeObservable : public Producer<MaterializeObservable<T>, std::shared_ptr<Notification<T>>>
-{
- typedef MaterializeObservable<T> This;
- typedef std::shared_ptr<This> Parent;
- typedef std::shared_ptr<Observable<T>> Source;
- typedef std::shared_ptr<Observer<std::shared_ptr<Notification<T>>>> Destination;
-
-private:
-
- Source source;
-
- class _ : public Sink<_, std::shared_ptr<Notification<T>>>, public Observer<T>
- {
- Parent parent;
-
- public:
- typedef Sink<_, std::shared_ptr<Notification<T>>> SinkBase;
-
- _(Parent parent, Destination observer, Disposable cancel) :
- SinkBase(std::move(observer), std::move(cancel)),
- parent(parent)
- {
- }
-
- virtual void OnNext(const T& t)
- {
- SinkBase::observer->OnNext(Notification<T>::CreateOnNext(t));
- }
- virtual void OnCompleted()
- {
- SinkBase::observer->OnNext(Notification<T>::CreateOnCompleted());
- SinkBase::observer->OnCompleted();
- SinkBase::Dispose();
- }
- virtual void OnError(const std::exception_ptr& e)
- {
- SinkBase::observer->OnNext(Notification<T>::CreateOnError(e));
- SinkBase::observer->OnCompleted();
- SinkBase::Dispose();
- }
- };
-
- typedef Producer<This, std::shared_ptr<Notification<T>>> ProducerBase;
-public:
-
- MaterializeObservable(Source source) :
- ProducerBase([this](Parent parent, Destination observer, Disposable && cancel, typename ProducerBase::SetSink setSink) -> Disposable
- {
- auto sink = std::shared_ptr<_>(new _(parent, observer, std::move(cancel)));
- setSink(sink->GetDisposable());
- return this->source->Subscribe(sink);
- }),
- source(std::move(source))
- {
- }
-};
-
-}
-
-template <class T>
-std::shared_ptr<Observable<std::shared_ptr<Notification<T>>>> Materialize(
- const std::shared_ptr<Observable<T>>& source
-)
-{
- return std::make_shared<detail::MaterializeObservable<T>>(
- std::move(source)
- );
-}
-
-}
-
-#endif \ No newline at end of file
diff --git a/Rx/CPP/src/cpprx/operators/Merge.hpp b/Rx/CPP/src/cpprx/operators/Merge.hpp
deleted file mode 100644
index 4a724ca..0000000
--- a/Rx/CPP/src/cpprx/operators/Merge.hpp
+++ /dev/null
@@ -1,121 +0,0 @@
- // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-#pragma once
-#include "../rx-operators.hpp"
-
-#if !defined(CPPRX_RX_OPERATORS_MERGE_HPP)
-#define CPPRX_RX_OPERATORS_MERGE_HPP
-
-namespace rxcpp
-{
-
- namespace detail{
- template<size_t Index, size_t SourcesSize, class SubscribeState>
- struct MergeSubscriber {
- typedef typename SubscribeState::result_type Item;
- typedef std::shared_ptr<Observer<typename SubscribeState::result_type>> ResultObserver;
- static void subscribe(
- ComposableDisposable& cd,
- const std::shared_ptr<Observer<typename SubscribeState::result_type>>& observer,
- const std::shared_ptr<SubscribeState>& state,
- const typename SubscribeState::Sources& sources) {
- cd.Add(Subscribe(
- std::get<Index>(sources),
- // on next
- [=](const Item& element)
- {
- observer->OnNext(element);
- },
- // on completed
- [=]
- {
- if (--state->pendingComplete == 0) {
- observer->OnCompleted();
- cd.Dispose();
- }
- },
- // on error
- [=](const std::exception_ptr& error)
- {
- observer->OnError(error);
- cd.Dispose();
- }));
- MergeSubscriber<Index + 1, SourcesSize, SubscribeState>::
- subscribe(cd, observer, state, sources);
- }
- };
- template<size_t SourcesSize, class SubscribeState>
- struct MergeSubscriber<SourcesSize, SourcesSize, SubscribeState> {
- static void subscribe(
- ComposableDisposable& ,
- const std::shared_ptr<Observer<typename SubscribeState::result_type>>& ,
- const std::shared_ptr<SubscribeState>& ,
- const typename SubscribeState::Sources& ) {}
- };
- }
-#if RXCPP_USE_VARIADIC_TEMPLATES
- template <class MergeSource, class... MergeSourceNext>
- std::shared_ptr<Observable<MergeSource>> Merge(
- const std::shared_ptr<Observable<MergeSource>>& firstSource,
- const std::shared_ptr<Observable<MergeSourceNext>>&... otherSource
- )
- {
- typedef MergeSource result_type;
- typedef decltype(std::make_tuple(firstSource, otherSource...)) Sources;
- struct State
- : std::enable_shared_from_this<State>
- {
- typedef Sources Sources;
- typedef result_type result_type;
- typedef std::tuple_size<Sources> SourcesSize;
- State()
- : pendingComplete(SourcesSize::value)
- {}
- std::atomic<size_t> pendingComplete;
- };
- Sources sources(firstSource, otherSource...);
- return CreateObservable<result_type>(
- [=](std::shared_ptr<Observer<result_type>> observer) -> Disposable
- {
- // bug on osx prevents using make_shared
- std::shared_ptr<State> state(new State());
- ComposableDisposable cd;
- detail::MergeSubscriber<0, State::SourcesSize::value, State>::subscribe(cd, observer, state, sources);
- return cd;
- });
- }
-#else
- template <class MergeSource, class MergeSourceNext>
- std::shared_ptr<Observable<MergeSource>> Merge(
- const std::shared_ptr<Observable<MergeSource>>& firstSource,
- const std::shared_ptr<Observable<MergeSourceNext>>& otherSource
- )
- {
- typedef MergeSource result_type;
- typedef decltype(std::make_tuple(firstSource, otherSource)) Sources;
- struct State
- : std::enable_shared_from_this<State>
- {
- typedef Sources Sources;
- typedef result_type result_type;
- typedef std::tuple_size<Sources> SourcesSize;
- State()
- : pendingComplete(SourcesSize::value)
- {}
- std::atomic<size_t> pendingComplete;
- };
- Sources sources(firstSource, otherSource);
- return CreateObservable<result_type>(
- [=](std::shared_ptr<Observer<result_type>> observer) -> Disposable
- {
- // bug on osx prevents using make_shared
- std::shared_ptr<State> state(new State());
- ComposableDisposable cd;
- detail::MergeSubscriber<0, State::SourcesSize::value, State>::subscribe(cd, observer, state, sources);
- return cd;
- });
- }
-#endif //RXCPP_USE_VARIADIC_TEMPLATES
-}
-
-#endif \ No newline at end of file
diff --git a/Rx/CPP/src/cpprx/operators/Multicast.hpp b/Rx/CPP/src/cpprx/operators/Multicast.hpp
deleted file mode 100644
index e3d9c75..0000000
--- a/Rx/CPP/src/cpprx/operators/Multicast.hpp
+++ /dev/null
@@ -1,20 +0,0 @@
- // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-#pragma once
-#include "../rx-operators.hpp"
-
-#if !defined(CPPRX_RX_OPERATORS_MULTICAST_HPP)
-#define CPPRX_RX_OPERATORS_MULTICAST_HPP
-
-namespace rxcpp
-{
-
- template <class T, class MulticastSubject>
- std::shared_ptr<ConnectableObservable<T>> Multicast(const std::shared_ptr < Observable < T >> &source, const std::shared_ptr<MulticastSubject>& multicastSubject)
- {
- return std::static_pointer_cast<ConnectableObservable<T>>(
- std::make_shared < ConnectableSubject < std::shared_ptr < Observable < T >> , std::shared_ptr<MulticastSubject> >> (source, multicastSubject));
- }
-}
-
-#endif \ No newline at end of file
diff --git a/Rx/CPP/src/cpprx/operators/Never.hpp b/Rx/CPP/src/cpprx/operators/Never.hpp
deleted file mode 100644
index ffdd831..0000000
--- a/Rx/CPP/src/cpprx/operators/Never.hpp
+++ /dev/null
@@ -1,22 +0,0 @@
- // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-#pragma once
-#include "../rx-operators.hpp"
-
-#if !defined(CPPRX_RX_OPERATORS_NEVER_HPP)
-#define CPPRX_RX_OPERATORS_NEVER_HPP
-
-namespace rxcpp
-{
- template <class T>
- std::shared_ptr<Observable<T>> Never()
- {
- return CreateObservable<T>(
- [=](std::shared_ptr<Observer<T>>) -> Disposable
- {
- return Disposable::Empty();
- });
- }
-}
-
-#endif
diff --git a/Rx/CPP/src/cpprx/operators/ObserveOnObserver.hpp b/Rx/CPP/src/cpprx/operators/ObserveOnObserver.hpp
deleted file mode 100644
index 4ff79f7..0000000
--- a/Rx/CPP/src/cpprx/operators/ObserveOnObserver.hpp
+++ /dev/null
@@ -1,53 +0,0 @@
- // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-#pragma once
-#include "../rx-operators.hpp"
-
-#if !defined(CPPRX_RX_OPERATORS_OBSERVEONOBSERVER_HPP)
-#define CPPRX_RX_OPERATORS_OBSERVEONOBSERVER_HPP
-
-namespace rxcpp
-{
-
- template <class T>
- std::shared_ptr<Observable<T>> ObserveOnObserver(
- const std::shared_ptr<Observable<T>>& source,
- Scheduler::shared scheduler)
- {
- return CreateObservable<T>(
- [=](std::shared_ptr<Observer<T>> observerArg)
- -> Disposable
- {
- std::shared_ptr<ScheduledObserver<T>> observer(
- new ScheduledObserver<T>(scheduler, std::move(observerArg)));
-
- ComposableDisposable cd;
-
- cd.Add(*observer.get());
-
- cd.Add(Subscribe(
- source,
- // on next
- [=](const T& element)
- {
- observer->OnNext(std::move(element));
- observer->EnsureActive();
- },
- // on completed
- [=]
- {
- observer->OnCompleted();
- observer->EnsureActive();
- },
- // on error
- [=](const std::exception_ptr& error)
- {
- observer->OnError(std::move(error));
- observer->EnsureActive();
- }));
- return cd;
- });
- }
-}
-
-#endif \ No newline at end of file
diff --git a/Rx/CPP/src/cpprx/operators/Publish.hpp b/Rx/CPP/src/cpprx/operators/Publish.hpp
deleted file mode 100644
index fe2fb15..0000000
--- a/Rx/CPP/src/cpprx/operators/Publish.hpp
+++ /dev/null
@@ -1,34 +0,0 @@
- // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-#pragma once
-#include "../rx-operators.hpp"
-
-#if !defined(CPPRX_RX_OPERATORS_PUBLISH_HPP)
-#define CPPRX_RX_OPERATORS_PUBLISH_HPP
-
-namespace rxcpp
-{
-
- template <class T>
- std::shared_ptr<ConnectableObservable<T>> Publish(const std::shared_ptr < Observable < T >> &source)
- {
- auto multicastSubject = std::make_shared<Subject<T>>();
- return Multicast(source, multicastSubject);
- }
-
- template <class T, class V>
- std::shared_ptr<ConnectableObservable<T>> Publish(const std::shared_ptr < Observable < T >> &source, V value)
- {
- auto multicastSubject = std::make_shared<BehaviorSubject<T>>(value);
- return Multicast(source, multicastSubject);
- }
-
- template <class T>
- std::shared_ptr<ConnectableObservable<T>> PublishLast(const std::shared_ptr < Observable < T >> &source)
- {
- auto multicastSubject = std::make_shared<AsyncSubject<T>>();
- return Multicast(source, multicastSubject);
- }
-}
-
-#endif \ No newline at end of file
diff --git a/Rx/CPP/src/cpprx/operators/Random.hpp b/Rx/CPP/src/cpprx/operators/Random.hpp
deleted file mode 100644
index 741acb8..0000000
--- a/Rx/CPP/src/cpprx/operators/Random.hpp
+++ /dev/null
@@ -1,70 +0,0 @@
- // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-#pragma once
-#include "../rx-operators.hpp"
-
-#if !defined(CPPRX_RX_OPERATORS_RANDOM_HPP)
-#define CPPRX_RX_OPERATORS_RANDOM_HPP
-
-namespace rxcpp
-{
-
- //
- // std::mt19937 twister;
- // std::uniform_int_distribution<int> xDistribution(0, xExtent - 1);
- // auto xSource = Random(twister, xDistribution, [](std::mt19937& e){
- // e.seed(std::random_device()());
- // });
- //
- template<typename Engine, typename Distribution, typename Seeder>
- std::shared_ptr<Observable<typename Distribution::result_type>> Random(
- Engine e,
- Distribution d,
- Seeder s,
- Scheduler::shared scheduler = nullptr)
- {
- typedef typename Distribution::result_type T;
- if (!scheduler) {scheduler = std::make_shared<CurrentThreadScheduler>();}
- return CreateObservable<T>(
- [=](std::shared_ptr<Observer<T>> observer) -> Disposable
- {
- struct State
- {
- bool cancel;
- Engine e;
- Distribution d;
- T step()
- {
- return d(e);
- }
- };
- auto state = std::make_shared<State>();
- state->cancel = false;
- state->e = e;
- state->d = d;
-
- // allow the seed to be set
- s(state->e);
-
- ComposableDisposable cd;
-
- cd.Add(Disposable([=]{
- state->cancel = true;
- }));
-
- cd.Add(scheduler->Schedule(
- fix0([=](Scheduler::shared s, std::function<Disposable(Scheduler::shared)> self) -> Disposable
- {
- if (state->cancel)
- return Disposable::Empty();
-
- observer->OnNext(state->step());
- return s->Schedule(std::move(self));
- })));
-
- return cd;
- });
- }
-}
-
-#endif \ No newline at end of file
diff --git a/Rx/CPP/src/cpprx/operators/Range.hpp b/Rx/CPP/src/cpprx/operators/Range.hpp
deleted file mode 100644
index 2e346cc..0000000
--- a/Rx/CPP/src/cpprx/operators/Range.hpp
+++ /dev/null
@@ -1,65 +0,0 @@
- // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-#pragma once
-#include "../rx-operators.hpp"
-
-#if !defined(CPPRX_RX_OPERATORS_RANGE_HPP)
-#define CPPRX_RX_OPERATORS_RANGE_HPP
-
-namespace rxcpp
-{
-
-
- template <class Integral>
- auto Range(
- Integral start, Integral end = std::numeric_limits<Integral>::max(), Integral step = 1,
- Scheduler::shared scheduler = nullptr)
- -> std::shared_ptr<Observable<Integral>>
- {
- if (!scheduler) {scheduler = std::make_shared<CurrentThreadScheduler>();}
- return CreateObservable<Integral>(
- [=](std::shared_ptr<Observer<Integral>> observer) -> Disposable
- {
- struct State
- {
- bool cancel;
- Integral i;
- Integral rem;
- };
- auto state = std::make_shared<State>();
- state->cancel = false;
- state->i = start;
- state->rem = ((end - start) + step) / step;
-
- ComposableDisposable cd;
-
- cd.Add(Disposable([=]{
- state->cancel = true;
- }));
-
- cd.Add(scheduler->Schedule(
- fix0([=](Scheduler::shared s, std::function<Disposable(Scheduler::shared)> self) -> Disposable
- {
- if (state->cancel)
- return Disposable::Empty();
-
- if (!state->rem)
- {
- observer->OnCompleted();
- }
- else
- {
- observer->OnNext(state->i);
- --state->rem;
- state->i += step;
- return s->Schedule(std::move(self));
- }
- return Disposable::Empty();
- })));
-
- return cd;
- });
- }
-}
-
-#endif
diff --git a/Rx/CPP/src/cpprx/operators/RefCount.hpp b/Rx/CPP/src/cpprx/operators/RefCount.hpp
deleted file mode 100644
index 9638ca1..0000000
--- a/Rx/CPP/src/cpprx/operators/RefCount.hpp
+++ /dev/null
@@ -1,102 +0,0 @@
- // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-#pragma once
-#include "../rx-operators.hpp"
-
-#if !defined(CPPRX_RX_OPERATORS_REFCOUNT_HPP)
-#define CPPRX_RX_OPERATORS_REFCOUNT_HPP
-
-namespace rxcpp
-{
-
- namespace detail
- {
- template<class T>
- class RefCountObservable : public Producer<RefCountObservable<T>, T>
- {
- std::shared_ptr<ConnectableObservable<T>> source;
- std::mutex lock;
- size_t refcount;
- util::maybe<Disposable> subscription;
-
- class _ : public Sink<_, T>, public Observer<T>
- {
- std::shared_ptr<RefCountObservable<T>> parent;
-
- public:
- typedef Sink<_, T> SinkBase;
-
- _(std::shared_ptr<RefCountObservable<T>> parent, std::shared_ptr<Observer<T>> observer, Disposable cancel) :
- SinkBase(std::move(observer), std::move(cancel)),
- parent(parent)
- {
- }
-
- Disposable Run()
- {
- SerialDisposable subscription;
- subscription.Set(parent->source->Subscribe(this->shared_from_this()));
-
- std::unique_lock<std::mutex> guard(parent->lock);
- if (++parent->refcount == 1)
- {
- parent->subscription.set(parent->source->Connect());
- }
-
- auto local = parent;
-
- return Disposable([subscription, local]()
- {
- subscription.Dispose();
- std::unique_lock<std::mutex> guard(local->lock);
- if (--local->refcount == 0)
- {
- local->subscription->Dispose();
- local->subscription.reset();
- }
- });
- }
-
- virtual void OnNext(const T& t)
- {
- SinkBase::observer->OnNext(t);
- }
- virtual void OnCompleted()
- {
- SinkBase::observer->OnCompleted();
- SinkBase::Dispose();
- }
- virtual void OnError(const std::exception_ptr& e)
- {
- SinkBase::observer->OnError(e);
- SinkBase::Dispose();
- }
- };
-
- typedef Producer<RefCountObservable<T>, T> ProducerBase;
- public:
-
- RefCountObservable(std::shared_ptr<ConnectableObservable<T>> source) :
- ProducerBase([](std::shared_ptr<RefCountObservable<T>> that, std::shared_ptr<Observer<T>> observer, Disposable&& cancel, typename ProducerBase::SetSink setSink) -> Disposable
- {
- auto sink = std::shared_ptr<RefCountObservable::_>(new RefCountObservable::_(that, observer, std::move(cancel)));
- setSink(sink->GetDisposable());
- return sink->Run();
- }),
- source(std::move(source)),
- refcount(0)
- {
- subscription.set(Disposable::Empty());
- }
- };
- }
- template <class T>
- const std::shared_ptr<Observable<T>> RefCount(
- const std::shared_ptr<ConnectableObservable<T>>& source
- )
- {
- return std::make_shared<detail::RefCountObservable<T>>(source);
- }
-}
-
-#endif
diff --git a/Rx/CPP/src/cpprx/operators/Return.hpp b/Rx/CPP/src/cpprx/operators/Return.hpp
deleted file mode 100644
index da3b49b..0000000
--- a/Rx/CPP/src/cpprx/operators/Return.hpp
+++ /dev/null
@@ -1,78 +0,0 @@
- // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-#pragma once
-#include "../rx-operators.hpp"
-
-#if !defined(CPPRX_RX_OPERATORS_RETURN_HPP)
-#define CPPRX_RX_OPERATORS_RETURN_HPP
-
-namespace rxcpp
-{
-
- namespace detail
- {
- template<class T>
- class ReturnObservable : public Producer<ReturnObservable<T>, T>
- {
- typedef std::shared_ptr<ReturnObservable<T>> Parent;
- T value;
- Scheduler::shared scheduler;
-
- class _ : public Sink<_, T>
- {
- Parent parent;
-
- public:
- typedef Sink<_, T> SinkBase;
-
- _(Parent parent, std::shared_ptr < Observer < T >> observer, Disposable cancel) :
- SinkBase(std::move(observer), std::move(cancel)),
- parent(parent)
- {
- }
-
- Disposable Run()
- {
- auto local = parent;
- auto that = this->shared_from_this();
- return parent->scheduler->Schedule(
- [=](Scheduler::shared) -> Disposable {
- that->SinkBase::observer->OnNext(local->value);
- that->SinkBase::observer->OnCompleted();
- that->SinkBase::Dispose();
- return Disposable::Empty();
- });
- }
- };
-
- typedef Producer<ReturnObservable<T>, T> ProducerBase;
- public:
-
- ReturnObservable(T value, Scheduler::shared scheduler) :
- ProducerBase([](Parent parent, std::shared_ptr < Observer < T >> observer, Disposable && cancel, typename ProducerBase::SetSink setSink) -> Disposable
- {
- auto sink = std::shared_ptr<ReturnObservable::_>(new ReturnObservable::_(parent, observer, std::move(cancel)));
- setSink(sink->GetDisposable());
- return sink->Run();
- }),
- value(value),
- scheduler(scheduler)
- {
- if (!scheduler)
- {
- this->scheduler = std::make_shared<ImmediateScheduler>();
- }
- }
- };
- }
- template <class T>
- std::shared_ptr<Observable<T>> Return(
- T value,
- Scheduler::shared scheduler = nullptr
- )
- {
- return std::make_shared<detail::ReturnObservable<T>>(std::move(value), std::move(scheduler));
- }
-}
-
-#endif \ No newline at end of file
diff --git a/Rx/CPP/src/cpprx/operators/Scan.hpp b/Rx/CPP/src/cpprx/operators/Scan.hpp
deleted file mode 100644
index fa3b00c..0000000
--- a/Rx/CPP/src/cpprx/operators/Scan.hpp
+++ /dev/null
@@ -1,127 +0,0 @@
- // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-#pragma once
-#include "../rx-operators.hpp"
-
-#if !defined(CPPRX_RX_OPERATORS_SCAN_HPP)
-#define CPPRX_RX_OPERATORS_SCAN_HPP
-
-namespace rxcpp
-{
- namespace detail
- {
- template<class T, class A>
- class ScanObservable : public Producer<ScanObservable<T, A>, A>
- {
- typedef ScanObservable<T, A> This;
- typedef std::shared_ptr<This> Parent;
- typedef std::shared_ptr<Observable<T>> Source;
- typedef std::shared_ptr<Observer<A>> Destination;
-
- public:
- typedef std::function<A(A, T)> Accumulator;
- typedef std::function<util::maybe<A>(T)> Seeder;
-
- private:
-
- Source source;
- util::maybe<A> seed;
- Accumulator accumulator;
- Seeder seeder;
-
- class _ : public Sink<_, A>, public Observer<T>
- {
- Parent parent;
- util::maybe<A> accumulation;
-
- public:
- typedef Sink<_, A> SinkBase;
-
- _(Parent parent, Destination observer, Disposable cancel) :
- SinkBase(std::move(observer), std::move(cancel)),
- parent(parent)
- {
- }
-
- virtual void OnNext(const T& t)
- {
- try
- {
- if (accumulation)
- {
- accumulation.set(parent->accumulator(*accumulation.get(), t));
- }
- else
- {
- accumulation.set(!!parent->seed ? parent->accumulator(*parent->seed.get(), t) : *parent->seeder(t).get());
- }
- }
- catch (...)
- {
- SinkBase::observer->OnError(std::current_exception());
- SinkBase::Dispose();
- return;
- }
- SinkBase::observer->OnNext(*accumulation.get());
- }
- virtual void OnCompleted()
- {
- if (!accumulation && !!parent->seed) {
- SinkBase::observer->OnNext(*parent->seed.get());
- }
- SinkBase::observer->OnCompleted();
- SinkBase::Dispose();
- }
- virtual void OnError(const std::exception_ptr& e)
- {
- SinkBase::observer->OnError(e);
- SinkBase::Dispose();
- }
- };
-
- typedef Producer<This, A> ProducerBase;
- public:
-
- ScanObservable(Source source, util::maybe<A> seed, Accumulator accumulator, Seeder seeder) :
- ProducerBase([this](Parent parent, std::shared_ptr < Observer < A >> observer, Disposable && cancel, typename ProducerBase::SetSink setSink) -> Disposable
- {
- auto sink = std::shared_ptr<ScanObservable::_>(new ScanObservable::_(parent, observer, std::move(cancel)));
- setSink(sink->GetDisposable());
- return this->source->Subscribe(sink);
- }),
- source(std::move(source)),
- seed(std::move(seed)),
- accumulator(std::move(accumulator)),
- seeder(std::move(seeder))
- {
- }
- };
- }
- template <class T, class A>
- std::shared_ptr<Observable<A>> Scan(
- const std::shared_ptr<Observable<T>>& source,
- A seed,
- typename detail::ScanObservable<T, A>::Accumulator accumulator
- )
- {
- return std::make_shared<detail::ScanObservable<T, A>>(
- std::move(source),
- util::maybe<A>(std::move(seed)),
- std::move(accumulator),
- [](T) -> util::maybe<A> {abort(); return util::maybe<A>();});
- }
- template <class T>
- std::shared_ptr<Observable<T>> Scan(
- const std::shared_ptr<Observable<T>>& source,
- typename detail::ScanObservable<T, T>::Accumulator accumulator
- )
- {
- return std::make_shared<detail::ScanObservable<T, T>>(
- std::move(source),
- util::maybe<T>(),
- std::move(accumulator),
- [](T t) -> util::maybe<T> {return util::maybe<T>(t);});
- }
-}
-
-#endif \ No newline at end of file
diff --git a/Rx/CPP/src/cpprx/operators/Select.hpp b/Rx/CPP/src/cpprx/operators/Select.hpp
deleted file mode 100644
index 608d911..0000000
--- a/Rx/CPP/src/cpprx/operators/Select.hpp
+++ /dev/null
@@ -1,89 +0,0 @@
- // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-#pragma once
-#include "../rx-operators.hpp"
-
-#if !defined(CPPRX_RX_OPERATORS_SELECT_HPP)
-#define CPPRX_RX_OPERATORS_SELECT_HPP
-
-namespace rxcpp
-{
-
- namespace detail
- {
- template<class Tin, class Tout>
- class SelectObservable : public Producer<SelectObservable<Tin, Tout>, Tout>
- {
- typedef SelectObservable<Tin, Tout> Self;
- typedef std::shared_ptr<Self> Parent;
- typedef std::function<Tout(Tin)> Selector;
-
- std::shared_ptr<Observable<Tin>> source;
- Selector selector;
-
- class _ : public Sink<_, Tout>, public Observer<Tin>
- {
- Parent parent;
-
- public:
- typedef Sink<_, Tout> SinkBase;
-
- _(Parent parent, std::shared_ptr < Observer < Tout >> observer, Disposable cancel) :
- SinkBase(std::move(observer), std::move(cancel)),
- parent(parent)
- {
- }
-
- virtual void OnNext(const Tin& t)
- {
- util::maybe<Tout> result;
- try {
- result.set(parent->selector(t));
- } catch (...) {
- SinkBase::observer->OnError(std::current_exception());
- SinkBase::Dispose();
- }
- if (!!result) {
- SinkBase::observer->OnNext(*result.get());
- }
- }
- virtual void OnCompleted()
- {
- SinkBase::observer->OnCompleted();
- SinkBase::Dispose();
- }
- virtual void OnError(const std::exception_ptr& e)
- {
- SinkBase::observer->OnError(e);
- SinkBase::Dispose();
- }
- };
-
- typedef Producer<Self, Tout> ProducerBase;
- public:
-
- SelectObservable(const std::shared_ptr<Observable<Tin>>& source, Selector selector) :
- ProducerBase([this](Parent parent, std::shared_ptr < Observer < Tout >> observer, Disposable && cancel, typename ProducerBase::SetSink setSink) -> Disposable
- {
- auto sink = std::shared_ptr<Self::_>(new Self::_(parent, observer, std::move(cancel)));
- setSink(sink->GetDisposable());
- return this->source->Subscribe(sink);
- }),
- source(source),
- selector(std::move(selector))
- {
- }
- };
- }
- template <class Tin, class S>
- auto Select(
- const std::shared_ptr<Observable<Tin>>& source,
- S selector
- ) -> const std::shared_ptr<Observable<typename std::result_of<S(const Tin&)>::type>>
- {
- typedef typename std::result_of<S(const Tin&)>::type Tout;
- return std::make_shared<detail::SelectObservable<Tin, Tout>>(source, std::move(selector));
- }
-}
-
-#endif
diff --git a/Rx/CPP/src/cpprx/operators/SelectMany.hpp b/Rx/CPP/src/cpprx/operators/SelectMany.hpp
deleted file mode 100644
index e282ced..0000000
--- a/Rx/CPP/src/cpprx/operators/SelectMany.hpp
+++ /dev/null
@@ -1,118 +0,0 @@
- // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-#pragma once
-#include "../rx-operators.hpp"
-
-#if !defined(CPPRX_RX_OPERATORS_SELECTMANY_HPP)
-#define CPPRX_RX_OPERATORS_SELECTMANY_HPP
-
-namespace rxcpp
-{
-
- template <class T, class CS, class RS>
- auto SelectMany(
- const std::shared_ptr<Observable<T>>& source,
- CS collectionSelector,
- RS resultSelector)
- -> const std::shared_ptr<Observable<
- typename std::result_of<RS(const T&,
- const typename observable_item<
- typename std::result_of<CS(const T&)>::type>::type&)>::type>>
- {
- typedef typename std::decay<typename std::result_of<CS(const T&)>::type>::type C;
- typedef typename observable_item<C>::type CI;
- typedef typename std::result_of<RS(const T&, const CI&)>::type U;
-
- return CreateObservable<U>(
- [=](std::shared_ptr<Observer<U>> observer)
- -> Disposable
- {
- struct State {
- std::atomic<int> count;
- std::mutex lock;
- ComposableDisposable group;
- };
- auto state = std::make_shared<State>();
- state->count = 0;
-
- SerialDisposable sourceDisposable;
- state->group.Add(sourceDisposable);
-
- ++state->count;
- sourceDisposable.Set(Subscribe(
- source,
- // on next
- [=](const T& sourceElement)
- {
- util::maybe<C> collection;
- try {
- collection.set(collectionSelector(sourceElement));
- } catch(...) {
- std::unique_lock<std::mutex> guard(state->lock);
- observer->OnError(std::current_exception());
- state->group.Dispose();
- return;
- }
-
- SerialDisposable inner;
- state->group.Add(inner);
-
- ++state->count;
- inner.Set(Subscribe(
- *collection.get(),
- // on next
- [=](const CI& collectionElement)
- {
- util::maybe<U> result;
- try {
- result.set(resultSelector(sourceElement, collectionElement));
- } catch(...) {
- std::unique_lock<std::mutex> guard(state->lock);
- observer->OnError(std::current_exception());
- state->group.Dispose();
- }
- std::unique_lock<std::mutex> guard(state->lock);
- observer->OnNext(std::move(*result.get()));
- },
- // on completed
- [=]
- {
- inner.Dispose();
- if (0 == --state->count) {
- std::unique_lock<std::mutex> guard(state->lock);
- observer->OnCompleted();
- state->group.Dispose();
- }
- },
- // on error
- [=](const std::exception_ptr& error)
- {
- std::unique_lock<std::mutex> guard(state->lock);
- observer->OnError(error);
- state->group.Dispose();
- }));
- },
- // on completed
- [=]
- {
- if (0 == --state->count) {
- std::unique_lock<std::mutex> guard(state->lock);
- observer->OnCompleted();
- state->group.Dispose();
- } else {
- sourceDisposable.Dispose();
- }
- },
- // on error
- [=](const std::exception_ptr& error)
- {
- std::unique_lock<std::mutex> guard(state->lock);
- observer->OnError(error);
- state->group.Dispose();
- }));
- return state->group;
- });
- }
-}
-
-#endif
diff --git a/Rx/CPP/src/cpprx/operators/Skip.hpp b/Rx/CPP/src/cpprx/operators/Skip.hpp
deleted file mode 100644
index e635b71..0000000
--- a/Rx/CPP/src/cpprx/operators/Skip.hpp
+++ /dev/null
@@ -1,132 +0,0 @@
- // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-#pragma once
-#include "../rx-operators.hpp"
-
-#if !defined(CPPRX_RX_OPERATORS_SKIP_HPP)
-#define CPPRX_RX_OPERATORS_SKIP_HPP
-
-namespace rxcpp
-{
-
- template <class T, class Integral>
- std::shared_ptr<Observable<T>> Skip(
- const std::shared_ptr<Observable<T>>& source,
- Integral n
- )
- {
- return CreateObservable<T>(
- [=](std::shared_ptr<Observer<T>> observer)
- -> Disposable
- {
- struct State {
- enum type {
- Skipping,
- Forwarding
- };
- };
- // keep count of remaining OnNext calls to skip and state.
- auto remaining = std::make_shared<std::tuple<std::atomic<Integral>, std::atomic<typename State::type>>>(n, State::Skipping);
-
- ComposableDisposable cd;
-
- cd.Add(Subscribe(
- source,
- // on next
- [=](const T& element)
- {
- if (std::get<1>(*remaining) == State::Forwarding) {
- observer->OnNext(element);
- } else {
- auto local = --std::get<0>(*remaining);
-
- if (local == 0) {
- std::get<1>(*remaining) = State::Forwarding;
- }
- }
- },
- // on completed
- [=]
- {
- observer->OnCompleted();
- cd.Dispose();
- },
- // on error
- [=](const std::exception_ptr& error)
- {
- observer->OnError(error);
- cd.Dispose();
- }));
- return cd;
- });
- }
-
- template <class T, class U>
- std::shared_ptr<Observable<T>> SkipUntil(
- const std::shared_ptr<Observable<T>>& source,
- const std::shared_ptr<Observable<U>>& terminus
- )
- {
- return CreateObservable<T>(
- [=](std::shared_ptr<Observer<T>> observer)
- -> Disposable
- {
- struct SkipState {
- enum type {
- Skipping,
- Taking
- };
- };
- struct State {
- State() : skipState(SkipState::Skipping) {}
- std::atomic<typename SkipState::type> skipState;
- };
- auto state = std::make_shared<State>();
-
- ComposableDisposable cd;
-
- cd.Add(Subscribe(
- terminus,
- // on next
- [=](const U& element)
- {
- state->skipState = SkipState::Taking;
- },
- // on completed
- [=]
- {
- state->skipState = SkipState::Taking;
- },
- // on error
- [=](const std::exception_ptr& error)
- {
- state->skipState = SkipState::Taking;
- }));
-
- cd.Add(Subscribe(
- source,
- // on next
- [=](const T& element)
- {
- if (state->skipState == SkipState::Taking) {
- observer->OnNext(element);
- }
- },
- // on completed
- [=]
- {
- observer->OnCompleted();
- cd.Dispose();
- },
- // on error
- [=](const std::exception_ptr& error)
- {
- observer->OnError(error);
- cd.Dispose();
- }));
- return cd;
- });
- }
-}
-
-#endif \ No newline at end of file
diff --git a/Rx/CPP/src/cpprx/operators/Subscribe.hpp b/Rx/CPP/src/cpprx/operators/Subscribe.hpp
deleted file mode 100644
index 5717720..0000000
--- a/Rx/CPP/src/cpprx/operators/Subscribe.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
- // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-#pragma once
-#include "../rx-operators.hpp"
-
-#if !defined(CPPRX_RX_OPERATORS_SUBSCRIBE_HPP)
-#define CPPRX_RX_OPERATORS_SUBSCRIBE_HPP
-
-namespace rxcpp
-{
-
- template <class S>
- Disposable Subscribe(
- const S& source,
- typename util::identity<std::function<void(const typename observable_item<S>::type&)>>::type onNext,
- std::function<void()> onCompleted = nullptr,
- std::function<void(const std::exception_ptr&)> onError = nullptr
- )
- {
- auto observer = CreateObserver<typename observable_item<S>::type>(
- std::move(onNext), std::move(onCompleted), std::move(onError));
-
- return source->Subscribe(observer);
- }
-}
-
-#endif \ No newline at end of file
diff --git a/Rx/CPP/src/cpprx/operators/SubscribeOnObservable.hpp b/Rx/CPP/src/cpprx/operators/SubscribeOnObservable.hpp
deleted file mode 100644
index 29a4c6b..0000000
--- a/Rx/CPP/src/cpprx/operators/SubscribeOnObservable.hpp
+++ /dev/null
@@ -1,35 +0,0 @@
- // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-#pragma once
-#include "../rx-operators.hpp"
-
-#if !defined(CPPRX_RX_OPERATORS_SUBSCRIBEONOBSERVABLE_HPP)
-#define CPPRX_RX_OPERATORS_SUBSCRIBEONOBSERVABLE_HPP
-
-namespace rxcpp
-{
-
- template <class T>
- std::shared_ptr<Observable<T>> SubscribeOnObservable(
- const std::shared_ptr<Observable<T>>& source,
- Scheduler::shared scheduler)
- {
- return CreateObservable<T>(
- [=](std::shared_ptr<Observer<T>> observer)
- -> Disposable
- {
- ComposableDisposable cd;
-
- SerialDisposable sd;
- cd.Add(sd);
-
- cd.Add(scheduler->Schedule([=](Scheduler::shared) -> Disposable {
- sd.Set(ScheduledDisposable(scheduler, source->Subscribe(observer)));
- return Disposable::Empty();
- }));
- return cd;
- });
- }
-}
-
-#endif \ No newline at end of file
diff --git a/Rx/CPP/src/cpprx/operators/Take.hpp b/Rx/CPP/src/cpprx/operators/Take.hpp
deleted file mode 100644
index 20187d4..0000000
--- a/Rx/CPP/src/cpprx/operators/Take.hpp
+++ /dev/null
@@ -1,173 +0,0 @@
- // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-#pragma once
-#include "../rx-operators.hpp"
-
-#if !defined(CPPRX_RX_OPERATORS_TAKE_HPP)
-#define CPPRX_RX_OPERATORS_TAKE_HPP
-
-namespace rxcpp
-{
-
- namespace detail
- {
- template<class T, class Integral>
- class TakeObservable : public Producer<TakeObservable<T, Integral>, T>
- {
- typedef std::shared_ptr<TakeObservable<T, Integral>> Parent;
-
- std::shared_ptr<Observable<T>> source;
- Integral count;
-
- class _ : public Sink<_, T>, public Observer<T>
- {
- Parent parent;
- Integral remaining;
-
- public:
- typedef Sink<_, T> SinkBase;
-
- _(Parent parent, std::shared_ptr < Observer < T >> observer, Disposable cancel) :
- SinkBase(std::move(observer), std::move(cancel)),
- parent(parent),
- remaining(parent->count)
- {
- }
-
- virtual void OnNext(const T& t)
- {
- if (remaining > 0)
- {
- --remaining;
- SinkBase::observer->OnNext(t);
-
- if (remaining == 0)
- {
- SinkBase::observer->OnCompleted();
- SinkBase::Dispose();
- }
- }
- }
- virtual void OnCompleted()
- {
- SinkBase::observer->OnCompleted();
- SinkBase::Dispose();
- }
- virtual void OnError(const std::exception_ptr& e)
- {
- SinkBase::observer->OnError(e);
- SinkBase::Dispose();
- }
- };
-
- typedef Producer<TakeObservable<T, Integral>, T> ProducerBase;
- public:
-
- TakeObservable(const std::shared_ptr<Observable<T>>& source, Integral count) :
- ProducerBase([this](Parent parent, std::shared_ptr < Observer < T >> observer, Disposable && cancel, typename ProducerBase::SetSink setSink) -> Disposable
- {
- auto sink = std::shared_ptr<_>(new _(parent, observer, std::move(cancel)));
- setSink(sink->GetDisposable());
- return this->source->Subscribe(sink);
- }),
- source(source),
- count(count)
- {
- }
- };
- }
- template <class T, class Integral>
- std::shared_ptr<Observable<T>> Take(
- const std::shared_ptr<Observable<T>>& source,
- Integral n
- )
- {
- return std::make_shared<detail::TakeObservable<T, Integral>>(source, n);
- }
-
-
- template <class T, class U>
- std::shared_ptr<Observable<T>> TakeUntil(
- const std::shared_ptr<Observable<T>>& source,
- const std::shared_ptr<Observable<U>>& terminus
- )
- {
- return CreateObservable<T>(
- [=](std::shared_ptr<Observer<T>> observer)
- -> Disposable
- {
-
- struct TerminusState {
- enum type {
- Live,
- Terminated
- };
- };
- struct TakeState {
- enum type {
- Taking,
- Completed
- };
- };
- struct State {
- State() : terminusState(TerminusState::Live), takeState(TakeState::Taking) {}
- std::atomic<typename TerminusState::type> terminusState;
- std::atomic<typename TakeState::type> takeState;
- };
- auto state = std::make_shared<State>();
-
- ComposableDisposable cd;
-
- cd.Add(Subscribe(
- terminus,
- // on next
- [=](const U& )
- {
- state->terminusState = TerminusState::Terminated;
- },
- // on completed
- [=]
- {
- state->terminusState = TerminusState::Terminated;
- },
- // on error
- [=](const std::exception_ptr& )
- {
- state->terminusState = TerminusState::Terminated;
- }));
-
- cd.Add(Subscribe(
- source,
- // on next
- [=](const T& element)
- {
- if (state->terminusState == TerminusState::Live) {
- observer->OnNext(element);
- } else if (state->takeState.exchange(TakeState::Completed) == TakeState::Taking) {
- observer->OnCompleted();
- cd.Dispose();
- }
- },
- // on completed
- [=]
- {
- if (state->takeState.exchange(TakeState::Completed) == TakeState::Taking) {
- state->terminusState = TerminusState::Terminated;
- observer->OnCompleted();
- cd.Dispose();
- }
- },
- // on error
- [=](const std::exception_ptr& error)
- {
- state->takeState = TakeState::Completed;
- state->terminusState = TerminusState::Terminated;
- observer->OnError(error);
- cd.Dispose();
- }));
- return cd;
- });
- }
-}
-
-#endif
diff --git a/Rx/CPP/src/cpprx/operators/Throttle.hpp b/Rx/CPP/src/cpprx/operators/Throttle.hpp
deleted file mode 100644
index 89abdd1..0000000
--- a/Rx/CPP/src/cpprx/operators/Throttle.hpp
+++ /dev/null
@@ -1,97 +0,0 @@
- // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-#pragma once
-#include "../rx-operators.hpp"
-
-#if !defined(CPPRX_RX_OPERATORS_THROTTLE_HPP)
-#define CPPRX_RX_OPERATORS_THROTTLE_HPP
-
-namespace rxcpp
-{
-
- template <class T>
- std::shared_ptr<Observable<T>> Throttle(
- const std::shared_ptr<Observable<T>>& source,
- Scheduler::clock::duration due,
- Scheduler::shared scheduler)
- {
- return CreateObservable<T>(
- [=](std::shared_ptr<Observer<T>> observer)
- -> Disposable
- {
- struct State {
- State() : hasValue(false), id(0) {}
- std::mutex lock;
- T value;
- bool hasValue;
- size_t id;
- };
- auto state = std::make_shared<State>();
-
- ComposableDisposable cd;
-
- SerialDisposable sd;
- cd.Add(sd);
-
- cd.Add(Subscribe(
- source,
- // on next
- [=](const T& element)
- {
- size_t current = 0;
- {
- std::unique_lock<std::mutex> guard(state->lock);
- state->hasValue = true;
- state->value = std::move(element);
- current = ++state->id;
- }
- sd.Set(scheduler->Schedule(
- due,
- [=] (Scheduler::shared) -> Disposable {
- {
- std::unique_lock<std::mutex> guard(state->lock);
- if (state->hasValue && state->id == current) {
- observer->OnNext(std::move(state->value));
- }
- state->hasValue = false;
- }
-
- return Disposable::Empty();
- }
- ));
- },
- // on completed
- [=]
- {
- bool sendValue = false;
- T value;
- {
- std::unique_lock<std::mutex> guard(state->lock);
- sendValue = state->hasValue;
- if (sendValue) {
- value = std::move(state->value);}
- state->hasValue = false;
- ++state->id;
- }
- if (sendValue) {
- observer->OnNext(std::move(value));}
- observer->OnCompleted();
- cd.Dispose();
- },
- // on error
- [=](const std::exception_ptr& error)
- {
- {
- std::unique_lock<std::mutex> guard(state->lock);
- state->hasValue = false;
- ++state->id;
- }
- observer->OnError(error);
- cd.Dispose();
- }));
- return cd;
- });
- }
-}
-
-#endif \ No newline at end of file
diff --git a/Rx/CPP/src/cpprx/operators/Throw.hpp b/Rx/CPP/src/cpprx/operators/Throw.hpp
deleted file mode 100644
index 425f5eb..0000000
--- a/Rx/CPP/src/cpprx/operators/Throw.hpp
+++ /dev/null
@@ -1,104 +0,0 @@
- // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-#pragma once
-#include "../rx-operators.hpp"
-
-#if !defined(CPPRX_RX_OPERATORS_THROW_HPP)
-#define CPPRX_RX_OPERATORS_THROW_HPP
-
-namespace rxcpp
-{
-
- namespace detail
- {
- template<class T>
- class ThrowObservable : public Producer<ThrowObservable<T>, T>
- {
- typedef ThrowObservable<T> This;
- typedef std::shared_ptr<This> Parent;
-
- std::exception_ptr exception;
- Scheduler::shared scheduler;
-
- class _ : public Sink<_, T>
- {
- Parent parent;
-
- public:
- typedef Sink<_, T> SinkBase;
-
- _(Parent parent, std::shared_ptr < Observer < T >> observer, Disposable cancel) :
- SinkBase(std::move(observer), std::move(cancel)),
- parent(parent)
- {
- }
-
- Disposable Run()
- {
- auto local = parent;
- auto that = this->shared_from_this();
- return parent->scheduler->Schedule(
- [=](Scheduler::shared) -> Disposable {
- that->SinkBase::observer->OnError(local->exception);
- that->SinkBase::Dispose();
- return Disposable::Empty();
- });
- }
- };
-
- typedef Producer<This, T> ProducerBase;
- public:
-
- ThrowObservable(std::exception_ptr exception, Scheduler::shared scheduler) :
- ProducerBase([](Parent parent, std::shared_ptr < Observer < T >> observer, Disposable && cancel, typename ProducerBase::SetSink setSink) -> Disposable
- {
- auto sink = std::shared_ptr<ThrowObservable::_>(new ThrowObservable::_(parent, observer, std::move(cancel)));
- setSink(sink->GetDisposable());
- return sink->Run();
- }),
- exception(exception),
- scheduler(scheduler)
- {
- if (!scheduler)
- {
- this->scheduler = std::make_shared<CurrentThreadScheduler>();
- }
- }
- };
-
- struct throw_ptr_tag{};
- struct throw_instance_tag{};
-
- template <class T>
- std::shared_ptr<Observable<T>> make_throw(
- throw_ptr_tag&&,
- std::exception_ptr exception,
- Scheduler::shared scheduler = nullptr
- )
- {
- return std::make_shared<detail::ThrowObservable<T>>(std::move(exception), std::move(scheduler));
- }
-
- template <class T, class E>
- std::shared_ptr<Observable<T>> make_throw(
- throw_instance_tag&&,
- E e,
- Scheduler::shared scheduler = nullptr
- )
- {
- std::exception_ptr exception;
- try {throw e;} catch(...) {exception = std::current_exception();}
- return std::make_shared<detail::ThrowObservable<T>>(std::move(exception), std::move(scheduler));
- }
- }
- template <class T, class E>
- std::shared_ptr<Observable<T>> Throw(
- E e,
- Scheduler::shared scheduler = nullptr
- )
- {
- return detail::make_throw<T>(typename std::conditional<std::is_same<std::exception_ptr, typename std::decay<E>::type>::value, detail::throw_ptr_tag, detail::throw_instance_tag>::type(), std::forward<E>(e), std::move(scheduler));
- }
-}
-
-#endif
diff --git a/Rx/CPP/src/cpprx/operators/ToAsync.hpp b/Rx/CPP/src/cpprx/operators/ToAsync.hpp
deleted file mode 100644
index 33bffcb..0000000
--- a/Rx/CPP/src/cpprx/operators/ToAsync.hpp
+++ /dev/null
@@ -1,48 +0,0 @@
- // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-#pragma once
-#include "../rx-operators.hpp"
-
-#if !defined(CPPRX_RX_OPERATORS_TOASYNC_HPP)
-#define CPPRX_RX_OPERATORS_TOASYNC_HPP
-
-namespace rxcpp
-{
-
-#if RXCPP_USE_VARIADIC_TEMPLATES
- template<class... A, class F>
- auto ToAsync(F f, Scheduler::shared scheduler = nullptr)
- ->std::function < std::shared_ptr < Observable< decltype(f((*(A*)nullptr)...)) >> (const A&...)>
- {
- typedef decltype(f((*(A*) nullptr)...)) R;
- if (!scheduler)
- {
- scheduler = std::make_shared<EventLoopScheduler>();
- }
- return [=](const A&... a) -> std::shared_ptr < Observable<R >>
- {
- auto args = std::make_tuple(a...);
- auto result = CreateAsyncSubject<R>();
- scheduler->Schedule([=](Scheduler::shared) -> Disposable
- {
- util::maybe<R> value;
- try
- {
- value.set(util::tuple_dispatch(f, args));
- }
- catch (...)
- {
- result->OnError(std::current_exception());
- return Disposable::Empty();
- }
- result->OnNext(*value.get());
- result->OnCompleted();
- return Disposable::Empty();
- });
- return result;
- };
- }
-#endif
-}
-
-#endif \ No newline at end of file
diff --git a/Rx/CPP/src/cpprx/operators/ToStdCollection.hpp b/Rx/CPP/src/cpprx/operators/ToStdCollection.hpp
deleted file mode 100644
index 25813b1..0000000
--- a/Rx/CPP/src/cpprx/operators/ToStdCollection.hpp
+++ /dev/null
@@ -1,44 +0,0 @@
- // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-#pragma once
-#include "../rx-operators.hpp"
-
-#if !defined(CPPRX_RX_OPERATORS_TOSTDCOLLECTION_HPP)
-#define CPPRX_RX_OPERATORS_TOSTDCOLLECTION_HPP
-
-namespace rxcpp
-{
-
- template <class StdCollection>
- std::shared_ptr<Observable<StdCollection>> ToStdCollection(
- const std::shared_ptr<Observable<typename StdCollection::value_type>>& source
- )
- {
- typedef typename StdCollection::value_type Value;
- return CreateObservable<StdCollection>(
- [=](std::shared_ptr<Observer<StdCollection>> observer) -> Disposable
- {
- auto stdCollection = std::make_shared<StdCollection>();
- return Subscribe(
- source,
- // on next
- [=](const Value& element)
- {
- stdCollection->insert(stdCollection->end(), element);
- },
- // on completed
- [=]
- {
- observer->OnNext(std::move(*stdCollection.get()));
- observer->OnCompleted();
- },
- // on error
- [=](const std::exception_ptr& error)
- {
- observer->OnError(error);
- });
- });
- }
-}
-
-#endif \ No newline at end of file
diff --git a/Rx/CPP/src/cpprx/operators/Using.hpp b/Rx/CPP/src/cpprx/operators/Using.hpp
deleted file mode 100644
index d435d75..0000000
--- a/Rx/CPP/src/cpprx/operators/Using.hpp
+++ /dev/null
@@ -1,112 +0,0 @@
- // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-#pragma once
-#include "../rx-operators.hpp"
-
-#if !defined(CPPRX_RX_OPERATORS_USING_HPP)
-#define CPPRX_RX_OPERATORS_USING_HPP
-
-namespace rxcpp
-{
-
- namespace detail
- {
- template<class T, class R, class ScopedObservable>
- class UsingObservable : public Producer<UsingObservable<T, R, ScopedObservable>, T>
- {
- typedef UsingObservable<T, R, ScopedObservable> This;
- typedef std::shared_ptr<This> Parent;
- typedef typename std::decay<ScopedObservable>::type Source;
-
- public:
- typedef std::function<R()> ResourceFactory;
- typedef std::function<ScopedObservable(R)> ObservableFactory;
-
- private:
- ResourceFactory resourceFactory;
- ObservableFactory observableFactory;
-
- class _ : public Sink<_, T>, public Observer<T>
- {
- Parent parent;
- Source source;
-
- public:
- typedef Sink<_, T> SinkBase;
-
- _(Parent parent, std::shared_ptr < Observer < T >> observer, Disposable cancel) :
- SinkBase(std::move(observer), std::move(cancel)),
- parent(parent)
- {
- }
-
- Disposable Run()
- {
- ComposableDisposable cd;
- auto disposable = Disposable::Empty();
-
- try
- {
- auto resource = parent->resourceFactory();
- disposable = resource;
- source = parent->observableFactory(resource);
- }
- catch (...)
- {
- cd.Add(Throw<T>(std::current_exception())->Subscribe(this->shared_from_this()));
- cd.Add(std::move(disposable));
- return cd;
- }
-
- cd.Add(source->Subscribe(this->shared_from_this()));
- cd.Add(std::move(disposable));
- return cd;
- }
-
- virtual void OnNext(const T& t)
- {
- SinkBase::observer->OnNext(t);
- }
- virtual void OnCompleted()
- {
- SinkBase::observer->OnCompleted();
- SinkBase::Dispose();
- }
- virtual void OnError(const std::exception_ptr& e)
- {
- SinkBase::observer->OnError(e);
- SinkBase::Dispose();
- }
- };
-
- typedef Producer<This, T> ProducerBase;
- public:
-
- UsingObservable(ResourceFactory resourceFactory, ObservableFactory observableFactory) :
- ProducerBase([](Parent parent, std::shared_ptr < Observer < T >> observer, Disposable && cancel, typename ProducerBase::SetSink setSink) -> Disposable
- {
- auto sink = std::shared_ptr<UsingObservable::_>(new UsingObservable::_(parent, observer, std::move(cancel)));
- setSink(sink->GetDisposable());
- return sink->Run();
- }),
- resourceFactory(resourceFactory),
- observableFactory(observableFactory)
- {
- }
- };
- }
- template <class RF, class OF>
- auto Using(
- RF resourceFactory,
- OF observableFactory
- )
- -> decltype(observableFactory(resourceFactory()))
- {
- typedef decltype(observableFactory(resourceFactory())) ScopedObservable;
- typedef typename observable_item<ScopedObservable>::type T;
- typedef decltype(resourceFactory()) R;
- return std::make_shared<detail::UsingObservable<T, R, ScopedObservable>>(std::move(resourceFactory), std::move(observableFactory));
- }
-}
-
-#endif \ No newline at end of file
diff --git a/Rx/CPP/src/cpprx/operators/Where.hpp b/Rx/CPP/src/cpprx/operators/Where.hpp
deleted file mode 100644
index d0089bd..0000000
--- a/Rx/CPP/src/cpprx/operators/Where.hpp
+++ /dev/null
@@ -1,86 +0,0 @@
- // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-#pragma once
-#include "../rx-operators.hpp"
-
-#if !defined(CPPRX_RX_OPERATORS_WHERE_HPP)
-#define CPPRX_RX_OPERATORS_WHERE_HPP
-
-namespace rxcpp
-{
- namespace detail
- {
- template<class T>
- class WhereObservable : public Producer<WhereObservable<T>, T>
- {
- typedef std::shared_ptr<WhereObservable<T>> Parent;
- typedef std::function<bool(T)> Predicate;
-
- std::shared_ptr<Observable<T>> source;
- Predicate predicate;
-
- class _ : public Sink<_, T>, public Observer<T>
- {
- Parent parent;
-
- public:
- typedef Sink<_, T> SinkBase;
-
- _(Parent parent, std::shared_ptr < Observer < T >> observer, Disposable cancel) :
- SinkBase(std::move(observer), std::move(cancel)),
- parent(parent)
- {
- }
-
- virtual void OnNext(const T& t)
- {
- util::maybe<bool> shouldRun;
- try {
- shouldRun.set(parent->predicate(t));
- } catch (...) {
- SinkBase::observer->OnError(std::current_exception());
- SinkBase::Dispose();
- }
- if (!!shouldRun && *shouldRun.get()) {
- SinkBase::observer->OnNext(t);
- }
- }
- virtual void OnCompleted()
- {
- SinkBase::observer->OnCompleted();
- SinkBase::Dispose();
- }
- virtual void OnError(const std::exception_ptr& e)
- {
- SinkBase::observer->OnError(e);
- SinkBase::Dispose();
- }
- };
-
- typedef Producer<WhereObservable<T>, T> ProducerBase;
- public:
-
- WhereObservable(const std::shared_ptr<Observable<T>>& source, Predicate predicate) :
- ProducerBase([this](Parent parent, std::shared_ptr < Observer < T >> observer, Disposable && cancel, typename ProducerBase::SetSink setSink) -> Disposable
- {
- auto sink = std::shared_ptr<WhereObservable::_>(new WhereObservable::_(parent, observer, std::move(cancel)));
- setSink(sink->GetDisposable());
- return this->source->Subscribe(sink);
- }),
- source(source),
- predicate(std::move(predicate))
- {
- }
- };
- }
- template <class T, class P>
- std::shared_ptr<Observable<T>> Where(
- const std::shared_ptr<Observable<T>>& source,
- P predicate
- )
- {
- return std::make_shared<detail::WhereObservable<T>>(source, std::move(predicate));
- }
-}
-
-#endif \ No newline at end of file
diff --git a/Rx/CPP/src/cpprx/operators/Zip.hpp b/Rx/CPP/src/cpprx/operators/Zip.hpp
deleted file mode 100644
index 8788bbc..0000000
--- a/Rx/CPP/src/cpprx/operators/Zip.hpp
+++ /dev/null
@@ -1,223 +0,0 @@
- // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-#pragma once
-#include "../rx-operators.hpp"
-
-#if !defined(CPPRX_RX_OPERATORS_ZIP_HPP)
-#define CPPRX_RX_OPERATORS_ZIP_HPP
-
-namespace rxcpp
-{
-
- namespace detail{
- template<size_t Index, size_t SourcesSize, class SubscribeState>
- struct ZipSubscriber {
- typedef typename std::tuple_element<Index, typename SubscribeState::Queues>::type::second_type::value_type Item;
- typedef std::shared_ptr<Observer<typename SubscribeState::result_type>> ResultObserver;
- struct Next
- {
- std::shared_ptr<SubscribeState> state;
- const ResultObserver& observer;
- const ComposableDisposable& cd;
- explicit Next(
- std::shared_ptr<SubscribeState> state,
- const ResultObserver& observer,
- const ComposableDisposable& cd)
- : state(std::move(state))
- , observer(observer)
- , cd(cd) {
- }
-#if RXCPP_USE_VARIADIC_TEMPLATES
- template<class... ZipQueue>
- void operator()(ZipQueue&... queue) {
- // build array of bool that we can iterate to detect empty queues
- bool empties[] = {queue.second.empty()...};
- if (std::find(std::begin(empties), std::end(empties), true) == std::end(empties)) {
- // all queues have an item.
- //
- // copy front of each queue
- auto args = std::make_tuple(queue.second.front()...);
-
- // cause side-effect of pop on each queue
- std::make_tuple((queue.second.pop(), true)...);
-
- typedef decltype(util::tuple_dispatch(state->selector, args)) U;
- util::maybe<U> result;
- try {
- result.set(util::tuple_dispatch(state->selector, args));
- } catch(...) {
- observer->OnError(std::current_exception());
- }
- if (!!result) {
- observer->OnNext(std::move(*result.get()));
- }
- }
- // build new array to check for any empty queue
- bool post_empties[] = {queue.first && queue.second.empty()...};
- if (std::find(std::begin(post_empties), std::end(post_empties), true) != std::end(post_empties)) {
- // at least one queue is empty and at least one of the sources has completed.
- // it is time to stop.
- observer->OnCompleted();
- cd.Dispose();
- }
- }
-#else
- template<class ZipQueue1, class ZipQueue2>
- void operator()(ZipQueue1& queue1, ZipQueue2& queue2) {
- // build array of bool that we can iterate to detect empty queues
- bool empties[] = {queue1.second.empty(), queue2.second.empty()};
- if (std::find(std::begin(empties), std::end(empties), true) == std::end(empties)) {
- // all queues have an item.
- //
- // copy front of each queue
- auto args = std::make_tuple(queue1.second.front(), queue2.second.front());
-
- queue1.second.pop();
- queue2.second.pop();
-
- typedef decltype(util::tuple_dispatch(state->selector, args)) U;
- util::maybe<U> result;
- try {
- result.set(util::tuple_dispatch(state->selector, args));
- } catch(...) {
- observer->OnError(std::current_exception());
- }
- if (!!result) {
- observer->OnNext(std::move(*result.get()));
- }
- }
- // build new array to check for any empty queue
- bool post_empties[] = {queue1.first && queue1.second.empty(), queue2.first && queue2.second.empty()};
- if (std::find(std::begin(post_empties), std::end(post_empties), true) != std::end(post_empties)) {
- // at least one queue is empty and at least one of the sources has completed.
- // it is time to stop.
- observer->OnCompleted();
- cd.Dispose();
- }
- }
-#endif //RXCPP_USE_VARIADIC_TEMPLATES
- };
- static void subscribe(
- ComposableDisposable& cd,
- const std::shared_ptr<Observer<typename SubscribeState::result_type>>& observer,
- const std::shared_ptr<SubscribeState>& state,
- const typename SubscribeState::Sources& sources) {
- cd.Add(Subscribe(
- std::get<Index>(sources),
- // on next
- [=](const Item& element)
- {
- std::unique_lock<std::mutex> guard(state->lock);
- if (state->isStopped) {return;}
- std::get<Index>(state->queues).second.push(element);
- Next next(state, observer, cd);
- util::tuple_dispatch(next, state->queues);
- },
- // on completed
- [=]
- {
- std::unique_lock<std::mutex> guard(state->lock);
- if (state->isStopped) {return;}
- std::get<Index>(state->queues).first = true;
- Next next(state, observer, cd);
- util::tuple_dispatch(next, state->queues);
- },
- // on error
- [=](const std::exception_ptr& error)
- {
- std::unique_lock<std::mutex> guard(state->lock);
- if (state->isStopped) {return;}
- observer->OnError(error);
- cd.Dispose();
- }));
- ZipSubscriber<Index + 1, SourcesSize, SubscribeState>::
- subscribe(cd, observer, state, sources);
- }
- };
- template<size_t SourcesSize, class SubscribeState>
- struct ZipSubscriber<SourcesSize, SourcesSize, SubscribeState> {
- static void subscribe(
- ComposableDisposable& ,
- const std::shared_ptr<Observer<typename SubscribeState::result_type>>& ,
- const std::shared_ptr<SubscribeState>& ,
- const typename SubscribeState::Sources& ) {}
- };
- }
-#if RXCPP_USE_VARIADIC_TEMPLATES
- template <class... ZipSource, class S>
- auto Zip(
- S selector,
- const std::shared_ptr<Observable<ZipSource>>&... source
- )
- -> std::shared_ptr<Observable<typename std::result_of<S(const ZipSource&...)>::type>>
- {
- typedef typename std::result_of<S(const ZipSource&...)>::type result_type;
- typedef std::tuple<std::shared_ptr<Observable<ZipSource>>...> Sources;
- typedef std::tuple<std::pair<bool, std::queue<ZipSource>>...> Queues;
- struct State {
- typedef Queues Queues;
- typedef Sources Sources;
- typedef result_type result_type;
- typedef std::tuple_size<Sources> SourcesSize;
- explicit State(S selector)
- : selector(std::move(selector))
- , isStopped(false)
- {}
- std::mutex lock;
- S selector;
- Queues queues;
- bool isStopped;
- };
- Sources sources(source...);
- // bug on osx prevents using make_shared
- std::shared_ptr<State> state(new State(std::move(selector)));
- return CreateObservable<result_type>(
- [=](std::shared_ptr<Observer<result_type>> observer) -> Disposable
- {
- ComposableDisposable cd;
- cd.Add(Disposable([state](){state->isStopped = true;}));
- detail::ZipSubscriber<0, State::SourcesSize::value, State>::subscribe(cd, observer, state, sources);
- return cd;
- });
- }
-#else
- template <class ZipSource1, class ZipSource2, class S>
- auto Zip(
- S selector,
- const std::shared_ptr<Observable<ZipSource1>>& source1,
- const std::shared_ptr<Observable<ZipSource2>>& source2
- )
- -> std::shared_ptr<Observable<typename std::result_of<S(const ZipSource1&, const ZipSource2&)>::type>>
- {
- typedef typename std::result_of<S(const ZipSource1&, const ZipSource2&)>::type result_type;
- typedef std::tuple<std::shared_ptr<Observable<ZipSource1>>, std::shared_ptr<Observable<ZipSource2>>> Sources;
- typedef std::tuple<std::pair<bool, std::queue<ZipSource1>>, std::pair<bool, std::queue<ZipSource2>>> Queues;
- struct State {
- typedef Queues Queues;
- typedef Sources Sources;
- typedef result_type result_type;
- typedef std::tuple_size<Sources> SourcesSize;
- explicit State(S selector)
- : selector(std::move(selector))
- , isStopped(false)
- {}
- std::mutex lock;
- S selector;
- Queues queues;
- bool isStopped;
- };
- Sources sources(source1, source2);
- // bug on osx prevents using make_shared
- std::shared_ptr<State> state(new State(std::move(selector)));
- return CreateObservable<result_type>(
- [=](std::shared_ptr<Observer<result_type>> observer) -> Disposable
- {
- ComposableDisposable cd;
- detail::ZipSubscriber<0, State::SourcesSize::value, State>::subscribe(cd, observer, state, sources);
- return cd;
- });
- }
-#endif //RXCPP_USE_VARIADIC_TEMPLATES
-}
-
-#endif \ No newline at end of file
diff --git a/Rx/CPP/src/cpprx/rx-base.hpp b/Rx/CPP/src/cpprx/rx-base.hpp
deleted file mode 100644
index 43acb56..0000000
--- a/Rx/CPP/src/cpprx/rx-base.hpp
+++ /dev/null
@@ -1,1029 +0,0 @@
-// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-#pragma once
-#include "rx-includes.hpp"
-
-#if !defined(CPPRX_RX_BASE_HPP)
-#define CPPRX_RX_BASE_HPP
-
-namespace rxcpp
-{
- //////////////////////////////////////////////////////////////////////
- //
- // Abstract interfaces
-
- template <class T>
- struct Observer
- {
- virtual void OnNext(const T&) {}
- virtual void OnCompleted() {}
- virtual void OnError(const std::exception_ptr&) {}
-
- virtual ~Observer() {}
- };
-
- class Disposable
- {
- Disposable();
- Disposable(const Disposable&);
- typedef std::function<void()> dispose_type;
- dispose_type dispose;
- public:
- explicit Disposable(dispose_type disposearg)
- : dispose(std::move(disposearg)) {
- disposearg = nullptr;}
- Disposable(Disposable&& other)
- : dispose(std::move(other.dispose)) {
- other.dispose = nullptr; }
- Disposable& operator=(Disposable other) {
- swap(other);
- return *this;
- }
- void Dispose()
- {
- if (dispose) {
- dispose();
- dispose = nullptr;
- }
- }
- void swap(Disposable& rhs) {{using std::swap; swap(dispose, rhs.dispose);}}
- static Disposable Empty() { return Disposable(nullptr); }
- };
- inline void swap(Disposable& lhs, Disposable& rhs) {lhs.swap(rhs);}
-
- template <class T>
- struct Observable
- {
- virtual Disposable Subscribe(std::shared_ptr<Observer<T>> observer) = 0;
- virtual ~Observable() {}
- };
-
- template <class K, class T>
- struct GroupedObservable : Observable<T>
- {
- virtual K Key() = 0;
- virtual ~GroupedObservable() {}
- };
-
- template <class T>
- struct ConnectableObservable : Observable<T>
- {
- virtual Disposable Connect() = 0;
- virtual ~ConnectableObservable() {}
- };
-
- struct Scheduler : public std::enable_shared_from_this<Scheduler>
- {
- typedef std::chrono::steady_clock clock;
- typedef std::shared_ptr<Scheduler> shared;
-
- class Work {
- struct bool_r{};
- static bool_r bool_true(){return bool_r();}
- typedef decltype(&bool_true) bool_type;
-
- struct State
- {
- typedef std::function<Disposable(shared)> F;
- F work;
- bool disposed;
- inline void Dispose() {
- disposed = true;
- }
- };
- std::shared_ptr<State> state;
-
- template<int, bool sameType>
- struct assign
- {
- void operator()(std::shared_ptr<State>& state, State::F fn) {
- if (!state) {
- state = std::make_shared<State>();
- }
- state->work = std::move(fn);
- }
- void operator()(std::shared_ptr<State>& state, std::nullptr_t) {
- if (state) {
- state->work = nullptr;
- }
- }
- };
-
- template<int dummy>
- struct assign<dummy, true>
- {
- void operator()(std::shared_ptr<State>& state, const Work& o) {
- state = o.state;
- }
- void operator()(std::shared_ptr<State>& state, Work&& o) {
- state = std::move(o.state);
- }
- };
- public:
- Work()
- : state(std::make_shared<State>())
- {
- state->disposed = false;
- }
- template<class Fn>
- Work(Fn&& fn)
- : state(std::make_shared<State>())
- {
- assign<1, std::is_same<Work, typename std::decay<Fn>::type>::value>()(state, std::forward<Fn>(fn));
- state->disposed = false;
- }
- template<class Fn>
- Work& operator=(Fn&& fn)
- {
- assign<1, std::is_same<Work, typename std::decay<Fn>::type>::value>()(state, std::forward<Fn>(fn));
- return *this;
- }
- inline Disposable operator()(shared s) {
- if (!state->disposed) {
- return state->work(s);
- }
- return Disposable::Empty();
- }
- inline operator bool_type() const {return (!state->disposed && !!state->work) ? &bool_true : nullptr;}
- inline void Dispose() const {
- state->Dispose();
- }
- inline operator Disposable() const
- {
- // make sure to capture state and not 'this'.
- auto local = state;
- return Disposable([local]{
- local->Dispose();
- });
- }
- };
-
- shared get() {return shared_from_this();}
-
- virtual ~Scheduler() {}
-
- virtual clock::time_point Now() =0;
- virtual Disposable Schedule(Work work) = 0;
- virtual Disposable Schedule(clock::duration due, Work work) = 0;
- virtual Disposable Schedule(clock::time_point due, Work work) = 0;
- };
-
- //////////////////////////////////////////////////////////////////////
- //
- // disposables
-
-
- // reference handle type for a container for composing disposables
- class ComposableDisposable
- {
- typedef std::shared_ptr<Disposable> shared_disposable;
- typedef std::weak_ptr<Disposable> weak_disposable;
- struct State
- {
- std::vector<shared_disposable> disposables;
- std::mutex lock;
- bool isDisposed;
-
- State() : isDisposed(false)
- {
- }
- weak_disposable Add(Disposable&& d)
- {
- return Add(std::make_shared<Disposable>(std::move(d)));
- }
- weak_disposable Add(shared_disposable s)
- {
- std::unique_lock<decltype(lock)> guard(lock);
- if (isDisposed) {
- guard.unlock();
- s->Dispose();
- } else {
- auto end = std::end(disposables);
- auto it = std::find(std::begin(disposables), end, s);
- if (it == end)
- {
- disposables.emplace_back(s);
- }
- }
- return s;
- }
- void Remove(weak_disposable w)
- {
- std::unique_lock<decltype(lock)> guard(lock);
- auto s = w.lock();
- if (s)
- {
- auto end = std::end(disposables);
- auto it = std::find(std::begin(disposables), end, s);
- if (it != end)
- {
- disposables.erase(it);
- }
- }
- }
- void Dispose()
- {
- std::unique_lock<decltype(lock)> guard(lock);
-
- if (!isDisposed)
- {
- isDisposed = true;
- auto v = std::move(disposables);
- guard.unlock();
-
- std::for_each(v.begin(), v.end(),
- [](shared_disposable& d) {
- d->Dispose(); });
- }
- }
- };
-
- mutable std::shared_ptr<State> state;
-
- public:
-
- ComposableDisposable()
- : state(std::make_shared<State>())
- {
- }
- weak_disposable Add(shared_disposable s) const
- {
- return state->Add(std::move(s));
- }
- weak_disposable Add(Disposable d) const
- {
- return state->Add(std::move(d));
- }
- void Remove(weak_disposable w) const
- {
- state->Remove(w);
- }
- void Dispose() const
- {
- state->Dispose();
- }
- operator Disposable() const
- {
- // make sure to capture state and not 'this'.
- // usage means that 'this' will usualy be destructed
- // immediately
- auto local = state;
- return Disposable([local]{
- local->Dispose();
- });
- }
- };
-
- class ScheduledDisposable
- {
- struct State : public std::enable_shared_from_this<State>
- {
- Scheduler::shared scheduler;
- Disposable disposable;
-
- State(Scheduler::shared scheduler, Disposable disposable)
- : scheduler(std::move(scheduler))
- , disposable(std::move(disposable))
- {
- }
- void Dispose()
- {
- auto local = std::move(scheduler);
- if (local) {
- auto keepAlive = shared_from_this();
- local->Schedule([keepAlive] (Scheduler::shared) -> Disposable {
- keepAlive->disposable.Dispose();
- return Disposable::Empty();
- });
- }
- }
- };
-
- std::shared_ptr<State> state;
-
- ScheduledDisposable();
- public:
-
- ScheduledDisposable(Scheduler::shared scheduler, Disposable disposable)
- : state(new State(std::move(scheduler), std::move(disposable)))
- {
- }
- ScheduledDisposable(const ScheduledDisposable& o)
- : state(o.state)
- {
- }
- ScheduledDisposable(ScheduledDisposable&& o)
- : state(std::move(o.state))
- {
- o.state = nullptr;
- }
- ScheduledDisposable& operator=(ScheduledDisposable o) {
- using std::swap;
- swap(o.state, state);
- return *this;
- }
- void Dispose() const
- {
- state->Dispose();
- }
- operator Disposable() const
- {
- // make sure to capture state and not 'this'.
- // usage means that 'this' will usualy be destructed
- // immediately
- auto local = state;
- return Disposable([local]{
- local->Dispose();
- });
- }
- };
-
- class SerialDisposable
- {
- struct State
- {
- mutable Disposable disposable;
- mutable bool disposed;
- mutable std::mutex lock;
-
- State() : disposable(Disposable::Empty()), disposed(false) {}
-
- void Set(Disposable disposeArg) const
- {
- std::unique_lock<decltype(lock)> guard(lock);
- if (!disposed) {
- using std::swap;
- swap(disposable, disposeArg);
- }
- guard.unlock();
- disposeArg.Dispose();
- }
- void Dispose()
- {
- std::unique_lock<decltype(lock)> guard(lock);
- if (!disposed) {
- disposed = true;
- auto local = std::move(disposable);
- guard.unlock();
- local.Dispose();
- }
- }
- };
-
- mutable std::shared_ptr<State> state;
-
- public:
-
- SerialDisposable()
- : state(std::make_shared<State>())
- {
- }
- void Dispose() const
- {
- state->Dispose();
- }
- void Set(Disposable disposeArg) const
- {
- state->Set(std::move(disposeArg));
- }
- operator Disposable() const
- {
- // make sure to capture state and not 'this'.
- // usage means that 'this' will usualy be destructed
- // immediately
- auto local = state;
- return Disposable([local]{
- local->Dispose();
- });
- }
- };
-
- template<class Absolute>
- class ScheduledItem {
- public:
- ScheduledItem(Absolute due, Scheduler::Work work)
- : due(due)
- , work(std::move(work))
- {}
-
- static Disposable Do(Scheduler::Work& work, Scheduler::shared scheduler)
- {
- if (work)
- {
- return work(std::move(scheduler));
- }
- return Disposable::Empty();
- }
-
- Absolute due;
- Scheduler::Work work;
- };
-
- struct LocalScheduler : public Scheduler
- {
- private:
- LocalScheduler(const LocalScheduler&);
-
- public:
- typedef ScheduledItem<clock::time_point> QueueItem;
- static Disposable Do(Work& work, const Scheduler::shared& scheduler)
- {
- return QueueItem::Do(work, scheduler);
- }
-
- public:
- LocalScheduler()
- {
- }
- virtual ~LocalScheduler()
- {
- }
-
- virtual clock::time_point Now() {return clock::now();}
-
- using Scheduler::Schedule;
- virtual Disposable Schedule(Work work)
- {
- clock::time_point dueTime = clock::now();
- return Schedule(dueTime, std::move(work));
- }
-
- virtual Disposable Schedule(clock::duration due, Work work)
- {
- clock::time_point dueTime = clock::now() + due;
- return Schedule(dueTime, std::move(work));
- }
- };
-
- template<class Absolute, class Relative>
- struct VirtualTimeSchedulerBase : public Scheduler
- {
- private:
- VirtualTimeSchedulerBase(const VirtualTimeSchedulerBase&);
-
- bool is_enabled;
-
- public:
- virtual ~VirtualTimeSchedulerBase()
- {
- }
-
- protected:
- VirtualTimeSchedulerBase()
- : is_enabled(false)
- , clock_now(0)
- {
- }
- explicit VirtualTimeSchedulerBase(Absolute initialClock)
- : is_enabled(false)
- , clock_now(initialClock)
- {
- }
-
- typedef Scheduler::clock clock;
- typedef Scheduler::Work Work;
- typedef ScheduledItem<Absolute> QueueItem;
-
- Absolute clock_now;
-
- virtual Absolute Add(Absolute, Relative) =0;
-
- virtual clock::time_point ToTimePoint(Absolute) =0;
- virtual Relative ToRelative(clock::duration) =0;
-
- virtual util::maybe<QueueItem> GetNext() =0;
-
- public:
- static Disposable Do(Work& work, const Scheduler::shared& scheduler)
- {
- return QueueItem::Do(work, scheduler);
- }
-
- virtual Disposable ScheduleAbsolute(Absolute, Work) =0;
-
- virtual Disposable ScheduleRelative(Relative dueTime, Work work) {
- auto at = Add(clock_now, dueTime);
- return ScheduleAbsolute(at, std::move(work));
- }
-
- virtual clock::time_point Now() {return ToTimePoint(clock_now);}
-
- bool IsEnabled() {return is_enabled;}
- Absolute Clock() {return clock_now;}
-
- using Scheduler::Schedule;
- virtual Disposable Schedule(Work work)
- {
- return ScheduleAbsolute(clock_now, std::move(work));
- }
-
- virtual Disposable Schedule(clock::duration due, Work work)
- {
- return ScheduleRelative(ToRelative(due), std::move(work));
- }
-
- virtual Disposable Schedule(clock::time_point due, Work work)
- {
- return ScheduleRelative(ToRelative(due - Now()), std::move(work));
- }
-
- void Start()
- {
- if (!is_enabled) {
- is_enabled = true;
- do {
- auto next = GetNext();
- if (!!next && !!next->work) {
- if (next->due > clock_now) {
- clock_now = next->due;
- }
- Do(next->work, shared_from_this());
- }
- else {
- is_enabled = false;
- }
- } while (is_enabled);
- }
- }
-
- void Stop()
- {
- is_enabled = false;
- }
-
- void AdvanceTo(Absolute time)
- {
- if (time < clock_now) {
- abort();
- }
-
- if (time == clock_now) {
- return;
- }
-
- if (!is_enabled) {
- is_enabled = true;
- do {
- auto next = GetNext();
- if (!!next && !!next->work && next->due <= time) {
- if (next->due > clock_now) {
- clock_now = next->due;
- }
- Do(next->work, shared_from_this());
- }
- else {
- is_enabled = false;
- }
- } while (is_enabled);
-
- clock_now = time;
- }
- else {
- abort();
- }
- }
-
- void AdvanceBy(Relative time)
- {
- auto dt = Add(clock_now, time);
-
- if (dt < clock_now) {
- abort();
- }
-
- if (dt == clock_now) {
- return;
- }
-
- if (!is_enabled) {
- AdvanceTo(dt);
- }
- else {
- abort();
- }
- }
-
- void Sleep(Relative time)
- {
- auto dt = Add(clock_now, time);
-
- if (dt < clock_now) {
- abort();
- }
-
- clock_now = dt;
- }
-
- };
-
- template<class T>
- class Recorded
- {
- long time;
- T value;
- public:
- Recorded(long time, T value) : time(time), value(value) {
- }
- long Time() const {return time;}
- const T& Value() const {return value;}
- };
-
- template<class T>
- bool operator == (Recorded<T> lhs, Recorded<T> rhs) {
- return lhs.Time() == rhs.Time() && lhs.Value() == rhs.Value();
- }
-
- template<class T>
- std::ostream& operator<< (std::ostream& out, const Recorded<T>& r) {
- out << "@" << r.Time() << "-" << r.Value();
- return out;
- }
-
- class Subscription
- {
- long subscribe;
- long unsubscribe;
-
- public:
- explicit inline Subscription(long subscribe) : subscribe(subscribe), unsubscribe(std::numeric_limits<long>::max()) {
- }
- inline Subscription(long subscribe, long unsubscribe) : subscribe(subscribe), unsubscribe(unsubscribe) {
- }
- inline long Subscribe() const {return subscribe;}
- inline long Unsubscribe() const {return unsubscribe;}
- };
-
- inline bool operator == (Subscription lhs, Subscription rhs) {
- return lhs.Subscribe() == rhs.Subscribe() && lhs.Unsubscribe() == rhs.Unsubscribe();
- }
-
- inline std::ostream& operator<< (std::ostream& out, const Subscription& s) {
- out << s.Subscribe() << "-" << s.Unsubscribe();
- return out;
- }
-
- template<typename T>
- struct Notification
- {
- typedef std::function<void (const T&)> OnNext;
- typedef std::function<void ()> OnCompleted;
- typedef std::function<void (const std::exception_ptr&)> OnError;
-
- virtual ~Notification() {}
-
- virtual void Out(std::ostream& out) =0;
- virtual bool Equals(std::shared_ptr<Notification<T>> other) = 0;
- virtual void Accept(std::shared_ptr<Observer<T>>) =0;
- virtual void Accept(OnNext onnext, OnCompleted oncompleted, OnError onerror) =0;
-
- private:
- struct OnNextNotification : public Notification<T> {
- OnNextNotification(T value) : value(std::move(value)) {
- }
- virtual void Out(std::ostream& out) {
- out << "OnNext( " << value << ")";
- }
- virtual bool Equals(std::shared_ptr<Notification<T>> other) {
- bool result = false;
- other->Accept([this, &result](T value) { result = this->value == value;}, [](){}, [](std::exception_ptr){});
- return result;
- }
- virtual void Accept(std::shared_ptr<Observer<T>> o) {
- if (!o) {
- abort();
- }
- o->OnNext(value);
- }
- virtual void Accept(OnNext onnext, OnCompleted oncompleted, OnError onerror) {
- if (!onnext || !oncompleted || !onerror) {
- abort();
- }
- onnext(value);
- }
- const T value;
- };
-
- struct OnCompletedNotification : public Notification<T> {
- OnCompletedNotification() {
- }
- virtual void Out(std::ostream& out) {
- out << "OnCompleted()";
- }
- virtual bool Equals(std::shared_ptr<Notification<T>> other) {
- bool result = false;
- other->Accept([](T) {}, [&result](){result = true;}, [](std::exception_ptr){});
- return result;
- }
- virtual void Accept(std::shared_ptr<Observer<T>> o) {
- if (!o) {
- abort();
- }
- o->OnCompleted();
- }
- virtual void Accept(OnNext onnext, OnCompleted oncompleted, OnError onerror) {
- if (!onnext || !oncompleted || !onerror) {
- abort();
- }
- oncompleted();
- }
- };
-
- struct OnErrorNotification : public Notification<T> {
- OnErrorNotification(std::exception_ptr ep) : ep(ep) {
- }
- virtual void Out(std::ostream& out) {
- out << "OnError()";
- }
- virtual bool Equals(std::shared_ptr<Notification<T>> other) {
- bool result = false;
- // not trying to compare exceptions
- other->Accept([](T) {}, [](){}, [&result](std::exception_ptr){result = true;});
- return result;
- }
- virtual void Accept(std::shared_ptr<Observer<T>> o) {
- if (!o) {
- abort();
- }
- o->OnError(ep);
- }
- virtual void Accept(OnNext onnext, OnCompleted oncompleted, OnError onerror) {
- if (!onnext || !oncompleted || !onerror) {
- abort();
- }
- onerror(ep);
- }
- const std::exception_ptr ep;
- };
-
- public:
- static
- std::shared_ptr<OnNextNotification> CreateOnNext(T value) {
- return std::make_shared<OnNextNotification>(std::move(value));
- }
- static
- std::shared_ptr<OnCompletedNotification> CreateOnCompleted() {
- return std::make_shared<OnCompletedNotification>();
- }
- template<typename Exception>
- static
- std::shared_ptr<OnErrorNotification> CreateOnError(Exception&& e) {
- std::exception_ptr ep;
- try {throw std::forward<Exception>(e);}
- catch (...) {ep = std::current_exception();}
- return std::make_shared<OnErrorNotification>(ep);
- }
- static
- std::shared_ptr<OnErrorNotification> CreateOnError(std::exception_ptr ep) {
- return std::make_shared<OnErrorNotification>(ep);
- }
- };
-
- template<class T>
- bool operator == (std::shared_ptr<Notification<T>> lhs, std::shared_ptr<Notification<T>> rhs) {
- if (!lhs && !rhs) {return true;}
- if (!lhs || !rhs) {return false;}
- return lhs->Equals(rhs);
- }
-
- template<class T>
- std::ostream& operator<< (std::ostream& out, const std::shared_ptr<Notification<T>>& n) {
- n->Out(out);
- return out;
- }
-
- template<class T>
- struct TestableObserver : public Observer<T>
- {
- virtual std::vector<Recorded<std::shared_ptr<Notification<T>>>> Messages() =0;
- };
-
- template<class T>
- struct TestableObservable : public Observable<T>
- {
- virtual std::vector<Subscription> Subscriptions() =0;
-
- virtual std::vector<Recorded<std::shared_ptr<Notification<T>>>> Messages() =0;
- };
-
- template<class Target>
- class TupleDispatch {
- Target target;
- public:
- TupleDispatch(Target target) : target(std::move(target)) {
- }
- template<class Tuple>
- auto operator()(const Tuple& tuple)
- -> decltype(util::tuple_dispatch(target, tuple)) {
- return util::tuple_dispatch(target, tuple);}
- template<class Tuple>
- auto operator()(const Tuple& tuple) const
- -> decltype(util::tuple_dispatch(target, tuple)) {
- return util::tuple_dispatch(target, tuple);}
- };
-
- template<class Target>
- TupleDispatch<Target> MakeTupleDispatch(Target&& target) {
- return TupleDispatch<Target>(std::forward<Target>(target));}
-
- template<class Tuple, class Target>
- auto DispatchTuple(Tuple&& tuple, Target&& target) ->
- decltype(util::tuple_dispatch(std::forward<Target>(target), std::forward<Tuple>(tuple))) {
- return util::tuple_dispatch(std::forward<Target>(target), std::forward<Tuple>(tuple));}
-
-#if RXCPP_USE_VARIADIC_TEMPLATES
- template<class T>
- auto TieTuple(T&& t) ->
- decltype(util::tuple_tie(std::forward<T>(t))) {
- return util::tuple_tie(std::forward<T>(t));}
-#endif //RXCPP_USE_VARIADIC_TEMPLATES
-
- template<class T>
- class Subject;
-
- template<class T>
- class BehaviorSubject;
-
- template<class T>
- class AsyncSubject;
-
- template<class Source, class Subject>
- class ConnectableSubject;
-
- template<class K, class T>
- class GroupedSubject;
-
- template<class T>
- T item(const std::shared_ptr<Observable<T>>&);
-
- template<class K, class T>
- T item(const std::shared_ptr<GroupedObservable<K,T>>&);
-
- template<class Observable>
- struct is_observable {static const bool value = false;};
-
- template<class T>
- struct is_observable<std::shared_ptr<Observable<T>>> {static const bool value = true;};
-
- template<class T>
- struct is_observable<std::shared_ptr<Subject<T>>> {static const bool value = true;};
-
- template<class T>
- struct is_observable<std::shared_ptr<BehaviorSubject<T>>> {static const bool value = true;};
-
- template<class T>
- struct is_observable < std::shared_ptr < AsyncSubject<T >> > {static const bool value = true; };
-
- template<class Source, class Subject>
- struct is_observable < std::shared_ptr < ConnectableSubject<Source, Subject >> > {static const bool value = true; };
-
- template<class K, class T>
- struct is_observable<std::shared_ptr<GroupedObservable<K, T>>> {static const bool value = true;};
-
- template<class K, class T>
- struct is_observable<std::shared_ptr<GroupedSubject<K, T>>> {static const bool value = true;};
-
-namespace detail {
- template<class Observable>
- struct observable_item;
-
- template<class T>
- struct observable_item<std::shared_ptr<Observable<T>>> {typedef T type;};
-
- template<class T>
- struct observable_item<std::shared_ptr<TestableObservable<T>>> {typedef T type;};
-
- template<class T>
- struct observable_item < std::shared_ptr < ConnectableObservable<T >> > {typedef T type; };
-
- template<class K, class T>
- struct observable_item<std::shared_ptr<GroupedObservable<K, T>>> {typedef T type;};
-}
- template<class Observable>
- struct observable_item
- {
- typedef typename detail::observable_item<typename std::decay<Observable>::type>::type type;
- };
-
- template<class Observable>
- struct observable_observer;
-
- template<class T>
- struct observable_observer<std::shared_ptr<Observable<T>>> {typedef std::shared_ptr<Observer<T>> type;};
-
- template<class T>
- struct observable_observer < std::shared_ptr < ConnectableObservable<T >> > {typedef std::shared_ptr < Observer < T >> type; };
-
- template<class K, class T>
- struct observable_observer<std::shared_ptr<GroupedObservable<K, T>>> {typedef std::shared_ptr<Observer<T>> type;};
-
- template<class Observer>
- struct observer_item;
-
- template<class T>
- struct observer_item<std::shared_ptr<Observer<T>>> {typedef T type;};
-
- template<class T>
- struct observer_item<std::shared_ptr<TestableObserver<T>>> {typedef T type;};
-
- template<class Subject>
- struct subject_item;
-
- template<class T>
- struct subject_item<std::shared_ptr<Subject<T>>> {typedef T type;};
-
- template<class T>
- struct subject_item<std::shared_ptr<BehaviorSubject<T>>> {typedef T type;};
-
- template<class T>
- struct subject_item < std::shared_ptr < AsyncSubject<T >> > {typedef T type; };
-
- template<class Source, class Subject>
- struct subject_item < std::shared_ptr < ConnectableSubject<Source, Subject >> > : subject_item<Subject> {};
-
- template<class K, class T>
- struct subject_item<std::shared_ptr<GroupedSubject<K, T>>> {typedef T type;};
-
- template<class Subject>
- struct subject_observer;
-
- template<class T>
- struct subject_observer<std::shared_ptr<Subject<T>>> {typedef std::shared_ptr<Observer<T>> type;};
-
- template<class T>
- struct subject_observer<std::shared_ptr<BehaviorSubject<T>>> {typedef std::shared_ptr<Observer<T>> type;};
-
- template<class T>
- struct subject_observer < std::shared_ptr < AsyncSubject<T >> > {typedef std::shared_ptr < Observer < T >> type; };
-
- template<class Source, class Subject>
- struct subject_observer < std::shared_ptr < ConnectableSubject<Source, Subject >> > : subject_observer<Subject> {};
-
- template<class Subject>
- struct subject_observable;
-
- template<class T>
- struct subject_observable<std::shared_ptr<Subject<T>>> {typedef std::shared_ptr<Observable<T>> type;};
-
- template<class T>
- struct subject_observable<std::shared_ptr<BehaviorSubject<T>>> {typedef std::shared_ptr<Observable<T>> type;};
-
- template<class T>
- struct subject_observable < std::shared_ptr < AsyncSubject<T >> > {typedef std::shared_ptr < Observable < T >> type; };
-
- template<class Source, class Subject>
- struct subject_observable < std::shared_ptr < ConnectableSubject<Source, Subject >> > : subject_observable<Subject> {};
-
- template<class T>
- std::shared_ptr<Observable<T>> observable(const std::shared_ptr < Observable < T >> &o){ return o; }
-
- template<class K, class T>
- std::shared_ptr<Observable<T>> observable(const std::shared_ptr < GroupedObservable < K, T >> &o){ return std::static_pointer_cast < Observable < T >> (o); }
-
- template<class T>
- std::shared_ptr<Observable<T>> observable(const std::shared_ptr < TestableObservable < T >> &o){ return std::static_pointer_cast < Observable < T >> (o); }
-
- template<class T>
- std::shared_ptr< Observable < T >> observable(const std::shared_ptr < ConnectableObservable < T >> &o){
- return std::static_pointer_cast < Observable < T >> (o); }
-
- template<class T>
- std::shared_ptr<Observable<T>> observable(const std::shared_ptr<Subject<T>>& s){return std::static_pointer_cast<Observable<T>>(s);}
-
- template<class T>
- std::shared_ptr<Observable<T>> observable(const std::shared_ptr<BehaviorSubject<T>>& s){return std::static_pointer_cast<Observable<T>>(s);}
-
- template<class T>
- std::shared_ptr<Observable<T>> observable(const std::shared_ptr < AsyncSubject < T >> &s){ return std::static_pointer_cast < Observable < T >> (s); }
-
- template<class Source, class Subject>
- typename subject_observable<Subject>::type observable(const std::shared_ptr < ConnectableSubject < Source, Subject >> &s){
- return std::static_pointer_cast < Observable < typename subject_item<Subject>::type >> (s); }
-
- template<class K, class T>
- std::shared_ptr<Observable<T>> observable(const std::shared_ptr<GroupedSubject<K, T>>& s){return std::static_pointer_cast<Observable<T>>(s);}
-
- template<class T>
- std::shared_ptr<Observer<T>> observer(const std::shared_ptr < Observer < T >> &o){ return o; }
-
- template<class T>
- std::shared_ptr<Observer<T>> observer(const std::shared_ptr<Subject<T>>& s){return std::static_pointer_cast<Observer<T>>(s);}
-
- template<class T>
- std::shared_ptr<Observer<T>> observer(const std::shared_ptr<BehaviorSubject<T>>& s){return std::static_pointer_cast<Observer<T>>(s);}
-
- template<class T>
- std::shared_ptr<Observer<T>> observer(const std::shared_ptr < AsyncSubject < T >> &s){ return std::static_pointer_cast < Observer < T >> (s); }
-
- template<class Source, class Subject>
- void observer(const std::shared_ptr < ConnectableSubject < Source, Subject >> &s); // no observer
-
- template<class K, class T>
- std::shared_ptr<Observer<T>> observer(const std::shared_ptr<GroupedSubject<K, T>>& s){return std::static_pointer_cast<Observer<T>>(s);}
-
- template<class T>
- std::shared_ptr<Observer<T>> observer(const std::shared_ptr<TestableObserver<T>>& o){return std::static_pointer_cast<Observer<T>>(o);}
-
- template<class K, class T>
- std::shared_ptr<GroupedObservable<K, T>> grouped_observable(const std::shared_ptr<GroupedSubject<K, T>>& s){return std::static_pointer_cast<GroupedObservable<K, T>>(s);}
-}
-#endif
diff --git a/Rx/CPP/src/cpprx/rx-includes.hpp b/Rx/CPP/src/cpprx/rx-includes.hpp
deleted file mode 100644
index 4ef0221..0000000
--- a/Rx/CPP/src/cpprx/rx-includes.hpp
+++ /dev/null
@@ -1,100 +0,0 @@
-// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-#pragma once
-
-#if !defined(CPPRX_RX_INCLUDES_HPP)
-#define CPPRX_RX_INCLUDES_HPP
-
-#pragma push_macro("min")
-#pragma push_macro("max")
-#undef min
-#undef max
-
-#include <stdlib.h>
-
-#include <iostream>
-#include <iomanip>
-
-#include <exception>
-#include <functional>
-#include <memory>
-#include <vector>
-#include <algorithm>
-#include <atomic>
-#include <map>
-#include <mutex>
-#include <deque>
-#include <thread>
-#include <future>
-#include <vector>
-#include <list>
-#include <queue>
-#include <chrono>
-#include <condition_variable>
-
-// some configuration macros
-#if defined(_MSC_VER)
-
-#if _MSC_VER > 1600
-#define RXCPP_USE_RVALUEREF 1
-#endif
-
-#if _MSC_VER >= 1800
-#define RXCPP_USE_VARIADIC_TEMPLATES 1
-#endif
-
-#if _CPPRTTI
-#define RXCPP_USE_RTTI 1
-#endif
-
-#elif defined(__clang__)
-
-#if __has_feature(cxx_rvalue_references)
-#define RXCPP_USE_RVALUEREF 1
-#endif
-#if __has_feature(cxx_rtti)
-#define RXCPP_USE_RTTI 1
-#endif
-#if __has_feature(cxx_variadic_templates)
-#define RXCPP_USE_VARIADIC_TEMPLATES 1
-#endif
-
-#endif
-
-#if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP)
-#define RXCPP_USE_WINRT 0
-#else
-#define RXCPP_USE_WINRT 1
-#endif
-
-#if defined(RXCPP_FORCE_USE_VARIADIC_TEMPLATES)
-#undef RXCPP_USE_VARIADIC_TEMPLATES
-#define RXCPP_USE_VARIADIC_TEMPLATES RXCPP_FORCE_USE_VARIADIC_TEMPLATES
-#endif
-
-#if defined(RXCPP_FORCE_USE_RVALUEREF)
-#undef RXCPP_USE_RVALUEREF
-#define RXCPP_USE_RVALUEREF RXCPP_FORCE_USE_RVALUEREF
-#endif
-
-#if defined(RXCPP_FORCE_USE_RTTI)
-#undef RXCPP_USE_RTTI
-#define RXCPP_USE_RTTI RXCPP_FORCE_USE_RTTI
-#endif
-
-#if defined(RXCPP_FORCE_USE_WINRT)
-#undef RXCPP_USE_WINRT
-#define RXCPP_USE_WINRT RXCPP_FORCE_USE_WINRT
-#endif
-
-#include "rx-util.hpp"
-#include "rx-base.hpp"
-#include "rx-scheduler.hpp"
-#include "rx-windows.hpp"
-#include "rx-operators.hpp"
-#include "rx-winrt.hpp"
-
-#pragma pop_macro("min")
-#pragma pop_macro("max")
-
-#endif
diff --git a/Rx/CPP/src/cpprx/rx-operators.hpp b/Rx/CPP/src/cpprx/rx-operators.hpp
deleted file mode 100644
index cbef605..0000000
--- a/Rx/CPP/src/cpprx/rx-operators.hpp
+++ /dev/null
@@ -1,1018 +0,0 @@
- // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-#pragma once
-#include "rx-includes.hpp"
-
-#if !defined(CPPRX_RX_OPERATORS_HPP)
-#define CPPRX_RX_OPERATORS_HPP
-
-namespace rxcpp
-{
-
- //////////////////////////////////////////////////////////////////////
- //
- // constructors
- template <class T>
- struct CreatedAutoDetachObserver : public Observer<T>, public std::enable_shared_from_this<CreatedAutoDetachObserver<T>>
- {
- std::shared_ptr<Observer<T>> observer;
- mutable std::atomic<bool> isStopped;
- mutable SerialDisposable disposable;
-
- virtual ~CreatedAutoDetachObserver() {
- if (!isStopped) {
- abort();
- }
- }
-
- CreatedAutoDetachObserver()
- : isStopped(false)
- {
- }
-
- virtual void OnNext(const T& element)
- {
- if (!isStopped) {
- auto keepAlive = this->shared_from_this();
- RXCPP_UNWIND(disposer, [&](){
- this->isStopped = true;
- this->disposable.Dispose();
- });
- observer->OnNext(element);
- disposer.dismiss();
- }
- }
- virtual void OnCompleted()
- {
- if (!isStopped.exchange(true)) {
- auto keepAlive = this->shared_from_this();
- RXCPP_UNWIND(disposer, [&](){
- this->disposable.Dispose();
- });
- observer->OnCompleted();
- }
- }
- virtual void OnError(const std::exception_ptr& error)
- {
- if (!isStopped.exchange(true)) {
- auto keepAlive = this->shared_from_this();
- RXCPP_UNWIND(disposer, [&](){
- this->disposable.Dispose();
- });
- observer->OnError(error);
- }
- }
-
- void Dispose() const {
- isStopped = true;
- disposable.Dispose();
- }
- operator Disposable() const
- {
- // make sure to capture state and not 'this'.
- auto local = this->shared_from_this();
- return Disposable([local]{
- local->Dispose();
- });
- }
-
- bool Fail(const std::exception_ptr& error)
- {
- if (!isStopped.exchange(true)) {
- auto keepAlive = this->shared_from_this();
- RXCPP_UNWIND(disposer, [&](){
- this->disposable.Dispose();
- });
- observer->OnError(error);
- return true;
- }
- return false;
- }
- };
-
- template <class T>
- std::shared_ptr<CreatedAutoDetachObserver<T>> CreateAutoDetachObserver(
- std::shared_ptr<Observer<T>> observer
- )
- {
- auto p = std::make_shared<CreatedAutoDetachObserver<T>>();
- p->observer = std::move(observer);
-
- return p;
- }
-
- template <class T, class S>
- class CreatedObservable : public Observable<T>
- {
- S subscribe;
-
- public:
- CreatedObservable(S subscribe)
- : subscribe(std::move(subscribe))
- {
- }
- virtual Disposable Subscribe(std::shared_ptr<Observer<T>> observer)
- {
- auto autoDetachObserver = CreateAutoDetachObserver(std::move(observer));
-
- if (CurrentThreadScheduler::IsScheduleRequired()) {
- auto scheduler = std::make_shared<CurrentThreadScheduler>();
- scheduler->Schedule(
- [=](Scheduler::shared) -> Disposable {
- try {
- autoDetachObserver->disposable.Set(this->subscribe(autoDetachObserver));
- } catch (...) {
- if (!autoDetachObserver->Fail(std::current_exception())) {
- throw;
- }
- }
- return Disposable::Empty();
- }
- );
- return *autoDetachObserver;
- }
- try {
- autoDetachObserver->disposable.Set(subscribe(autoDetachObserver));
- return *autoDetachObserver;
- } catch (...) {
- if (!autoDetachObserver->Fail(std::current_exception())) {
- throw;
- }
- }
- return *autoDetachObserver;
- }
- };
-
- template <class T, class S>
- std::shared_ptr<Observable<T>> CreateObservable(S subscribe)
- {
- return std::make_shared<CreatedObservable<T,S>>(std::move(subscribe));
- }
-
- template <class T>
- struct CreatedObserver : public Observer<T>
- {
- std::function<void(const T&)> onNext;
- std::function<void()> onCompleted;
- std::function<void(const std::exception_ptr&)> onError;
-
- virtual ~CreatedObserver() {
- }
-
- virtual void OnNext(const T& element)
- {
- if(onNext)
- {
- onNext(element);
- }
- }
- virtual void OnCompleted()
- {
- if(onCompleted)
- {
- onCompleted();
- }
- }
- virtual void OnError(const std::exception_ptr& error)
- {
- if(onError)
- {
- onError(error);
- }
- }
- };
-
- template <class T>
- std::shared_ptr<Observer<T>> CreateObserver(
- std::function<void(const T&)> onNext,
- std::function<void()> onCompleted = nullptr,
- std::function<void(const std::exception_ptr&)> onError = nullptr
- )
- {
- auto p = std::make_shared<CreatedObserver<T>>();
- p->onNext = std::move(onNext);
- p->onCompleted = std::move(onCompleted);
- p->onError = std::move(onError);
-
- return p;
- }
-
-
- namespace detail
- {
- template<class Derived, class T>
- class Sink : public std::enable_shared_from_this<Derived>
- {
- typedef std::shared_ptr<Observer<T>> SinkObserver;
- mutable util::maybe<Disposable> cancel;
-
- // need to prevent disposed observer from being
- // deleted since it may still be in use on the stack
- mutable SinkObserver expired;
- protected:
- mutable SinkObserver observer;
-
- public:
- Sink(SinkObserver observerArg, Disposable cancelArg) :
- observer(std::move(observerArg))
- {
- cancel.set(std::move(cancelArg));
- if (!observer)
- {
- observer = std::make_shared<Observer<T>>();
- }
- }
-
- void Dispose() const
- {
- expired = std::make_shared<Observer<T>>();
- using std::swap;
- swap(observer, expired);
-
- if (cancel)
- {
- cancel->Dispose();
- cancel.reset();
- }
- }
-
- Disposable GetDisposable() const
- {
- // make sure to capture state and not 'this'.
- // usage means that 'this' will usualy be destructed
- // immediately
- auto local = this->shared_from_this();
- return Disposable([local]{
- local->Dispose();
- });
- }
- };
-
- template<class Derived, class T>
- class Producer : public std::enable_shared_from_this<Derived>, public Observable<T>
- {
- public:
- typedef std::function<void(Disposable)> SetSink;
- typedef std::function<Disposable(std::shared_ptr<Derived>, std::shared_ptr<Observer<T>>, Disposable, SetSink)> Run;
- private:
- Run run;
- struct State
- {
- SerialDisposable sink;
- SerialDisposable subscription;
- };
- public:
- Producer(Run run) :
- run(std::move(run))
- {
- }
-
- virtual Disposable Subscribe(std::shared_ptr<Observer<T>> observer)
- {
- auto state = std::make_shared<State>();
- auto that = this->shared_from_this();
- if (CurrentThreadScheduler::IsScheduleRequired()) {
- auto scheduler = std::make_shared<CurrentThreadScheduler>();
- scheduler->Schedule([=](Scheduler::shared) -> Disposable
- {
- state->subscription.Set(
- this->run(that, observer, state->subscription, [=](Disposable d)
- {
- state->sink.Set(std::move(d));
- }));
- return Disposable::Empty();
- });
- }
- else
- {
- state->subscription.Set(
- run(that, observer, state->subscription, [=](Disposable d)
- {
- state->sink.Set(std::move(d));
- }));
- }
- return Disposable([=]()
- {
- state->sink.Dispose();
- state->subscription.Dispose();
- });
- }
- };
-
- }
-
-
- struct SubjectState {
- enum type {
- Invalid,
- Forwarding,
- Completed,
- Error
- };
- };
-
- template <class T, class Base, class Subject>
- class ObservableSubject :
- public Base,
- public std::enable_shared_from_this<Subject>
- {
- protected:
- std::mutex lock;
- SubjectState::type state;
- std::exception_ptr error;
- std::vector<std::shared_ptr<Observer<T>>> observers;
-
- virtual ~ObservableSubject() {
- // putting this first means that the observers
- // will be destructed outside the lock
- std::vector<std::shared_ptr<Observer<T>>> empty;
-
- std::unique_lock<decltype(lock)> guard(lock);
- using std::swap;
- swap(observers, empty);
- }
-
- ObservableSubject() : state(SubjectState::Forwarding) {
- }
-
- void RemoveObserver(std::shared_ptr<Observer<T>> toRemove)
- {
- std::unique_lock<decltype(lock)> guard(lock);
- auto it = std::find(begin(observers), end(observers), toRemove);
- if (it != end(observers))
- *it = nullptr;
- }
- public:
-
- virtual Disposable Subscribe(std::shared_ptr<Observer<T>> observer)
- {
- std::weak_ptr<Observer<T>> wptr = observer;
- std::weak_ptr<Subject> wself = this->shared_from_this();
-
- Disposable d([wptr, wself]{
- if (auto self = wself.lock())
- {
- self->RemoveObserver(wptr.lock());
- }
- });
-
- {
- std::unique_lock<decltype(lock)> guard(lock);
- if (state == SubjectState::Completed) {
- observer->OnCompleted();
- return Disposable::Empty();
- } else if (state == SubjectState::Error) {
- observer->OnError(error);
- return Disposable::Empty();
- } else {
- for(auto& o : observers)
- {
- if (!o){
- o = std::move(observer);
- return d;
- }
- }
- observers.push_back(std::move(observer));
- return d;
- }
- }
- }
- };
-
- template <class T, class Base>
- class ObserverSubject :
- public Observer<T>,
- public Base
- {
- public:
- ObserverSubject() {}
-
- template<class A>
- explicit ObserverSubject(A&& a) : Base(std::forward<A>(a)) {}
-
- virtual void OnNext(const T& element)
- {
- std::unique_lock<decltype(Base::lock)> guard(Base::lock);
- auto local = Base::observers;
- guard.unlock();
- for(auto& o : local)
- {
- if (o) {
- o->OnNext(element);
- }
- }
- }
- virtual void OnCompleted()
- {
- std::unique_lock<decltype(Base::lock)> guard(Base::lock);
- Base::state = SubjectState::Completed;
- auto local = std::move(Base::observers);
- guard.unlock();
- for(auto& o : local)
- {
- if (o) {
- o->OnCompleted();
- }
- }
- }
- virtual void OnError(const std::exception_ptr& error)
- {
- std::unique_lock<decltype(Base::lock)> guard(Base::lock);
- Base::state = SubjectState::Error;
- Base::error = error;
- auto local = std::move(Base::observers);
- guard.unlock();
- for(auto& o : local)
- {
- if (o) {
- o->OnError(error);
- }
- }
- }
- };
-
- template <class T>
- class Subject :
- public ObserverSubject<T, ObservableSubject<T, Observable<T>, Subject<T>>>
- {
- };
-
- template <class T>
- std::shared_ptr<Subject<T>> CreateSubject()
- {
- return std::make_shared<Subject<T>>();
- }
-
- template <class K, class T, class Base>
- class GroupedObservableSubject :
- public Base
- {
- K key;
- public:
- GroupedObservableSubject(K key) : key(std::move(key)) {}
-
- virtual K Key() {return key;}
- };
-
- template <class K, class T>
- class GroupedSubject :
- public ObserverSubject<T, GroupedObservableSubject<K, T, ObservableSubject<T, GroupedObservable<K, T>, GroupedSubject<K, T>>>>
- {
- typedef ObserverSubject<T, GroupedObservableSubject<K, T, ObservableSubject<T, GroupedObservable<K, T>, GroupedSubject<K, T>>>> base;
- public:
- GroupedSubject(K key) : base(std::move(key)) {}
- };
-
- template <class T, class K>
- std::shared_ptr<GroupedSubject<K, T>> CreateGroupedSubject(K key)
- {
- return std::make_shared<GroupedSubject<K, T>>(std::move(key));
- }
-
- template <class T>
- class BehaviorSubject :
- public std::enable_shared_from_this<BehaviorSubject<T>>,
- public Observable<T>,
- public Observer<T>
- {
- std::mutex lock;
- size_t slotCount;
- T value;
- SubjectState::type state;
- util::maybe<std::exception_ptr> error;
- std::vector<std::shared_ptr<Observer<T>>> observers;
-
- void RemoveObserver(std::shared_ptr<Observer<T>> toRemove)
- {
- std::unique_lock<decltype(lock)> guard(lock);
- auto it = std::find(begin(observers), end(observers), toRemove);
- if (it != end(observers))
- {
- *it = nullptr;
- ++slotCount;
- }
- }
-
- BehaviorSubject();
- public:
-
- typedef std::shared_ptr<BehaviorSubject<T>> shared;
-
- explicit BehaviorSubject(T t) : slotCount(0), value(std::move(t)), state(SubjectState::Forwarding) {}
-
- virtual ~BehaviorSubject() {
- // putting this first means that the observers
- // will be destructed outside the lock
- std::vector<std::shared_ptr<Observer<T>>> empty;
-
- std::unique_lock<decltype(lock)> guard(lock);
- using std::swap;
- swap(observers, empty);
- }
-
- virtual Disposable Subscribe(std::shared_ptr<Observer<T>> observer)
- {
- std::weak_ptr<Observer<T>> wptr = observer;
- std::weak_ptr<BehaviorSubject> wself = this->shared_from_this();
-
- Disposable d([wptr, wself]{
- if (auto self = wself.lock())
- {
- self->RemoveObserver(wptr.lock());
- }
- });
-
- SubjectState::type localState = SubjectState::Invalid;
- util::maybe<T> localValue;
- util::maybe<std::exception_ptr> localError;
- {
- std::unique_lock<decltype(lock)> guard(lock);
-
- localState = state;
-
- if (state == SubjectState::Forwarding || localState == SubjectState::Completed)
- {
- localValue.set(value);
- }
- else if (localState == SubjectState::Error)
- {
- localError = error;
- }
-
- if (state == SubjectState::Forwarding)
- {
- if (slotCount > 0)
- {
- for(auto& o : observers)
- {
- if (!o)
- {
- o = observer;
- --slotCount;
- break;
- }
- }
- }
- else
- {
- observers.push_back(observer);
- }
- }
- }
-
- if (localState == SubjectState::Completed) {
- observer->OnNext(*localValue.get());
- observer->OnCompleted();
- return Disposable::Empty();
- }
- else if (localState == SubjectState::Error) {
- observer->OnError(*localError.get());
- return Disposable::Empty();
- }
- else if (localState == SubjectState::Forwarding) {
- observer->OnNext(*localValue.get());
- }
-
- return d;
- }
-
- virtual void OnNext(const T& element)
- {
- std::unique_lock<decltype(lock)> guard(lock);
- auto local = observers;
- value = element;
- guard.unlock();
- for(auto& o : local)
- {
- if (o) {
- o->OnNext(element);
- }
- }
- }
- virtual void OnCompleted()
- {
- std::unique_lock<decltype(lock)> guard(lock);
- state = SubjectState::Completed;
- auto local = std::move(observers);
- guard.unlock();
- for(auto& o : local)
- {
- if (o) {
- o->OnCompleted();
- }
- }
- }
- virtual void OnError(const std::exception_ptr& errorArg)
- {
- std::unique_lock<decltype(lock)> guard(lock);
- state = SubjectState::Error;
- error.set(errorArg);
- auto local = std::move(observers);
- guard.unlock();
- for(auto& o : local)
- {
- if (o) {
- o->OnError(errorArg);
- }
- }
- }
- };
-
- template <class T, class Arg>
- std::shared_ptr<BehaviorSubject<T>> CreateBehaviorSubject(Arg a)
- {
- return std::make_shared<BehaviorSubject<T>>(std::move(a));
- }
-
- template <class T>
- class AsyncSubject :
- public std::enable_shared_from_this<AsyncSubject<T>>,
- public Observable<T>,
- public Observer<T>
- {
- std::mutex lock;
- size_t slotCount;
- util::maybe<T> value;
- SubjectState::type state;
- util::maybe<std::exception_ptr> error;
- std::vector < std::shared_ptr < Observer<T >> > observers;
-
- void RemoveObserver(std::shared_ptr < Observer < T >> toRemove)
- {
- std::unique_lock<decltype(lock)> guard(lock);
- auto it = std::find(begin(observers), end(observers), toRemove);
- if (it != end(observers))
- {
- *it = nullptr;
- ++slotCount;
- }
- }
-
- public:
-
- typedef std::shared_ptr<AsyncSubject<T>> shared;
-
- AsyncSubject() : slotCount(0), value(), state(SubjectState::Forwarding) {}
-
- virtual ~AsyncSubject() {
- // putting this first means that the observers
- // will be destructed outside the lock
- std::vector < std::shared_ptr < Observer<T >> > empty;
-
- std::unique_lock<decltype(lock)> guard(lock);
- using std::swap;
- swap(observers, empty);
- }
-
- virtual Disposable Subscribe(std::shared_ptr < Observer < T >> observer)
- {
- std::weak_ptr<Observer<T>> wptr = observer;
- std::weak_ptr<AsyncSubject> wself = this->shared_from_this();
-
- Disposable d([wptr, wself]{
- if (auto self = wself.lock())
- {
- self->RemoveObserver(wptr.lock());
- }
- });
-
- SubjectState::type localState = SubjectState::Invalid;
- util::maybe<T> localValue;
- util::maybe<std::exception_ptr> localError;
- {
- std::unique_lock<decltype(lock)> guard(lock);
-
- localState = state;
-
- if (localState == SubjectState::Completed)
- {
- localValue = value;
- }
- else if (localState == SubjectState::Error)
- {
- localError = error;
- }
- else if (state == SubjectState::Forwarding)
- {
- if (slotCount > 0)
- {
- for (auto& o : observers)
- {
- if (!o)
- {
- o = observer;
- --slotCount;
- break;
- }
- }
- }
- else
- {
- observers.push_back(observer);
- }
- }
- }
-
- if (localState == SubjectState::Completed) {
- if (localValue) {
- observer->OnNext(*localValue.get());
- }
- observer->OnCompleted();
- return Disposable::Empty();
- }
- else if (localState == SubjectState::Error) {
- observer->OnError(*localError.get());
- return Disposable::Empty();
- }
-
- return d;
- }
-
- virtual void OnNext(const T& element)
- {
- std::unique_lock<decltype(lock)> guard(lock);
- if (state == SubjectState::Forwarding) {
- value = element;
- }
- }
- virtual void OnCompleted()
- {
- std::unique_lock<decltype(lock)> guard(lock);
- state = SubjectState::Completed;
- auto local = std::move(observers);
- auto localValue = value;
- guard.unlock();
- for (auto& o : local)
- {
- if (o) {
- if (localValue) {
- o->OnNext(*localValue.get());
- }
- o->OnCompleted();
- }
- }
- }
- virtual void OnError(const std::exception_ptr& errorArg)
- {
- std::unique_lock<decltype(lock)> guard(lock);
- state = SubjectState::Error;
- error.set(errorArg);
- auto local = std::move(observers);
- guard.unlock();
- for (auto& o : local)
- {
- if (o) {
- o->OnError(errorArg);
- }
- }
- }
- };
-
- template <class T>
- std::shared_ptr<AsyncSubject<T>> CreateAsyncSubject()
- {
- return std::make_shared<AsyncSubject<T>>();
- }
-
- template <class Source, class Subject>
- class ConnectableSubject :
- public std::enable_shared_from_this<ConnectableSubject<Source, Subject>>,
- public ConnectableObservable<typename subject_item<Subject>::type>
- {
- private:
- ConnectableSubject();
-
- Source source;
- Subject subject;
- util::maybe<Disposable> subscription;
- std::mutex lock;
-
- public:
- virtual ~ConnectableSubject() {}
-
- ConnectableSubject(Source source, Subject subject) : source(source), subject(subject)
- {
- }
-
- virtual Disposable Connect()
- {
- std::unique_lock<std::mutex> guard(lock);
- if (!subscription)
- {
- subscription.set(source->Subscribe(observer(subject)));
- }
- auto that = this->shared_from_this();
- return Disposable([that]()
- {
- std::unique_lock<std::mutex> guard(that->lock);
- if (!!that->subscription)
- {
- that->subscription->Dispose();
- that->subscription.reset();
- }
- });
- }
-
- virtual Disposable Subscribe(std::shared_ptr < Observer < typename subject_item<Subject>::type >> observer)
- {
- return subject->Subscribe(observer);
- }
- };
-
- template <class F>
- struct fix0_thunk {
- F f;
- fix0_thunk(F&& f) : f(std::move(f))
- {
- }
- Disposable operator()(Scheduler::shared s) const
- {
- return f(s, *this);
- }
- };
- template <class F>
- fix0_thunk<F> fix0(F f)
- {
- return fix0_thunk<F>(std::move(f));
- }
-}
-
-//////////////////////////////////////////////////////////////////////
-//
-// imperative functions
-
-#include "operators/Subscribe.hpp"
-#include "operators/ForEach.hpp"
-#include "operators/Empty.hpp"
-#include "operators/Never.hpp"
-#include "operators/Return.hpp"
-#include "operators/Throw.hpp"
-#include "operators/Range.hpp"
-#include "operators/Random.hpp"
-#include "operators/Interval.hpp"
-#include "operators/Iterate.hpp"
-#include "operators/Using.hpp"
-
-//////////////////////////////////////////////////////////////////////
-//
-// standard query operators
-
-#include "operators/Select.hpp"
-#include "operators/SelectMany.hpp"
-#include "operators/Concat.hpp"
-#include "operators/CombineLatest.hpp"
-#include "operators/Zip.hpp"
-#include "operators/Merge.hpp"
-#include "operators/Where.hpp"
-#include "operators/GroupBy.hpp"
-#include "operators/Multicast.hpp"
-#include "operators/Publish.hpp"
-#include "operators/RefCount.hpp"
-#include "operators/ConnectForever.hpp"
-#include "operators/Scan.hpp"
-#include "operators/Take.hpp"
-#include "operators/Skip.hpp"
-#include "operators/DistinctUntilChanged.hpp"
-#include "operators/ToStdCollection.hpp"
-#include "operators/ToAsync.hpp"
-#include "operators/Materialize.hpp"
-#include "operators/Dematerialize.hpp"
-
-
-//////////////////////////////////////////////////////////////////////
-//
-// shift to Scheduler
-
-#include "operators/SubscribeOnObservable.hpp"
-#include "operators/ObserveOnObserver.hpp"
-
-
-//////////////////////////////////////////////////////////////////////
-//
-// time
-
-#include "operators/Delay.hpp"
-#include "operators/Throttle.hpp"
-
-namespace rxcpp
-{
- class StdQueueDispatcher
- {
- mutable std::queue<std::function<void()>> pending;
- mutable std::condition_variable wake;
- mutable std::mutex pendingLock;
-
- std::function<void()> get() const
- {
- std::function<void()> fn;
- fn = std::move(pending.front());
- pending.pop();
- return std::move(fn);
- }
-
- void dispatch(std::function<void()> fn) const
- {
- if (fn)
- {
- try {
- fn();
- }
- catch(...) {
- std::unexpected();
- }
- }
- }
-
- public:
- template <class Fn>
- void post(Fn fn) const
- {
- {
- std::unique_lock<std::mutex> guard(pendingLock);
- pending.push(std::move(fn));
- }
- wake.notify_one();
- }
-
- void try_dispatch() const
- {
- std::function<void()> fn;
- {
- std::unique_lock<std::mutex> guard(pendingLock);
- if (!pending.empty())
- {
- fn = get();
- }
- }
- dispatch(std::move(fn));
- }
-
- bool dispatch_one() const
- {
- std::function<void()> fn;
- {
- std::unique_lock<std::mutex> guard(pendingLock);
- wake.wait(guard, [this]{ return !pending.empty();});
- fn = get();
- }
- bool result = !!fn;
- dispatch(std::move(fn));
- return result;
- }
- };
-#if defined(OBSERVE_ON_DISPATCHER_OP)
- typedef OBSERVE_ON_DISPATCHER_OP ObserveOnDispatcherOp;
-#else
- typedef StdQueueDispatcher ObserveOnDispatcherOp;
-#endif
-
- template <class T>
- std::shared_ptr<Observable<T>> ObserveOnDispatcher(
- const std::shared_ptr<Observable<T>>& source)
- {
- auto dispatcher = std::make_shared<ObserveOnDispatcherOp>();
-
- return CreateObservable<T>(
- [=](std::shared_ptr<Observer<T>> observer)
- -> Disposable
- {
- auto cancel = std::make_shared<bool>(false);
-
- ComposableDisposable cd;
-
- cd.Add(Disposable([=]{
- *cancel = true;
- }));
- cd.Add(Subscribe(
- source,
- // on next
- [=](const T& element)
- {
- dispatcher->post([=]{
- if (!*cancel)
- observer->OnNext(element);
- });
- },
- // on completed
- [=]
- {
- dispatcher->post([=]{
- if(!*cancel)
- observer->OnCompleted();
- });
- },
- // on error
- [=](const std::exception_ptr& error)
- {
- dispatcher->post([=]{
- if (!*cancel)
- observer->OnError(error);
- });
- }));
- return cd;
- });
- }
-
-}
-
-#endif
diff --git a/Rx/CPP/src/cpprx/rx-scheduler.hpp b/Rx/CPP/src/cpprx/rx-scheduler.hpp
deleted file mode 100644
index ed69bf4..0000000
--- a/Rx/CPP/src/cpprx/rx-scheduler.hpp
+++ /dev/null
@@ -1,947 +0,0 @@
-// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-#pragma once
-#include "rx-includes.hpp"
-
-#if !defined(CPPRX_RX_SCHEDULERS_HPP)
-#define CPPRX_RX_SCHEDULERS_HPP
-
-namespace rxcpp
-{
-
- //////////////////////////////////////////////////////////////////////
- //
- // schedulers
-
- struct CurrentThreadQueue
- {
- typedef Scheduler::clock clock;
- typedef Scheduler::Work Work;
- typedef ScheduledItem<clock::time_point> QueueItem;
-
- private:
- ~CurrentThreadQueue();
-
- struct compare_work
- {
- bool operator()(const QueueItem& work1, const QueueItem& work2) const {
- return work1.due > work2.due;
- }
- };
-
- typedef std::priority_queue<
- QueueItem,
- std::vector<QueueItem>,
- compare_work
- > ScheduledWork;
-
- public:
- struct ThreadLocalQueue {
- Scheduler::shared scheduler;
- ScheduledWork queue;
- };
-
- private:
- static ThreadLocalQueue*& threadLocalQueue() {
- RXCPP_THREAD_LOCAL static ThreadLocalQueue* queue;
- return queue;
- }
-
- public:
-
- static Scheduler::shared GetScheduler() {
- return !!threadLocalQueue() ? threadLocalQueue()->scheduler : Scheduler::shared();
- }
- static bool empty() {
- if (!threadLocalQueue()) {
- abort();
- }
- return threadLocalQueue()->queue.empty();
- }
- static ScheduledWork::const_reference top() {
- if (!threadLocalQueue()) {
- abort();
- }
- return threadLocalQueue()->queue.top();
- }
- static void pop() {
- if (!threadLocalQueue()) {
- abort();
- }
- threadLocalQueue()->queue.pop();
- }
- static void push(QueueItem item) {
- if (!threadLocalQueue()) {
- abort();
- }
- threadLocalQueue()->queue.push(std::move(item));
- }
- static void EnsureQueue(Scheduler::shared scheduler) {
- if (!!threadLocalQueue()) {
- abort();
- }
- // create and publish new queue
- threadLocalQueue() = new ThreadLocalQueue();
- threadLocalQueue()->scheduler = scheduler;
- }
- static std::unique_ptr<ThreadLocalQueue> CreateQueue(Scheduler::shared scheduler) {
- std::unique_ptr<ThreadLocalQueue> result(new ThreadLocalQueue());
- result->scheduler = std::move(scheduler);
- return result;
- }
- static void SetQueue(ThreadLocalQueue* queue) {
- if (!!threadLocalQueue()) {
- abort();
- }
- // publish new queue
- threadLocalQueue() = queue;
- }
- static void DestroyQueue(ThreadLocalQueue* queue) {
- delete queue;
- }
- static void DestroyQueue() {
- if (!threadLocalQueue()) {
- abort();
- }
- DestroyQueue(threadLocalQueue());
- threadLocalQueue() = nullptr;
- }
- };
-
- struct CurrentThreadScheduler : public LocalScheduler
- {
- private:
- CurrentThreadScheduler(const CurrentThreadScheduler&);
-
- struct Derecurser : public LocalScheduler
- {
- private:
- Derecurser(const Derecurser&);
- public:
- Derecurser()
- {
- }
- virtual ~Derecurser()
- {
- }
-
- static bool IsScheduleRequired() { return false; }
-
- using LocalScheduler::Schedule;
- virtual Disposable Schedule(clock::time_point dueTime, Work work)
- {
- CurrentThreadQueue::push(CurrentThreadQueue::QueueItem(dueTime, work));
-
- // work is disposable
- return work;
- }
- };
-
- public:
- CurrentThreadScheduler()
- {
- }
- virtual ~CurrentThreadScheduler()
- {
- }
-
- static bool IsScheduleRequired() { return !CurrentThreadQueue::GetScheduler(); }
-
- using LocalScheduler::Schedule;
- virtual Disposable Schedule(clock::time_point dueTime, Work work)
- {
- auto localScheduler = CurrentThreadQueue::GetScheduler();
- // check ownership
- if (!!localScheduler)
- {
- // already has an owner - delegate
- return localScheduler->Schedule(dueTime, std::move(work));
- }
-
- // take ownership
-
- CurrentThreadQueue::EnsureQueue(std::make_shared<Derecurser>());
- RXCPP_UNWIND_AUTO([]{
- CurrentThreadQueue::DestroyQueue();
- });
-
- CurrentThreadQueue::push(CurrentThreadQueue::QueueItem(dueTime, std::move(work)));
-
- // loop until queue is empty
- for (
- auto dueTime = CurrentThreadQueue::top().due;
- std::this_thread::sleep_until(dueTime), true;
- dueTime = CurrentThreadQueue::top().due
- )
- {
- // dispatch work
- auto work = CurrentThreadQueue::top().work;
-
- CurrentThreadQueue::pop();
-
- Do(work, get());
-
- if (CurrentThreadQueue::empty()) {break;}
- }
-
- return Disposable::Empty();
- }
- };
-
- struct ImmediateScheduler : public LocalScheduler
- {
- private:
- ImmediateScheduler(const ImmediateScheduler&);
-
- mutable std::mutex lock;
- mutable bool hasFaulted;
- mutable bool isAquired;
- mutable CurrentThreadQueue::ThreadLocalQueue* queue;
- public:
- ImmediateScheduler()
- : hasFaulted(false)
- , isAquired(false)
- , queue(nullptr)
- {
- }
- virtual ~ImmediateScheduler()
- {
- }
-
- using LocalScheduler::Schedule;
- virtual Disposable Schedule(clock::time_point dueTime, Work work)
- {
- auto item = CurrentThreadQueue::QueueItem(dueTime, std::move(work));
- bool isOwner = false;
-
- {
- std::unique_lock<std::mutex> guard(lock);
- if (!hasFaulted && !queue && !isAquired)
- {
- queue = CurrentThreadQueue::CreateQueue(this->shared_from_this()).release();
- isOwner = !isAquired;
- isAquired = true;
- }
- }
-
- if (isOwner)
- {
- RXCPP_UNWIND_AUTO([&](){
- std::unique_lock<std::mutex> guard(lock);
- CurrentThreadQueue::DestroyQueue(queue);
- queue = nullptr;
- isAquired = false;
- });
-
- for(;;)
- {
- std::this_thread::sleep_until(item.due);
- try
- {
- Do(item.work, queue->scheduler);
- }
- catch (...)
- {
- std::unique_lock<std::mutex> guard(lock);
- while (!queue->queue.empty()) {queue->queue.pop();}
- hasFaulted = true;
- throw;
- }
-
- {
- std::unique_lock<std::mutex> guard(lock);
- if (queue->queue.empty())
- {
- break;
- }
- item = std::move(queue->queue.top());
- queue->queue.pop();
- }
- }
- return Disposable::Empty();
- }
- else
- {
- std::unique_lock<std::mutex> guard(lock);
- queue->queue.push(item);
- return item.work;
- }
- }
- };
-
- template<class T>
- class ScheduledObserver :
- public Observer<T>,
- public std::enable_shared_from_this<ScheduledObserver<T>>
- {
- typedef std::function<void()> Action;
-
- Scheduler::shared scheduler;
- mutable std::shared_ptr<Observer<T>> observer;
- mutable SerialDisposable sd;
- mutable std::queue<Action> queue;
- mutable std::mutex lock;
- mutable bool hasFaulted;
- mutable bool isAquired;
-
- public:
- ScheduledObserver(Scheduler::shared scheduler, std::shared_ptr<Observer<T>> observer)
- : scheduler(std::move(scheduler))
- , observer(std::move(observer))
- , hasFaulted(false)
- , isAquired(false)
- {
- }
-
- void Dispose() const
- {
- sd.Dispose();
- }
- operator Disposable() const
- {
- auto local = this->shared_from_this();
- return Disposable([local]{
- local->Dispose();
- });
- }
-
- virtual void OnNext(const T& element)
- {
- std::unique_lock<std::mutex> guard(lock);
- queue.push(Action([=](){
- this->observer->OnNext(std::move(element));
- }));
- }
- virtual void OnCompleted()
- {
- std::unique_lock<std::mutex> guard(lock);
- queue.push(Action([=](){
- this->observer->OnCompleted();
- }));
- }
- virtual void OnError(const std::exception_ptr& error)
- {
- std::unique_lock<std::mutex> guard(lock);
- queue.push(Action([=](){
- this->observer->OnError(std::move(error));
- }));
- }
-
- void EnsureActive()
- {
- bool isOwner = false;
-
- {
- std::unique_lock<std::mutex> guard(lock);
- if (!hasFaulted && !queue.empty())
- {
- isOwner = !isAquired;
- isAquired = true;
- }
- }
-
- if (isOwner)
- {
- auto keepAlive = this->shared_from_this();
- sd.Set(scheduler->Schedule(
- [keepAlive](Scheduler::shared sched){
- return keepAlive->Run(sched);}));
- }
- }
-
- private:
- Disposable Run(Scheduler::shared sched)
- {
- auto keepAlive = this->shared_from_this();
-
- Action action;
- {
- std::unique_lock<std::mutex> guard(lock);
- if(!queue.empty())
- {
- action = std::move(queue.front());
- queue.pop();
- }
- else
- {
- isAquired = false;
- return Disposable::Empty();
- }
- }
-
- try
- {
- action();
- }
- catch (...)
- {
- std::unique_lock<std::mutex> guard(lock);
- while (!queue.empty()) {queue.pop();}
- hasFaulted = true;
- throw;
- }
-
- sd.Set(sched->Schedule(
- [keepAlive](Scheduler::shared sched){
- return keepAlive->Run(sched);}));
- return sd;
- }
- };
-
- struct EventLoopScheduler : public LocalScheduler
- {
- private:
- EventLoopScheduler(const EventLoopScheduler&);
-
- struct Derecurser : public std::enable_shared_from_this<Derecurser>
- {
- private:
- Derecurser(const Derecurser&);
-
- mutable bool isAquired;
- mutable std::mutex lock;
- mutable std::condition_variable wake;
- CurrentThreadQueue::ThreadLocalQueue* queue;
-
- public:
- Derecurser()
- : isAquired(false)
- {
- }
- virtual ~Derecurser()
- {
- }
-
- typedef std::function<void()> RunLoop;
- typedef std::function<std::thread(RunLoop)> Factory;
-
- static bool IsScheduleRequired() { return false; }
-
- typedef std::tuple<util::maybe<std::thread>, Disposable> EnsureThreadResult;
- EnsureThreadResult EnsureThread(Factory& factory, Scheduler::shared owner, clock::time_point dueTime, Work work)
- {
- bool isOwner = false;
- EnsureThreadResult result(util::maybe<std::thread>(), Disposable::Empty());
-
- // work is disposable
- std::get<1>(result) = work;
-
- std::unique_lock<std::mutex> guard(lock);
-
- if (!isAquired)
- {
- RXCPP_UNWIND(unwindQueue, [&](){
- CurrentThreadQueue::DestroyQueue(queue); queue = nullptr;});
- queue = CurrentThreadQueue::CreateQueue(owner).release();
-
- queue->queue.push(CurrentThreadQueue::QueueItem(dueTime, std::move(work)));
-
- auto local = std::static_pointer_cast<Derecurser>(shared_from_this());
- auto localQueue = queue;
- std::get<0>(result).set(factory([local, localQueue] {
- local->Run(localQueue);}));
-
- isOwner = !isAquired;
- isAquired = true;
-
- // queue lifetime is now owned by the thread
- unwindQueue.dismiss();
- }
-
- if (!isOwner)
- {
- queue->queue.push(CurrentThreadQueue::QueueItem(dueTime, std::move(work)));
- wake.notify_one();
- }
-
- return std::move(result);
- }
-
- private:
- void Run(CurrentThreadQueue::ThreadLocalQueue* queue) throw() {
- auto keepAlive = shared_from_this();
- {
- std::unique_lock<std::mutex> guard(lock);
-
- RXCPP_UNWIND_AUTO([&]{
- isAquired = false;});
-
- RXCPP_UNWIND(unwindQueue, [&](){
- CurrentThreadQueue::DestroyQueue();
- queue = nullptr;});
-
- CurrentThreadQueue::SetQueue(queue);
-
- while(!CurrentThreadQueue::empty())
- {
- auto now = queue->scheduler->Now();
- if (CurrentThreadQueue::empty()) {
- wake.wait(guard, [&](){
- return !CurrentThreadQueue::empty();});
- continue;
- }
-
- auto item = &CurrentThreadQueue::top();
- if (!item->work) {
- CurrentThreadQueue::pop(); continue;}
-
- // wait until the work is due
- if (now < item->due)
- {
- wake.wait_until(guard, item->due);
- continue;
- }
- // dispatch work
- auto work = item->work;
-
- CurrentThreadQueue::pop();
-
- RXCPP_UNWIND_AUTO([&]{
- guard.lock();});
- guard.unlock();
- LocalScheduler::Do(work, queue->scheduler);
- }
- }
- }
- };
-
- std::thread worker;
- Derecurser::Factory factory;
- std::shared_ptr<Derecurser> derecurser;
-
- public:
- EventLoopScheduler()
- : derecurser(std::make_shared<Derecurser>())
- {
- auto local = derecurser;
- factory = [local] (Derecurser::RunLoop rl) -> std::thread {
- return std::thread([local, rl]{rl();});
- };
- }
- template<class Factory>
- EventLoopScheduler(Factory factoryarg)
- : factory(std::move(factoryarg))
- , derecurser(std::make_shared<Derecurser>())
- {
- }
- virtual ~EventLoopScheduler()
- {
- if (worker.joinable()) {
- worker.detach();
- }
- }
-
- static bool IsScheduleRequired() { return !CurrentThreadQueue::GetScheduler(); }
-
- using LocalScheduler::Schedule;
- virtual Disposable Schedule(clock::time_point dueTime, Work work)
- {
- auto maybeThread = derecurser->EnsureThread(factory, this->shared_from_this(), dueTime, std::move(work));
- if (std::get<0>(maybeThread))
- {
- if (worker.joinable())
- {
- worker.join();
- }
- worker = std::move(*std::get<0>(maybeThread).get());
- }
- return std::move(std::get<1>(maybeThread));
- }
- };
-
- struct NewThreadScheduler : public LocalScheduler
- {
- public:
- typedef std::function<std::thread(std::function<void()>)> Factory;
- private:
- NewThreadScheduler(const NewThreadScheduler&);
-
- Factory factory;
- public:
-
-
- NewThreadScheduler() : factory([](std::function<void()> start){return std::thread(std::move(start));})
- {
- }
- NewThreadScheduler(Factory factory) : factory(factory)
- {
- }
- virtual ~NewThreadScheduler()
- {
- }
-
- using LocalScheduler::Schedule;
- virtual Disposable Schedule(clock::time_point dueTime, Work work)
- {
- auto scheduler = std::make_shared<EventLoopScheduler>(factory);
- return scheduler->Schedule(dueTime, work);
- }
- };
-
- template<class Absolute, class Relative>
- class VirtualTimeScheduler : public VirtualTimeSchedulerBase<Absolute, Relative>
- {
- private:
- VirtualTimeScheduler(const VirtualTimeScheduler&);
-
- typedef VirtualTimeSchedulerBase<Absolute, Relative> Base;
-
- typedef typename Base::QueueItem QueueItem;
-
- struct compare_work
- {
- bool operator()(const QueueItem& work1, const QueueItem& work2) const {
- return work1.due > work2.due;
- }
- };
-
- typedef std::priority_queue<
- QueueItem,
- std::vector<QueueItem>,
- compare_work
- > ScheduledWork;
-
- ScheduledWork queue;
-
- public:
- typedef typename Base::clock clock;
- typedef typename Base::Work Work;
-
- virtual ~VirtualTimeScheduler()
- {
- }
-
- protected:
- VirtualTimeScheduler()
- {
- }
- explicit VirtualTimeScheduler(Absolute initialClock)
- : Base(initialClock)
- {
- }
-
- virtual util::maybe<QueueItem> GetNext() {
- util::maybe<QueueItem> next;
- while (!queue.empty()) {
- next.set(queue.top());
- if (!next->work) {
- queue.pop();
- }
- else {
- return next;
- }
- }
- return next;
- }
-
- Disposable ScheduleAbsolute(Absolute dueTime, Work work)
- {
- Work cancelable;
-
- auto run = [cancelable, work](Scheduler::shared scheduler) -> Disposable {
- auto local = work;
- cancelable.Dispose();
- return Base::Do(local, std::move(scheduler));
- };
-
- cancelable = run;
-
- auto si = QueueItem(dueTime, cancelable);
- queue.push(si);
-
- return cancelable;
- }
-
- };
-
- class TestScheduler : public VirtualTimeScheduler<long, long>
- {
- public:
- typedef VirtualTimeScheduler<long, long> Base;
- typedef Base::clock clock;
- typedef Base::Work Work;
- typedef std::shared_ptr<TestScheduler> shared;
-
- static const long Created = 100;
- static const long Subscribed = 200;
- static const long Disposed = 1000;
-
- template<class T>
- struct Messages
- {
- typedef Recorded<std::shared_ptr<Notification<T>>> RecordedT;
-
- static
- RecordedT OnNext(long ticks, T value)
- {
- return RecordedT(ticks, Notification<T>::CreateOnNext(value));
- }
-
- static
- RecordedT OnCompleted(long ticks)
- {
- return RecordedT(ticks, Notification<T>::CreateOnCompleted());
- }
-
- static
- RecordedT OnError(long ticks, std::exception_ptr ep)
- {
- return RecordedT(ticks, Notification<T>::CreateOnError(ep));
- }
-
- template<class Exception>
- static
- RecordedT OnError(long ticks, Exception e)
- {
- return RecordedT(ticks, Notification<T>::CreateOnError(e));
- }
-
- static
- Subscription Subscribe(long subscribe, long unsubscribe)
- {
- return Subscription(subscribe, unsubscribe);
- }
-
- template<class Item, size_t size>
- static
- auto ToVector(const Item (&arr) [size]) -> std::vector<Item> {
- return std::vector<Item>(std::begin(arr), std::end(arr));
- }
-
- private:
- ~Messages();
- };
-
- virtual Disposable ScheduleAbsolute(long dueTime, Work work)
- {
- if (dueTime <= Base::clock_now)
- dueTime = Base::clock_now + 1;
-
- return Base::ScheduleAbsolute(dueTime, std::move(work));
- }
-
- virtual long Add(long absolute, long relative)
- {
- return absolute + relative;
- }
-
- virtual clock::time_point ToTimePoint(long absolute)
- {
- return clock::time_point(clock::duration(absolute));
- }
-
- virtual long ToRelative(clock::duration d)
- {
- return static_cast<long>(d.count());
- }
-
- using Base::Start;
-
- template<class T>
- std::shared_ptr<TestableObserver<T>> Start(std::function<std::shared_ptr<Observable<T>>()> create, long created, long subscribed, long disposed)
- {
- auto observer = CreateObserver<T>();
-
- struct State
- {
- std::shared_ptr<Observable<T>> source;
- SerialDisposable subscription;
- std::shared_ptr<TestableObserver<T>> observer;
- };
- auto state = std::make_shared<State>();
-
- state->observer = observer;
-
- ScheduleAbsolute(created, [create, state](Scheduler::shared scheduler) -> Disposable {
- state->source = create(); return Disposable::Empty(); });
- ScheduleAbsolute(subscribed, [state](Scheduler::shared scheduler) -> Disposable {
- state->subscription.Set(state->source->Subscribe(state->observer)); return Disposable::Empty(); });
- ScheduleAbsolute(disposed, [state](Scheduler::shared scheduler) -> Disposable {
- state->subscription.Dispose(); return Disposable::Empty(); });
-
- Start();
-
- return observer;
- }
-
- template<class T>
- std::shared_ptr<TestableObserver<T>> Start(std::function<std::shared_ptr<Observable<T>>()> create, long disposed)
- {
- return Start(create, Created, Subscribed, disposed);
- }
-
- template<class T>
- std::shared_ptr<TestableObserver<T>> Start(std::function<std::shared_ptr<Observable<T>>()> create)
- {
- return Start(create, Created, Subscribed, Disposed);
- }
-
- template<class T>
- std::shared_ptr<TestableObservable<T>> CreateHotObservable(std::vector<Recorded<std::shared_ptr<Notification<T>>>> messages);
-
- template<class T>
- std::shared_ptr<TestableObservable<T>> CreateColdObservable(std::vector<Recorded<std::shared_ptr<Notification<T>>>> messages);
-
- template<class T>
- std::shared_ptr<TestableObserver<T>> CreateObserver();
- };
-
- template<class T>
- class MockObserver : public TestableObserver<T>
- {
- typedef Notification<T> NotificationT;
- typedef Recorded<std::shared_ptr<Notification<T>>> RecordedT;
-
- TestScheduler::shared scheduler;
- std::vector<RecordedT> messages;
-
- public:
- MockObserver(TestScheduler::shared scheduler)
- : scheduler(scheduler)
- {
- }
-
- virtual void OnNext(const T& value)
- {
- messages.push_back(RecordedT(scheduler->Clock(), NotificationT::CreateOnNext(value)));
- }
-
- virtual void OnError(const std::exception_ptr& exception)
- {
- messages.push_back(RecordedT(scheduler->Clock(), NotificationT::CreateOnError(exception)));
- }
-
- virtual void OnCompleted()
- {
- messages.push_back(RecordedT(scheduler->Clock(), NotificationT::CreateOnCompleted()));
- }
-
- std::vector<RecordedT> Messages()
- {
- return messages;
- }
- };
-
- template<class T>
- std::shared_ptr<TestableObserver<T>> TestScheduler::CreateObserver()
- {
- return std::make_shared<MockObserver<T>>(std::static_pointer_cast<TestScheduler>(shared_from_this()));
- }
-
- template<class T>
- class ColdObservable : public TestableObservable<T>, public std::enable_shared_from_this<ColdObservable<T>>
- {
- TestScheduler::shared scheduler;
- typedef Recorded<std::shared_ptr<Notification<T>>> RecordedT;
- std::vector<RecordedT> messages;
- std::vector<Subscription> subscriptions;
-
- public:
-
- ColdObservable(TestScheduler::shared scheduler, std::vector<RecordedT> messages)
- : scheduler(scheduler)
- , messages(std::move(messages))
- {
- }
-
- template<class Iterator>
- ColdObservable(TestScheduler::shared scheduler, Iterator begin, Iterator end)
- : scheduler(scheduler)
- , messages(begin, end)
- {
- }
-
- virtual Disposable Subscribe(std::shared_ptr<Observer<T>> observer)
- {
- subscriptions.push_back(Subscription(scheduler->Clock()));
- auto index = subscriptions.size() - 1;
-
- ComposableDisposable d;
-
- for (auto& message : messages) {
- auto notification = message.Value();
- d.Add(scheduler->ScheduleRelative(message.Time(), [notification, observer](Scheduler::shared) -> Disposable {
- notification->Accept(observer); return Disposable::Empty();
- }));
- }
-
- auto sharedThis = this->shared_from_this();
- return Disposable([sharedThis, index, d]() {
- sharedThis->subscriptions[index] = Subscription(sharedThis->subscriptions[index].Subscribe(), sharedThis->scheduler->Clock());
- d.Dispose();
- });
- }
-
- virtual std::vector<Subscription> Subscriptions() {
- return subscriptions;
- }
-
- virtual std::vector<Recorded<std::shared_ptr<Notification<T>>>> Messages() {
- return messages;
- }
- };
-
- template<class T>
- std::shared_ptr<TestableObservable<T>> TestScheduler::CreateColdObservable(std::vector<Recorded<std::shared_ptr<Notification<T>>>> messages)
- {
- return std::make_shared<ColdObservable<T>>(std::static_pointer_cast<TestScheduler>(shared_from_this()), std::move(messages));
- }
-
- template<class T>
- class HotObservable : public TestableObservable<T>, public std::enable_shared_from_this<HotObservable<T>>
- {
- TestScheduler::shared scheduler;
- typedef Recorded<std::shared_ptr<Notification<T>>> RecordedT;
- std::vector<RecordedT> messages;
- std::vector<Subscription> subscriptions;
- std::vector<std::shared_ptr<Observer<T>>> observers;
-
- public:
-
- HotObservable(TestScheduler::shared scheduler, std::vector<RecordedT> messages)
- : scheduler(scheduler)
- , messages(messages)
- {
- for (auto& message : messages) {
- auto notification = message.Value();
- scheduler->ScheduleAbsolute(message.Time(), [this, notification](Scheduler::shared) -> Disposable {
- auto local = this->observers;
- for (auto& observer : local) {
- notification->Accept(observer);
- }
- return Disposable::Empty();
- });
- }
- }
-
- virtual Disposable Subscribe(std::shared_ptr<Observer<T>> observer)
- {
- observers.push_back(observer);
- subscriptions.push_back(Subscription(scheduler->Clock()));
- auto index = subscriptions.size() - 1;
-
- auto sharedThis = this->shared_from_this();
- return Disposable([sharedThis, index, observer]() {
- sharedThis->observers.erase(std::find(sharedThis->observers.begin(), sharedThis->observers.end(), observer));
- sharedThis->subscriptions[index] = Subscription(sharedThis->subscriptions[index].Subscribe(), sharedThis->scheduler->Clock());
- });
- }
-
- virtual std::vector<Subscription> Subscriptions() {
- return subscriptions;
- }
-
- virtual std::vector<Recorded<std::shared_ptr<Notification<T>>>> Messages() {
- return messages;
- }
- };
-
- template<class T>
- std::shared_ptr<TestableObservable<T>> TestScheduler::CreateHotObservable(std::vector<Recorded<std::shared_ptr<Notification<T>>>> messages)
- {
- return std::make_shared<HotObservable<T>>(std::static_pointer_cast<TestScheduler>(shared_from_this()), std::move(messages));
- }
-
-}
-
-#endif
diff --git a/Rx/CPP/src/cpprx/rx-util.hpp b/Rx/CPP/src/cpprx/rx-util.hpp
deleted file mode 100644
index 92ef223..0000000
--- a/Rx/CPP/src/cpprx/rx-util.hpp
+++ /dev/null
@@ -1,509 +0,0 @@
-// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-#pragma once
-#include "rx-includes.hpp"
-
-#if !defined(CPPRX_RX_UTIL_HPP)
-#define CPPRX_RX_UTIL_HPP
-
-#if !defined(RXCPP_THREAD_LOCAL)
-#if defined(_MSC_VER)
-#define RXCPP_THREAD_LOCAL __declspec(thread)
-#else
-#define RXCPP_THREAD_LOCAL __thread
-#endif
-#endif
-
-#if !defined(RXCPP_SELECT_ANY)
-#if defined(_MSC_VER)
-#define RXCPP_SELECT_ANY __declspec(selectany)
-#else
-#define RXCPP_SELECT_ANY
-#endif
-#endif
-
-#define RXCPP_CONCAT(Prefix, Suffix) Prefix ## Suffix
-#define RXCPP_CONCAT_EVALUATE(Prefix, Suffix) RXCPP_CONCAT(Prefix, Suffix)
-
-#define RXCPP_MAKE_IDENTIFIER(Prefix) RXCPP_CONCAT_EVALUATE(Prefix, __LINE__)
-
-namespace rxcpp { namespace util {
-
- template<class Type>
- struct identity
- {
- typedef Type type;
- Type operator()(const Type& left) const {return left;}
- };
-
- template <class T>
- class maybe
- {
- bool is_set;
- typename std::aligned_storage<sizeof(T), std::alignment_of<T>::value>::type
- storage;
- public:
- maybe()
- : is_set(false)
- {
- }
-
- maybe(T value)
- : is_set(false)
- {
- new (reinterpret_cast<T*>(&storage)) T(value);
- is_set = true;
- }
-
- maybe(const maybe& other)
- : is_set(false)
- {
- if (other.is_set) {
- new (reinterpret_cast<T*>(&storage)) T(*other.get());
- is_set = true;
- }
- }
- maybe(maybe&& other)
- : is_set(false)
- {
- if (other.is_set) {
- new (reinterpret_cast<T*>(&storage)) T(std::move(*other.get()));
- is_set = true;
- other.reset();
- }
- }
-
- ~maybe()
- {
- reset();
- }
-
- void reset()
- {
- if (is_set) {
- is_set = false;
- reinterpret_cast<T*>(&storage)->~T();
- }
- }
-
- T* get() {
- return is_set ? reinterpret_cast<T*>(&storage) : 0;
- }
-
- const T* get() const {
- return is_set ? reinterpret_cast<const T*>(&storage) : 0;
- }
-
- void set(T value) {
- if (is_set) {
- *reinterpret_cast<T*>(&storage) = std::move(value);
- } else {
- new (reinterpret_cast<T*>(&storage)) T(std::move(value));
- is_set = true;
- }
- }
-
- T& operator*() { return *get(); }
- const T& operator*() const { return *get(); }
- T* operator->() { return get(); }
- const T* operator->() const { return get(); }
-
- maybe& operator=(const T& other) {
- set(other);
- return *this;
- }
- maybe& operator=(const maybe& other) {
- if (const T* pother = other.get()) {
- set(*pother);
- } else {
- reset();
- }
- return *this;
- }
-
- // boolean-like operators
- operator T*() { return get(); }
- operator const T*() const { return get(); }
-
- private:
-
- };
-
- template<class T>
- struct reveal_type {private: reveal_type();};
-
-#if RXCPP_USE_VARIADIC_TEMPLATES
- template <int... Indices>
- struct tuple_indices;
- template <>
- struct tuple_indices<-1> { // for an empty std::tuple<> there is no entry
- typedef tuple_indices<> type;
- };
- template <int... Indices>
- struct tuple_indices<0, Indices...> { // stop the recursion when 0 is reached
- typedef tuple_indices<0, Indices...> type;
- };
- template <int Index, int... Indices>
- struct tuple_indices<Index, Indices...> { // recursively build a sequence of indices
- typedef typename tuple_indices<Index - 1, Index, Indices...>::type type;
- };
-
- template <typename T>
- struct make_tuple_indices {
- typedef typename tuple_indices<std::tuple_size<T>::value - 1>::type type;
- };
-
- namespace detail {
- template<class T>
- struct tuple_dispatch;
- template<size_t... DisptachIndices>
- struct tuple_dispatch<tuple_indices<DisptachIndices...>> {
- template<class F, class T>
- static
- auto call(F&& f, T&& t)
- -> decltype (std::forward<F>(f)(std::get<DisptachIndices>(std::forward<T>(t))...)) {
- return std::forward<F>(f)(std::get<DisptachIndices>(std::forward<T>(t))...);
- }
- };}
-
- template<class F, class T>
- auto tuple_dispatch(F&& f, T&& t)
- -> decltype(detail::tuple_dispatch<typename make_tuple_indices<typename std::decay<T>::type>::type>::call(std::forward<F>(f), std::forward<T>(t))) {
- return detail::tuple_dispatch<typename make_tuple_indices<typename std::decay<T>::type>::type>::call(std::forward<F>(f), std::forward<T>(t));
- }
-
- namespace detail {
- template<class T>
- struct tuple_tie;
- template<size_t... TIndices>
- struct tuple_tie<tuple_indices<TIndices...>> {
- template<class T>
- static
- auto tie(T&& t)
- -> decltype (std::tie(std::get<TIndices>(std::forward<T>(t))...)) {
- return std::tie(std::get<TIndices>(std::forward<T>(t))...);
- }
- };}
-
- template<class T>
- auto tuple_tie(T&& t)
- -> decltype(detail::tuple_tie<typename make_tuple_indices<typename std::decay<T>::type>::type>::tie(std::forward<T>(t))) {
- return detail::tuple_tie<typename make_tuple_indices<typename std::decay<T>::type>::type>::tie(std::forward<T>(t));
- }
-
- struct as_tuple {
- template<class... AsTupleNext>
- auto operator()(AsTupleNext... x)
- -> decltype(std::make_tuple(std::move(x)...)) {
- return std::make_tuple(std::move(x)...);}
- template<class... AsTupleNext>
- auto operator()(AsTupleNext... x) const
- -> decltype(std::make_tuple(std::move(x)...)) {
- return std::make_tuple(std::move(x)...);}
- };
-#else
- namespace detail {
- template<size_t TupleSize>
- struct tuple_dispatch;
- template<>
- struct tuple_dispatch<0> {
- template<class F, class T>
- static auto call(F&& f, T&& )
- -> decltype (std::forward<F>(f)()) {
- return std::forward<F>(f)();}
- };
- template<>
- struct tuple_dispatch<1> {
- template<class F, class T>
- static auto call(F&& f, T&& t)
- -> decltype (std::forward<F>(f)(std::get<0>(std::forward<T>(t)))) {
- return std::forward<F>(f)(std::get<0>(std::forward<T>(t)));}
- };
- template<>
- struct tuple_dispatch<2> {
- template<class F, class T>
- static auto call(F&& f, T&& t)
- -> decltype (std::forward<F>(f)(
- std::get<0>(std::forward<T>(t)),
- std::get<1>(std::forward<T>(t)))) {
- return std::forward<F>(f)(
- std::get<0>(std::forward<T>(t)),
- std::get<1>(std::forward<T>(t)));}
- };
- template<>
- struct tuple_dispatch<3> {
- template<class F, class T>
- static auto call(F&& f, T&& t)
- -> decltype (std::forward<F>(f)(
- std::get<0>(std::forward<T>(t)),
- std::get<1>(std::forward<T>(t)),
- std::get<2>(std::forward<T>(t)))) {
- return std::forward<F>(f)(
- std::get<0>(std::forward<T>(t)),
- std::get<1>(std::forward<T>(t)),
- std::get<2>(std::forward<T>(t)));}
- };
- template<>
- struct tuple_dispatch<4> {
- template<class F, class T>
- static auto call(F&& f, T&& t)
- -> decltype (std::forward<F>(f)(
- std::get<0>(std::forward<T>(t)),
- std::get<1>(std::forward<T>(t)),
- std::get<2>(std::forward<T>(t)),
- std::get<3>(std::forward<T>(t)))) {
- return std::forward<F>(f)(
- std::get<0>(std::forward<T>(t)),
- std::get<1>(std::forward<T>(t)),
- std::get<2>(std::forward<T>(t)),
- std::get<3>(std::forward<T>(t)));}
- };
- template<>
- struct tuple_dispatch<5> {
- template<class F, class T>
- static auto call(F&& f, T&& t)
- -> decltype (std::forward<F>(f)(
- std::get<0>(std::forward<T>(t)),
- std::get<1>(std::forward<T>(t)),
- std::get<2>(std::forward<T>(t)),
- std::get<3>(std::forward<T>(t)),
- std::get<4>(std::forward<T>(t)))) {
- return std::forward<F>(f)(
- std::get<0>(std::forward<T>(t)),
- std::get<1>(std::forward<T>(t)),
- std::get<2>(std::forward<T>(t)),
- std::get<3>(std::forward<T>(t)),
- std::get<4>(std::forward<T>(t)));}
- };
- }
-
- template<class F, class T>
- auto tuple_dispatch(F&& f, T&& t)
- -> decltype(detail::tuple_dispatch<std::tuple_size<typename std::decay<T>::type>::value>::call(std::forward<F>(f), std::forward<T>(t))) {
- return detail::tuple_dispatch<std::tuple_size<typename std::decay<T>::type>::value>::call(std::forward<F>(f), std::forward<T>(t));
- }
-
- struct as_tuple {
- auto operator()()
- -> decltype(std::make_tuple()) {
- return std::make_tuple();}
- template<class AsTupleNext>
- auto operator()(AsTupleNext x)
- -> decltype(std::make_tuple(std::move(x))) {
- return std::make_tuple(std::move(x));}
- template<
- class AsTupleNext1,
- class AsTupleNext2>
- auto operator()(
- AsTupleNext1 x1,
- AsTupleNext2 x2)
- -> decltype(std::make_tuple(
- std::move(x1),
- std::move(x2))) {
- return std::make_tuple(
- std::move(x1),
- std::move(x2));}
- template<
- class AsTupleNext1,
- class AsTupleNext2,
- class AsTupleNext3>
- auto operator()(
- AsTupleNext1 x1,
- AsTupleNext2 x2,
- AsTupleNext3 x3)
- -> decltype(std::make_tuple(
- std::move(x1),
- std::move(x2),
- std::move(x3))) {
- return std::make_tuple(
- std::move(x1),
- std::move(x2),
- std::move(x3));}
- template<
- class AsTupleNext1,
- class AsTupleNext2,
- class AsTupleNext3,
- class AsTupleNext4>
- auto operator()(
- AsTupleNext1 x1,
- AsTupleNext2 x2,
- AsTupleNext3 x3,
- AsTupleNext4 x4)
- -> decltype(std::make_tuple(
- std::move(x1),
- std::move(x2),
- std::move(x3),
- std::move(x4))) {
- return std::make_tuple(
- std::move(x1),
- std::move(x2),
- std::move(x3),
- std::move(x4));}
- template<
- class AsTupleNext1,
- class AsTupleNext2,
- class AsTupleNext3,
- class AsTupleNext4,
- class AsTupleNext5>
- auto operator()(
- AsTupleNext1 x1,
- AsTupleNext2 x2,
- AsTupleNext3 x3,
- AsTupleNext4 x4,
- AsTupleNext5 x5)
- -> decltype(std::make_tuple(
- std::move(x1),
- std::move(x2),
- std::move(x3),
- std::move(x4),
- std::move(x5))) {
- return std::make_tuple(
- std::move(x1),
- std::move(x2),
- std::move(x3),
- std::move(x4),
- std::move(x5));}
-
- auto operator()() const
- -> decltype(std::make_tuple()) {
- return std::make_tuple();}
- template<class AsTupleNext>
- auto operator()(AsTupleNext x) const
- -> decltype(std::make_tuple(std::move(x))) {
- return std::make_tuple(std::move(x));}
- template<
- class AsTupleNext1,
- class AsTupleNext2>
- auto operator()(
- AsTupleNext1 x1,
- AsTupleNext2 x2) const
- -> decltype(std::make_tuple(
- std::move(x1),
- std::move(x2))) {
- return std::make_tuple(
- std::move(x1),
- std::move(x2));}
- template<
- class AsTupleNext1,
- class AsTupleNext2,
- class AsTupleNext3>
- auto operator()(
- AsTupleNext1 x1,
- AsTupleNext2 x2,
- AsTupleNext3 x3) const
- -> decltype(std::make_tuple(
- std::move(x1),
- std::move(x2),
- std::move(x3))) {
- return std::make_tuple(
- std::move(x1),
- std::move(x2),
- std::move(x3));}
- template<
- class AsTupleNext1,
- class AsTupleNext2,
- class AsTupleNext3,
- class AsTupleNext4>
- auto operator()(
- AsTupleNext1 x1,
- AsTupleNext2 x2,
- AsTupleNext3 x3,
- AsTupleNext4 x4) const
- -> decltype(std::make_tuple(
- std::move(x1),
- std::move(x2),
- std::move(x3),
- std::move(x4))) {
- return std::make_tuple(
- std::move(x1),
- std::move(x2),
- std::move(x3),
- std::move(x4));}
- template<
- class AsTupleNext1,
- class AsTupleNext2,
- class AsTupleNext3,
- class AsTupleNext4,
- class AsTupleNext5>
- auto operator()(
- AsTupleNext1 x1,
- AsTupleNext2 x2,
- AsTupleNext3 x3,
- AsTupleNext4 x4,
- AsTupleNext5 x5) const
- -> decltype(std::make_tuple(
- std::move(x1),
- std::move(x2),
- std::move(x3),
- std::move(x4),
- std::move(x5))) {
- return std::make_tuple(
- std::move(x1),
- std::move(x2),
- std::move(x3),
- std::move(x4),
- std::move(x5));}
- };
-#endif //RXCPP_USE_VARIADIC_TEMPLATES
-
- struct pass_through {
- template<class X>
- typename std::decay<X>::type operator()(X&& x) {return std::forward<X>(x);}
- template<class X>
- typename std::decay<X>::type operator()(X&& x) const {return std::forward<X>(x);}
- };
-
- struct pass_through_second {
- template<class X, class Y>
- typename std::decay<Y>::type operator()(X&& , Y&& y) {return std::forward<Y>(y);}
- template<class X, class Y>
- typename std::decay<Y>::type operator()(X&& , Y&& y) const {return std::forward<Y>(y);}
- };
-
- template<typename Function>
- class unwinder
- {
- public:
- ~unwinder()
- {
- if (!!function)
- {
- try {
- (*function)();
- } catch (...) {
- std::unexpected();
- }
- }
- }
-
- explicit unwinder(Function* functionArg)
- : function(functionArg)
- {
- }
-
- void dismiss()
- {
- function = nullptr;
- }
-
- private:
- unwinder();
- unwinder(const unwinder&);
- unwinder& operator=(const unwinder&);
-
- Function* function;
- };
-
-}}
-
-#define RXCPP_UNWIND(Name, Function) \
- RXCPP_UNWIND_EXPLICIT(uwfunc_ ## Name, Name, Function)
-
-#define RXCPP_UNWIND_AUTO(Function) \
- RXCPP_UNWIND_EXPLICIT(RXCPP_MAKE_IDENTIFIER(uwfunc_), RXCPP_MAKE_IDENTIFIER(unwind_), Function)
-
-#define RXCPP_UNWIND_EXPLICIT(FunctionName, UnwinderName, Function) \
- auto FunctionName = (Function); \
- rxcpp::util::unwinder<decltype(FunctionName)> UnwinderName(std::addressof(FunctionName))
-
-#endif \ No newline at end of file
diff --git a/Rx/CPP/src/cpprx/rx-windows.hpp b/Rx/CPP/src/cpprx/rx-windows.hpp
deleted file mode 100644
index 06b2fb9..0000000
--- a/Rx/CPP/src/cpprx/rx-windows.hpp
+++ /dev/null
@@ -1,282 +0,0 @@
-// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-#pragma once
-#include "rx-includes.hpp"
-
-#if !defined(CPPRX_RX_WINDOWS_HPP)
-#define CPPRX_RX_WINDOWS_HPP
-#pragma once
-
-#if (!defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP)) && (defined(WINDOWS) || defined(WIN32) || defined(_WIN32))
-
-#pragma comment(lib, "user32.lib")
-
-#define NOMINMAX
-#include <Windows.h>
-
-namespace rxcpp { namespace win32 {
-
-
-#if !defined(OBSERVE_ON_DISPATCHER_OP)
-#define OBSERVE_ON_DISPATCHER_OP rxcpp::win32::ObserveOnDispatcherOp
-#endif
-
- struct ObserveOnDispatcherOp
- {
- HWND hwnd;
-
- ObserveOnDispatcherOp(): hwnd(WindowClass::Instance().CreateWindow_())
- {
- if (!hwnd)
- throw std::exception("error");
- }
- ~ObserveOnDispatcherOp()
- {
- // send one last message to ourselves to shutdown.
- post([=]{ CloseWindow(hwnd); });
- }
-
- struct WindowClass
- {
- static const wchar_t* const className(){ return L"ObserveOnDispatcherOp::WindowClass"; }
- WindowClass()
- {
- WNDCLASS wndclass = {};
- wndclass.style = 0;
- wndclass.lpfnWndProc = &WndProc;
- wndclass.cbClsExtra;
- wndclass.cbWndExtra = 0;
- wndclass.hInstance = NULL;
- wndclass.lpszClassName = className();
-
- if (!RegisterClass(&wndclass))
- throw std::exception("error");
-
- }
- HWND CreateWindow_()
- {
- return CreateWindowEx(0, WindowClass::className(), L"MessageOnlyWindow", 0, 0, 0, 0, 0, HWND_MESSAGE, 0, 0, 0);
- }
- static const int WM_USER_DISPATCH = WM_USER + 1;
-
- static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
- {
- switch (message)
- {
- // TODO: shatter attack surface. should validate the message, e.g. using a handle table.
- case WM_USER_DISPATCH:
- ((void(*)(void*))wParam)((void*)lParam);
- return 0;
- default:
- return DefWindowProc(hwnd, message, wParam, lParam);
- }
- }
- static WindowClass& Instance() {
- static WindowClass instance;
- return instance;
- }
- };
-
- template <class Fn>
- void post(Fn fn) const
- {
- std::unique_ptr<Fn> f(new Fn(fn));
- ::PostMessage(hwnd, WindowClass::WM_USER_DISPATCH, (WPARAM)(void(*)(void*))&run_proc<Fn>, (LPARAM)(void*)f.release());
- }
- template <class Fn>
- static void run_proc(
- void* pvfn
- )
- {
- std::unique_ptr<Fn> f((Fn*)(void*) pvfn);
- (*f.get())();
- }
- };
-
- class WindowScheduler : public rxcpp::LocalScheduler
- {
-
- struct compare_work
- {
- template <class T>
- bool operator()(const T& work1, const T& work2) const {
- return work1.first > work2.first;
- }
- };
-
- struct Queue;
-
- typedef std::pair<Scheduler::shared, Work> Item;
- typedef std::pair<clock::time_point, std::shared_ptr<Item>> PriorityItem;
-
- typedef std::priority_queue<
- PriorityItem,
- std::vector<PriorityItem>,
- compare_work
- > ScheduledWork;
-
- struct Queue
- {
- Queue() : exit(false), window(NULL) {}
- bool exit;
- HWND window;
- ScheduledWork scheduledWork;
- mutable std::mutex lock;
- };
-
- struct WindowClass
- {
- std::shared_ptr<Queue> queue;
-
- static const wchar_t* const className(){ return L"rxcpp::win32::WindowScheduler::WindowClass"; }
- WindowClass()
- {
- }
-
- static void Create(const std::shared_ptr<Queue>& queue)
- {
- WNDCLASSW wndclass = {};
- wndclass.style = 0;
- wndclass.lpfnWndProc = &WndProc;
- wndclass.cbWndExtra = 0;
- wndclass.hInstance = NULL;
- wndclass.lpszClassName = className();
-
- RegisterClassW(&wndclass);
-
- std::unique_ptr<WindowClass> that(new WindowClass);
- that->queue = queue;
-
- queue->window = CreateWindowExW(0, WindowClass::className(), L"MessageOnlyWindow", 0, 0, 0, 0, 0, HWND_MESSAGE, 0, 0, reinterpret_cast<LPVOID>(that.get()));
- if (!queue->window)
- throw std::exception("create window failed");
-
- that.release();
- }
-
- static const int WM_USER_DISPATCH = WM_USER + 1;
-
- static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) throw()
- {
- WindowClass* windowClass = reinterpret_cast<WindowClass*>(GetWindowLongPtr(hwnd, GWLP_USERDATA));
- switch (message)
- {
- case WM_NCCREATE:
- {
- windowClass = reinterpret_cast<WindowClass*>(reinterpret_cast<LPCREATESTRUCT>(lParam)->lpCreateParams);
- SetWindowLongPtr(hwnd, GWLP_USERDATA, reinterpret_cast<LONG>(reinterpret_cast<LPVOID>(windowClass)));
- }
- break;
- case WM_NCDESTROY:
- {
- delete windowClass;
- SetWindowLongPtr(hwnd, GWLP_USERDATA, 0L);
- }
- break;
- case WM_TIMER:
- case WM_USER_DISPATCH:
- {
- bool destroy = false;
- HWND window = NULL;
- std::vector<std::shared_ptr<Item>> expired;
- {
- std::unique_lock<std::mutex> guard(windowClass->queue->lock);
-
- while (!windowClass->queue->scheduledWork.empty() && !windowClass->queue->scheduledWork.top().second.get()->second)
- {
- // discard the disposed items
- expired.push_back(windowClass->queue->scheduledWork.top().second);
- windowClass->queue->scheduledWork.pop();
- }
-
- if (!windowClass->queue->scheduledWork.empty())
- {
- auto& item = windowClass->queue->scheduledWork.top();
- auto now = item.second.get()->first->Now();
-
- // wait until the work is due
- if(now < item.first)
- {
- auto remaining = std::chrono::duration_cast<std::chrono::milliseconds>(item.first - now).count();
- if (remaining >= USER_TIMER_MINIMUM)
- {
- return SetTimer(hwnd, 0, static_cast<UINT>(remaining), nullptr);
- }
- std::this_thread::sleep_until(item.first);
- }
-
- // dispatch work
- auto work = std::move(item.second.get()->second);
- auto scheduler = std::move(item.second.get()->first);
- windowClass->queue->scheduledWork.pop();
-
- {
- RXCPP_UNWIND_AUTO([&]{guard.lock();});
- guard.unlock();
- LocalScheduler::Do(work, scheduler);
- work = nullptr;
- scheduler = nullptr;
- }
-
- if (!windowClass->queue->scheduledWork.empty())
- {
- ::PostMessageW(windowClass->queue->window, WindowClass::WM_USER_DISPATCH, 0, 0);
- }
- }
-
- destroy = windowClass->queue->exit && windowClass->queue->scheduledWork.empty();
- window = windowClass->queue->window;
- }
-
- if (destroy)
- {
- DestroyWindow(window);
- }
- }
- return 0;
- default:
- break;
- }
- return DefWindowProcW(hwnd, message, wParam, lParam);
- }
- };
- std::shared_ptr<Queue> queue;
-
- public:
- WindowScheduler()
- : queue(std::make_shared<Queue>())
- {
- WindowClass::Create(queue);
- }
- ~WindowScheduler()
- {
- // send one last message to ourselves to shutdown.
- {
- std::unique_lock<std::mutex> guard(queue->lock);
- queue->exit = true;
- }
- ::PostMessageW(queue->window, WindowClass::WM_USER_DISPATCH, 0, 0);
- }
-
- using LocalScheduler::Schedule;
- virtual Disposable Schedule(clock::time_point dueTime, Work work)
- {
- auto cancelable = std::make_shared<Item>(std::make_pair(get(), std::move(work)));
- {
- std::unique_lock<std::mutex> guard(queue->lock);
- queue->scheduledWork.push(std::make_pair(dueTime, cancelable));
- }
- ::PostMessageW(queue->window, WindowClass::WM_USER_DISPATCH, 0, 0);
- auto local = queue;
- return Disposable([local, cancelable]{
- std::unique_lock<std::mutex> guard(local->lock);
- cancelable.get()->second = nullptr;
- ::PostMessageW(local->window, WindowClass::WM_USER_DISPATCH, 0, 0);
- });
- }
- };
-} }
-
-#endif
-
-#endif
diff --git a/Rx/CPP/src/cpprx/rx-winrt.hpp b/Rx/CPP/src/cpprx/rx-winrt.hpp
deleted file mode 100644
index 061e351..0000000
--- a/Rx/CPP/src/cpprx/rx-winrt.hpp
+++ /dev/null
@@ -1,667 +0,0 @@
-#pragma once
-#include "rx-includes.hpp"
-
-#if !defined(CPPRX_RX_WINRT_HPP)
-#define CPPRX_RX_WINRT_HPP
-#pragma once
-
-#if RXCPP_USE_WINRT
-
-#define NOMINMAX
-#include <Windows.h>
-
-namespace rxcpp { namespace winrt {
- namespace wf = Windows::Foundation;
- namespace wuicore = Windows::UI::Core;
- namespace wuixaml = Windows::UI::Xaml;
- namespace wuictrls = Windows::UI::Xaml::Controls;
-
- template <class TSender, class TEventArgs>
- struct EventPattern
- {
- EventPattern(TSender sender, TEventArgs eventargs) :
- sender(sender),
- eventargs(eventargs)
- {}
-
- TSender Sender() const {
- return sender;};
- TEventArgs EventArgs() const {
- return eventargs;};
-
- private:
- TSender sender;
- TEventArgs eventargs;
- };
-
- namespace detail
- {
- template <class SpecificTypedEventHandler>
- struct is_typed_event_handler : public std::false_type {};
-
- template <class Sender, class EventArgs>
- struct is_typed_event_handler<wf::TypedEventHandler<Sender, EventArgs>> : public std::true_type {};
-
- template <class SpecificTypedEventHandler>
- struct get_sender;
- template <class Sender, class EventArgs>
- struct get_sender<wf::TypedEventHandler<Sender, EventArgs>>
- {
- typedef Sender type;
- };
-
- template <class SpecificTypedEventHandler>
- struct get_eventargs;
- template <class Sender, class EventArgs>
- struct get_eventargs<wf::TypedEventHandler<Sender, EventArgs>>
- {
- typedef EventArgs type;
- };
-
- template <class SpecificTypedEventHandler>
- struct get_eventpattern;
- template <class Sender, class EventArgs>
- struct get_eventpattern<wf::TypedEventHandler<Sender, EventArgs>>
- {
- typedef EventPattern<Sender, EventArgs> type;
- };
-
- template<class T>
- struct remove_ref { typedef T type; };
- template<class T>
- struct remove_ref<T^> { typedef T type; };
- template<class T>
- struct remove_ref<T^ const> { typedef T type; };
- template<class T>
- struct remove_ref<T^ const &> { typedef T type; };
-
- template<typename Result>
- wf::IAsyncOperation<Result>^ operation_interface(wf::IAsyncOperation<Result>^ i) { return i; }
-
- template<typename Result, typename Progress>
- wf::IAsyncOperationWithProgress<Result, Progress>^ operation_interface(wf::IAsyncOperationWithProgress<Result, Progress>^ i) { return i; }
- }
-
- template <class EventHandler, class EventArgs>
- auto FromEventPattern(
- std::function<wf::EventRegistrationToken(EventHandler^)> addHandler,
- std::function<void (wf::EventRegistrationToken)> removeHandler)
- -> typename std::enable_if < !detail::is_typed_event_handler<EventHandler>::value, std::shared_ptr < Observable < EventPattern < Platform::Object^, EventArgs^ >> >> ::type
- {
- typedef EventPattern<Platform::Object^, EventArgs^> EP;
- return CreateObservable<EP>(
- [=](std::shared_ptr<Observer<EP>> observer)
- {
- auto h = ref new EventHandler(
- [=](Platform::Object^ sender, EventArgs^ args) -> void
- {
- observer->OnNext(EP(sender, args));
- });
-
- auto token = addHandler(h);
-
- return Disposable(
- [removeHandler, token]()
- {
- removeHandler(token);
- });
- });
- }
-
- template <class EventHandler, class Sender, class EventArgs>
- auto FromEventPattern(
- std::function<wf::EventRegistrationToken(EventHandler^)> addHandler,
- std::function<void (wf::EventRegistrationToken)> removeHandler)
- -> typename std::enable_if < !detail::is_typed_event_handler<EventHandler>::value, std::shared_ptr < Observable < EventPattern < Sender^, EventArgs^ >> >> ::type
- {
- typedef EventPattern<Sender^, EventArgs^> EP;
- return CreateObservable<EP>(
- [=](std::shared_ptr<Observer<EP>> observer)
- {
- auto h = ref new EventHandler(
- [=](Platform::Object^ sender, EventArgs^ args) -> void
- {
- observer->OnNext(EP(dynamic_cast<Sender^>(sender), args));
- });
-
- auto token = addHandler(h);
-
- return Disposable(
- [removeHandler, token]()
- {
- removeHandler(token);
- });
- });
- }
-
- template <class SpecificTypedEventHandler>
- auto FromEventPattern(
- std::function<wf::EventRegistrationToken(SpecificTypedEventHandler^)> addHandler,
- std::function<void (wf::EventRegistrationToken)> removeHandler)
- -> typename std::enable_if < detail::is_typed_event_handler<SpecificTypedEventHandler>::value, std::shared_ptr < Observable < typename detail::get_eventpattern<SpecificTypedEventHandler>::type> >> ::type
- {
- typedef typename detail::get_eventpattern<SpecificTypedEventHandler>::type EP;
- return CreateObservable<EP>(
- [=](std::shared_ptr < Observer < EP >> observer)
- {
- auto h = ref new SpecificTypedEventHandler(
- [=](typename detail::get_sender<SpecificTypedEventHandler>::type sender, typename detail::get_eventargs<SpecificTypedEventHandler>::type args) -> void
- {
- observer->OnNext(EP(sender, args));
- });
-
- auto token = addHandler(h);
-
- return Disposable(
- [removeHandler, token]()
- {
- removeHandler(token);
- });
- });
- }
-
- template<typename... T, typename F>
- auto FromAsyncPattern(F&& start)
- -> std::function < std::shared_ptr < Observable< decltype(start((*(T*)nullptr)...)->GetResults()) >> (const T&...)>
- {
- typedef decltype(start((*(T*)nullptr)...)->GetResults()) Result;
-
- return [=](const T&... t)
- {
- auto subject = CreateAsyncSubject<Result>();
- auto o = start(t...);
- typedef typename detail::remove_ref< decltype(o->Completed)>::type Handler;
- typedef decltype(detail::operation_interface(o)) Interface;
- o->Completed = ref new Handler([=](Interface io, wf::AsyncStatus)
- {
- util::maybe<Result> value;
- try
- {
- value.set(io->GetResults());
- }
- catch (...)
- {
- subject->OnError(std::current_exception());
- return;
- }
- subject->OnNext(*value.get());
- subject->OnCompleted();
- });
- return observable(subject);
- };
- }
-
- std::shared_ptr < Observable < size_t> >
- inline DispatcherInterval(
- Scheduler::clock::duration interval)
- {
- return CreateObservable<size_t>(
- [=](std::shared_ptr < Observer < size_t >> observer)
- -> Disposable
- {
- size_t cursor = 0;
- ComposableDisposable cd;
-
- wf::TimeSpan timeSpan;
- // convert to 100ns ticks
- timeSpan.Duration = static_cast<int32>(std::chrono::duration_cast<std::chrono::nanoseconds>(interval).count() / 100);
-
- auto dispatcherTimer = ref new wuixaml::DispatcherTimer();
- dispatcherTimer->Interval = timeSpan;
-
- cd.Add(Subscribe(FromEventPattern<wf::EventHandler<Platform::Object^>, Platform::Object>(
- [dispatcherTimer](wf::EventHandler<Platform::Object^>^ h) {
- return dispatcherTimer->Tick += h; },
- [dispatcherTimer](wf::EventRegistrationToken t) {
- dispatcherTimer->Tick -= t;
- }),
- [observer, cursor](EventPattern<Platform::Object^, Platform::Object^>) mutable {
- observer->OnNext(cursor);
- ++cursor;
- },
- [observer]() {
- observer->OnCompleted();
- },
- [observer](std::exception_ptr e) {
- observer->OnError(e);
- }));
-
- cd.Add(Disposable(
- [observer, dispatcherTimer](){
- dispatcherTimer->Stop();
- observer->OnCompleted();
- }));
-
- dispatcherTimer->Start();
-
- return cd;
- });
- }
-
- struct CoreDispatcherScheduler : public LocalScheduler
- {
- private:
- CoreDispatcherScheduler(const CoreDispatcherScheduler&);
-
- public:
- CoreDispatcherScheduler(wuicore::CoreDispatcher^ dispatcher, wuicore::CoreDispatcherPriority priority = wuicore::CoreDispatcherPriority::Normal)
- : dispatcher(dispatcher)
- , priority(priority)
- {
- }
- virtual ~CoreDispatcherScheduler()
- {
- }
-
- typedef std::shared_ptr<CoreDispatcherScheduler> shared;
-
- static shared Current()
- {
- auto window = wuixaml::Window::Current;
- if (window == nullptr)
- {
- throw std::logic_error("No window current");
- }
- auto d = window->Dispatcher;
- if (d == nullptr)
- {
- throw std::logic_error("No dispatcher on current window");
- }
- return std::make_shared<CoreDispatcherScheduler>(d);
- }
-
- wuicore::CoreDispatcher^ Dispatcher()
- {
- return dispatcher;
- }
-
- wuicore::CoreDispatcherPriority Priority()
- {
- return priority;
- }
-
- using LocalScheduler::Schedule;
- virtual Disposable Schedule(clock::time_point dueTime, Work work)
- {
- auto that = shared_from_this();
- auto dispatchAsync = [this, that, work](Scheduler::shared sched) mutable -> Disposable
- {
- dispatcher->RunAsync(
- priority,
- ref new wuicore::DispatchedHandler(
- [that, this, work]() mutable
- {
- this->Do(work, that);
- },
- Platform::CallbackContext::Any
- ));
- return Disposable::Empty();
- };
-
- auto now = Now();
- auto interval = dueTime - now;
- if (now > dueTime || interval < std::chrono::milliseconds(10))
- {
- return dispatchAsync(nullptr);
- }
-
- wf::TimeSpan timeSpan;
- // convert to 100ns ticks
- timeSpan.Duration = static_cast<int32>(std::chrono::duration_cast<std::chrono::nanoseconds>(interval).count() / 100);
-
- auto dispatcherTimer = ref new wuixaml::DispatcherTimer();
- // convert to 100ns ticks
- dispatcherTimer->Interval = timeSpan;
-
- auto result = Subscribe(FromEventPattern<wf::EventHandler<Platform::Object^>, Platform::Object>(
- [dispatcherTimer](wf::EventHandler<Platform::Object^>^ h) {
- return dispatcherTimer->Tick += h; },
- [dispatcherTimer](wf::EventRegistrationToken t) {
- dispatcherTimer->Tick -= t;
- }),
- [dispatchAsync, dispatcherTimer](EventPattern<Platform::Object^, Platform::Object^>) mutable {
- dispatcherTimer->Stop();
- dispatchAsync(nullptr);
- });
-
- dispatcherTimer->Start();
-
- return result;
- }
-
- private:
- wuicore::CoreDispatcher^ dispatcher;
- wuicore::CoreDispatcherPriority priority;
- };
-
- template<class T>
- class ReactiveCommand : public Observable<T>
- {
- typedef ReactiveCommand<T> This;
-
- std::mutex flight_lock;
- std::shared_ptr < Subject<bool>> inflight;
- std::shared_ptr < Subject<std::exception_ptr>> exceptions;
- std::shared_ptr<Subject<T>> executed;
- Scheduler::shared defaultScheduler;
- bool allowsConcurrentExecution;
- std::shared_ptr < Observable < bool >> isExecuting;
- std::shared_ptr < Observable < bool >> canExecuteObservable;
-
- public:
- typedef std::shared_ptr<This> shared;
-
- ReactiveCommand(std::shared_ptr < Observable < bool >> canExecute = nullptr, bool allowsConcurrentExecution = false, Scheduler::shared scheduler = nullptr, bool initialCondition = true) :
- inflight(std::make_shared < Subject < bool >> ()),
- exceptions(std::make_shared < Subject <std::exception_ptr>>()),
- executed(std::make_shared < Subject < T >> ()),
- defaultScheduler(scheduler),
- allowsConcurrentExecution(allowsConcurrentExecution)
- {
- if (!canExecute)
- {
- canExecute = Return(true);
- }
-
- if (!defaultScheduler)
- {
- defaultScheduler = std::static_pointer_cast<Scheduler>(winrt::CoreDispatcherScheduler::Current());
- }
-
- isExecuting = observable(from(inflight)
- .observe_on(defaultScheduler)
- .scan(0, [](int balanced, bool in) {
- return in ? balanced + 1 : balanced - 1; })
- .select([](int balanced) {
- return balanced > 0; })
- .publish(false)
- .connect_forever()
- .distinct_until_changed());
-
- auto isBusy = allowsConcurrentExecution ? Return(false) : isExecuting;
- auto canExecuteAndNotBusy = from(isBusy)
- .combine_latest([](bool b, bool ce)
- {
- return ce && !b;
- }, canExecute);
-
- auto canExecuteObs = from(canExecuteAndNotBusy)
- .publish(initialCondition)
- .ref_count();
-
- canExecuteObservable = observable(from(canExecuteObs)
- .distinct_until_changed()
- .observe_on(defaultScheduler));
- }
-
- template<class F>
- auto RegisterAsync(F f)
- -> decltype(f(*(T*) nullptr))
- {
- return observable(from(executed)
- .select_many(
- // select collection
- [=](T t)
- {
- std::unique_lock<std::mutex> guard(this->flight_lock);
- this->inflight->OnNext(true);
- return Using(
- // resource factory
- [=]() -> SerialDisposable
- {
- SerialDisposable flight;
- flight.Set(ScheduledDisposable(
- this->defaultScheduler,
- Disposable([=]()
- {
- std::unique_lock<std::mutex> guard(this->flight_lock);
- this->inflight->OnNext(false);
- })));
- return flight;
- },
- // observable factory
- [=](SerialDisposable)
- {
- return f(t);
- });
- })
- .observe_on(defaultScheduler)
- .publish()
- .connect_forever());
- }
-
- template<class F>
- auto RegisterAsyncFunction(F f, Scheduler::shared scheduler = nullptr)
- -> std::shared_ptr<Observable< decltype(f(*(T*)nullptr)) >>
- {
- auto asyncFunc = ToAsync<T>(f, scheduler);
- return RegisterAsync(asyncFunc);
- }
-
- bool AllowsConcurrentExecution()
- {
- return allowsConcurrentExecution;
- }
-
- std::shared_ptr<Observable<std::exception_ptr>> ThrownExceptions()
- {
- return from(exceptions).observe_on(defaultScheduler);
- }
-
- std::shared_ptr<Observable<bool>> IsExecuting()
- {
- return isExecuting;
- }
-
- std::shared_ptr<Observable<bool>> CanExecuteObservable()
- {
- return canExecuteObservable;
- }
-
- Disposable Subscribe(std::shared_ptr < Observer < T >> observer)
- {
- return from(executed)
- .subscribe(
- //on next
- [=](const T& t){
- try
- {
- observer->OnNext(t);
- }
- catch (...)
- {
- this->exceptions->OnError(std::current_exception());
- }
- },
- //on completed
- [=](){
- try
- {
- observer->OnCompleted();
- }
- catch (...)
- {
- this->exceptions->OnError(std::current_exception());
- }
- },
- //on error
- [=](std::exception_ptr e){
- try
- {
- observer->OnError(e);
- }
- catch (...)
- {
- this->exceptions->OnError(std::current_exception());
- }
- });
- }
-
- void Execute(T value)
- {
- {
- std::unique_lock<std::mutex> guard(flight_lock);
- inflight->OnNext(true);
- }
- executed->OnNext(value);
- {
- std::unique_lock<std::mutex> guard(flight_lock);
- inflight->OnNext(false);
- }
- }
- };
-
- template<class T>
- std::shared_ptr<Observable<T>> observable(std::shared_ptr < ReactiveCommand < T >> s){ return std::static_pointer_cast < Observable < T >> (s); }
-
- template<class T>
- Disposable BindCommand(wuictrls::Button^ button, std::shared_ptr<ReactiveCommand<T>> command)
- {
- typedef rxrt::EventPattern<Platform::Object^, wuixaml::RoutedEventArgs^> RoutedEventPattern;
-
- ComposableDisposable cd;
-
- cd.Add(from(command->CanExecuteObservable())
- .subscribe(
- [=](bool b)
- {
- button->IsEnabled = b;
- }));
-
- auto click = rxrt::FromEventPattern<wuixaml::RoutedEventHandler, wuixaml::RoutedEventArgs>(
- [=](wuixaml::RoutedEventHandler^ h)
- {
- return button->Click += h;
- },
- [=](wf::EventRegistrationToken t)
- {
- button->Click -= t;
- });
-
- cd.Add(from(click)
- .subscribe([=](RoutedEventPattern ep)
- {
- command->Execute(ep);
- }));
-
- return cd;
- }
-
- template <class O>
- struct OperationPattern
- {
- typedef decltype(((O)nullptr)->GetDeferral()) D;
-
- OperationPattern(O operation) :
- operation(operation),
- deferral(operation->GetDeferral())
- {
- }
-
- O Operation() const {
- return operation;
- };
- D Deferral() const {
- return deferral;
- };
-
- void Dispose()
- {
- deferral->Complete();
- }
-
- operator Disposable() const
- {
- // make sure to capture state and not 'this'.
- // usage means that 'this' will usualy be destructed
- // immediately
- auto local = deferral;
- return Disposable([local]{
- local->Complete();
- });
- }
-
- private:
- O operation;
- D deferral;
- };
-
- template <class O>
- OperationPattern<O> make_operation_pattern(O o)
- {
- return OperationPattern<O>(std::move(o));
- }
-
-
- namespace detail
- {
-
- template<class T, class SOp, class SOb>
- auto DeferOperation(const std::shared_ptr < Observable < T >> &source, SOp sop, SOb sob, Scheduler::shared scheduler = nullptr)
- -> decltype(sob(*(OperationPattern<decltype(sop(*(T*) nullptr))>*)nullptr, *(T*) nullptr))
- {
- typedef decltype(sob(*(OperationPattern<decltype(sop(*(T*) nullptr))>*)nullptr, *(T*) nullptr)) ResultObservable;
- typedef typename observable_item<ResultObservable>::type Result;
- if (!scheduler)
- {
- scheduler = std::static_pointer_cast<Scheduler>(winrt::CoreDispatcherScheduler::Current());
- }
- return rx::CreateObservable<Result>(
- [=](const std::shared_ptr < Observer < Result >> &observer)
- {
- return from(source)
- .select_many(
- //select observable
- [=](T t) -> ResultObservable
- {
- // must take the deferral early while the event is still on the stack.
- auto op = make_operation_pattern(sop(t));
- typedef decltype(op) OP;
-
- return Using(
- // resource factory
- [=]()
- {
- return op;
- },
- // observable factory
- [sob, t](OP op)
- {
- return sob(op, t);
- });
- })
- .observe_on(scheduler)
- .subscribe(
- //on next
- [=](Result r)
- {
- observer->OnNext(r);
- },
- //on completed
- [=]()
- {
- observer->OnCompleted();
- },
- //on error
- [=](std::exception_ptr e)
- {
- observer->OnError(e);
- }
- );
- });
- }
- }
-
- struct defer_operation {};
- template<class T, class SOp, class SOb>
- auto rxcpp_chain(defer_operation && , const std::shared_ptr < Observable < T >> &source, SOp sop, SOb sob, Scheduler::shared scheduler = nullptr)
- -> decltype(detail::DeferOperation(source, sop, sob, scheduler))
- {
- return detail::DeferOperation(source, sop, sob, scheduler);
- }
-
-} }
-
-#endif
-
-#endif
diff --git a/Rx/CPP/src/cpprx/rx.hpp b/Rx/CPP/src/cpprx/rx.hpp
deleted file mode 100644
index 16bfcc1..0000000
--- a/Rx/CPP/src/cpprx/rx.hpp
+++ /dev/null
@@ -1,587 +0,0 @@
-// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-#pragma once
-#include "rx-includes.hpp"
-
-#if !defined(CPPRX_RX_HPP)
-#define CPPRX_RX_HPP
-
-namespace rxcpp
-{
- template<class Obj>
- class Binder;
-
- template<class Obj>
- class Binder<Binder<Obj>>;
-
-namespace detail {
- template<class Obj>
- struct observable_item<Binder<Obj>> {typedef typename rxcpp::observable_item<Obj>::type type;};
-}
-
- template<class Obj>
- struct is_observable < Binder<Obj > > {static const bool value = true; };
-
- template<class T, class Obj>
- class BinderBase
- {
- protected:
- Obj obj;
- template<class U, class V>
- friend V observable(const BinderBase<U, V>& b);
-
- public:
- typedef T item_type;
- typedef Obj observable_type;
-
- BinderBase(Obj obj) : obj(std::move(obj))
- {
- }
-
- Observable<T>* operator->() const {
- return obj.get();
- }
- };
-
- template<class T, class Obj>
- Obj observable(const BinderBase<T, Obj>& b) {
- return b.obj;
- }
-
- template<class Base, class T, class Obj, bool IsTObservable>
- class BinderNested;
-
- template<class Base, class T, class Obj>
- class BinderNested<Base, T, Obj, false> : public Base
- {
- protected:
- typedef typename Base::item_type item_type;
- using Base::obj;
- public:
- static const bool is_item_observable = false;
- BinderNested(Obj obj) : Base(std::move(obj))
- {
- }
-
- void select_many();
- void concat();
- };
-
- template<class Base, class T, class Obj>
- class BinderNested<Base, T, Obj, true> : public Base
- {
- protected:
- typedef typename Base::item_type item_type;
- using Base::obj;
- public:
- static const bool is_item_observable = true;
-
- BinderNested(Obj obj) : Base(std::move(obj))
- {
- }
-
- auto select_many()
- -> decltype(from(SelectMany<item_type>(obj, util::pass_through(), util::pass_through_second()))) {
- return from(SelectMany<item_type>(obj, util::pass_through(), util::pass_through_second()));
- }
- auto concat()
- -> decltype(from(Concat(*(Obj*)nullptr))) {
- return from(Concat(obj));
- }
- };
-
- template<class Base, class T, class Obj>
- class BinderConnectable : public Base
- {
- protected:
- typedef typename Base::item_type item_type;
- using Base::obj;
- public:
- BinderConnectable(Obj obj) : Base(std::move(obj))
- {
- }
- };
-
- template<class Base, class T>
- class BinderConnectable<Base, T, std::shared_ptr<ConnectableObservable<T>>> : public Base
- {
- protected:
- typedef typename Base::item_type item_type;
- using Base::obj;
- public:
- BinderConnectable(std::shared_ptr<ConnectableObservable<T>> obj) : Base(std::move(obj))
- {
- }
-
- auto ref_count()
- -> decltype(from(RefCount(obj))) {
- return from(RefCount(obj));
- }
- auto connect_forever()
- -> decltype(from(ConnectForever(obj))) {
- return from(ConnectForever(obj));
- }
- };
-
- template<class Base, class T, class Obj>
- class BinderMaterialized : public Base
- {
- protected:
- typedef typename Base::item_type item_type;
- using Base::obj;
- public:
- BinderMaterialized(Obj obj) : Base(std::move(obj))
- {
- }
- };
-
- template<class Base, class T, class M>
- class BinderMaterialized<Base, T, std::shared_ptr<Observable<std::shared_ptr<Notification<M>>>>> : public Base
- {
- protected:
- typedef typename Base::item_type item_type;
- using Base::obj;
- public:
- BinderMaterialized(std::shared_ptr<Observable<std::shared_ptr<Notification<M>>>> obj) : Base(std::move(obj))
- {
- }
-
- auto dematerialize()
- -> decltype(from(Dematerialize(observable(obj)))) {
- return from(Dematerialize(observable(obj)));
- }
- };
-
- template<class Obj>
- class Binder : public BinderNested<
- BinderConnectable<
- BinderMaterialized<
- BinderBase<typename observable_item<Obj>::type, Obj>,
- typename observable_item<Obj>::type,
- Obj
- >,
- typename observable_item<Obj>::type,
- Obj
- >,
- typename observable_item<Obj>::type,
- Obj,
- is_observable<typename observable_item<Obj>::type>::value>
- {
- typedef BinderNested<
- BinderConnectable<
- BinderMaterialized<
- BinderBase<typename observable_item<Obj>::type, Obj>,
- typename observable_item<Obj>::type,
- Obj
- >,
- typename observable_item<Obj>::type,
- Obj
- >,
- typename observable_item<Obj>::type,
- Obj,
- is_observable<typename observable_item<Obj>::type>::value> base;
- typedef typename base::item_type item_type;
- using base::obj;
- public:
-
- Binder(Obj obj) : base(std::move(obj))
- {
- }
-
- template <class S>
- auto select(S selector) -> decltype(from(Select<item_type>(obj, selector))) {
- return from(Select<item_type>(obj, selector));
- }
- using base::select_many;
- template <class CS>
- auto select_many(CS collectionSelector)
- -> decltype(from(SelectMany<item_type>(obj, std::move(collectionSelector), util::pass_through_second()))) {
- return from(SelectMany<item_type>(obj, std::move(collectionSelector), util::pass_through_second()));
- }
- template <class CS, class RS>
- auto select_many(CS collectionSelector, RS resultSelector)
- -> decltype(from(SelectMany<item_type>(obj, std::move(collectionSelector), std::move(resultSelector)))) {
- return from(SelectMany<item_type>(obj, std::move(collectionSelector), std::move(resultSelector)));
- }
-#if RXCPP_USE_VARIADIC_TEMPLATES
- template <class... MergeSource>
- auto merge(const MergeSource&... source)
- -> decltype(from(Merge(obj, observable(source)...))) {
- return from(Merge(obj, observable(source)...));
- }
-#else
- template <class MergeSource>
- auto merge(const MergeSource& source)
- -> decltype(from(Merge(obj, observable(source)))) {
- return from(Merge(obj, observable(source)));
- }
-#endif //RXCPP_USE_VARIADIC_TEMPLATES
-#if RXCPP_USE_VARIADIC_TEMPLATES
- template <class S, class... ZipSource>
- auto zip(S selector, const ZipSource&... source)
- -> decltype(from(Zip(selector, obj, observable(source)...))) {
- return from(Zip(selector, obj, observable(source)...));
- }
- template <class... Zip1Source>
- auto zip(const Zip1Source&... source)
- -> decltype(from(Zip(util::as_tuple(), obj, observable(source)...))) {
- return from(Zip(util::as_tuple(), obj, observable(source)...));
- }
-#else
- template <class S, class ZipSource>
- auto zip(S selector, const ZipSource& source)
- -> decltype(from(Zip(selector, obj, observable(source)))) {
- return from(Zip(selector, obj, observable(source)));
- }
- template <class Zip1Source>
- auto zip(const Zip1Source& source)
- -> decltype(from(Zip(util::as_tuple(), obj, observable(source)))) {
- return from(Zip(util::as_tuple(), obj, observable(source)));
- }
-#endif //RXCPP_USE_VARIADIC_TEMPLATES
-#if RXCPP_USE_VARIADIC_TEMPLATES
- private:
- struct selector_tag{};
- struct source_tag{};
- template <class CombineSelector, class... CombineSelectorSources>
- auto combine_latest_detail(selector_tag&&, CombineSelector&& selector, const CombineSelectorSources&... sources)
- -> decltype(from(CombineLatest(std::forward<CombineSelector>(selector), obj, observable(sources)...))) {
- return from(CombineLatest(std::forward<CombineSelector>(selector), obj, observable(sources)...));
- }
- template <class... CombineSourceSources>
- auto combine_latest_detail(source_tag&&, const CombineSourceSources&... sources)
- -> decltype(from(CombineLatest(util::as_tuple(), obj, observable(sources)...))) {
- return from(CombineLatest(util::as_tuple(), obj, observable(sources)...));
- }
- public:
- template <class CombineSourceOrSelector, class... CombineSourceN>
- auto combine_latest(CombineSourceOrSelector&& sourceOrSelector, const CombineSourceN&... sourcen)
- -> decltype(from(combine_latest_detail(typename std::conditional<is_observable<typename std::decay<CombineSourceOrSelector>::type>::value, source_tag, selector_tag>::type(), std::forward<CombineSourceOrSelector>(sourceOrSelector), sourcen...))) {
- return from(combine_latest_detail(typename std::conditional<is_observable<typename std::decay<CombineSourceOrSelector>::type>::value, source_tag, selector_tag>::type(), std::forward<CombineSourceOrSelector>(sourceOrSelector), sourcen...));
- }
-#else
- template <class S, class CombineLSource>
- auto combine_latest(S selector, const CombineLSource& source)
- -> decltype(from(CombineLatest(selector, obj, observable(source)))) {
- return from(CombineLatest(selector, obj, observable(source)));
- }
- template <class CombineLSource>
- auto combine_latest(const CombineLSource& source)
- -> decltype(from(CombineLatest(util::as_tuple(), obj, observable(source)))) {
- return from(CombineLatest(util::as_tuple(), obj, observable(source)));
- }
-#endif //RXCPP_USE_VARIADIC_TEMPLATES
-
- using base::concat;
-#if RXCPP_USE_VARIADIC_TEMPLATES
- template<class... ConcatSource>
- auto concat(const ConcatSource&... source)
- -> decltype(from(Concat(Iterate(std::vector<Obj>())))) {
- std::vector<Obj> sources;
- sources.push_back(obj);
- std::make_tuple((sources.push_back(observable(source)), true)...);
- return from(Concat(Iterate(std::move(sources))));
- }
-#else
- template<class ConcatSource>
- auto concat(const ConcatSource& source)
- -> decltype(from(Concat(Iterate(std::vector<Obj>())))) {
- std::vector<Obj> sources;
- sources.push_back(obj);
- sources.push_back(observable(source));
- return from(Concat(Iterate(std::move(sources))));
- }
-#endif //RXCPP_USE_VARIADIC_TEMPLATES
- template <class Range>
- auto concat(Range range)
- -> decltype(from(Concat(Iterate(range.insert(range.begin(), range.front()), range)))) {
- range.insert(range.begin(), obj);
- return from(Concat(Iterate(std::move(range))));
- }
- template <class P>
- auto where(P predicate) -> decltype(from(Where<item_type>(obj, predicate))) {
- return from(Where<item_type>(obj, predicate));
- }
- template <class KS>
- auto group_by(
- KS keySelector)
- -> decltype(from(GroupBy<item_type>(obj, keySelector, util::pass_through(), std::less<decltype(keySelector((*(item_type*)0)))>()))) {
- return from(GroupBy<item_type>(obj, keySelector, util::pass_through(), std::less<decltype(keySelector((*(item_type*)0)))>()));
- }
- template <class KS, class VS>
- auto group_by(
- KS keySelector,
- VS valueSelector)
- -> decltype(from(GroupBy<item_type>(obj, keySelector, valueSelector, std::less<decltype(keySelector((*(item_type*)0)))>()))) {
- return from(GroupBy<item_type>(obj, keySelector, valueSelector, std::less<decltype(keySelector((*(item_type*)0)))>()));
- }
- template <class KS, class VS, class L>
- auto group_by(
- KS keySelector,
- VS valueSelector,
- L less)
- -> decltype(from(GroupBy<item_type>(obj, keySelector, valueSelector, less))) {
- return from(GroupBy<item_type>(obj, keySelector, valueSelector, less));
- }
- template <class Seed, class A>
- auto scan(Seed seed, A accumulator)
- -> decltype(from(Scan<item_type>(obj, seed, accumulator))) {
- return from(Scan<item_type>(obj, seed, accumulator));
- }
- template <class A>
- auto scan(A accumulator)
- -> decltype(from(Scan<item_type>(obj, accumulator))) {
- return from(Scan<item_type>(obj, accumulator));
- }
- template <class Integral>
- auto take(Integral n)
- -> decltype(from(Take<item_type>(obj, n))) {
- return from(Take<item_type>(obj, n));
- }
- template <class TakeUntilTerminus>
- auto take_until(const TakeUntilTerminus& terminus)
- -> decltype(from(TakeUntil<item_type>(obj, observable(terminus)))) {
- return from(TakeUntil<item_type>(obj, observable(terminus)));
- }
- template <class Integral>
- auto skip(Integral n)
- -> decltype(from(Skip<item_type>(obj, n))) {
- return from(Skip<item_type>(obj, n));
- }
- template <class SkipUntilTerminus>
- auto skip_until(const SkipUntilTerminus& terminus)
- -> decltype(from(SkipUntil<item_type>(obj, observable(terminus)))) {
- return from(SkipUntil<item_type>(obj, observable(terminus)));
- }
- template<class MulticastSubject>
- auto multicast(MulticastSubject subject)
- -> decltype(from(Multicast(observable(obj), subject))) {
- return from(Multicast(observable(obj), subject));
- }
- auto publish()
- -> decltype(from(Publish(observable(obj)))) {
- return from(Publish(observable(obj)));
- }
- auto publish(item_type value)
- -> decltype(from(Publish(observable(obj), value))) {
- return from(Publish(observable(obj), value));
- }
- auto publish_last()
- -> decltype(from(PublishLast(observable(obj)))) {
- return from(PublishLast(observable(obj)));
- }
- template<template<class Value>class Allocator>
- auto to_vector()
- -> decltype(from(ToStdCollection<std::vector<item_type, Allocator<item_type>>>(obj))) {
- return from(ToStdCollection<std::vector<item_type, Allocator<item_type>>>(obj));
- }
- auto to_vector()
- -> decltype(from(ToStdCollection<std::vector<item_type>>(obj))) {
- return from(ToStdCollection<std::vector<item_type>>(obj));
- }
- template<template<class Value>class Allocator>
- auto to_list()
- -> decltype(from(ToStdCollection<std::list<item_type, Allocator<item_type>>>(obj))) {
- return from(ToStdCollection<std::list<item_type, Allocator<item_type>>>(obj));
- }
- auto to_list()
- -> decltype(from(ToStdCollection<std::list<item_type>>(obj))) {
- return from(ToStdCollection<std::list<item_type>>(obj));
- }
- auto materialize()
- -> decltype(from(Materialize(observable(obj)))) {
- return from(Materialize(observable(obj)));
- }
- auto delay(Scheduler::clock::duration due, Scheduler::shared scheduler) -> decltype(from(Delay<item_type>(obj, due, scheduler))) {
- return from(Delay<item_type>(obj, due, scheduler));
- }
- auto throttle(Scheduler::clock::duration due, Scheduler::shared scheduler)
- -> decltype(from(Throttle<item_type>(obj, due, scheduler))) {
- return from(Throttle<item_type>(obj, due, scheduler));
- }
- auto distinct_until_changed() -> decltype(from(DistinctUntilChanged<item_type>(obj))) {
- return from(DistinctUntilChanged<item_type>(obj));
- }
- auto subscribe_on(Scheduler::shared scheduler)
- -> decltype(from(SubscribeOnObservable<item_type>(obj, std::move(scheduler))))
- {
- return from(SubscribeOnObservable<item_type>(obj, std::move(scheduler)));
- }
- auto observe_on(Scheduler::shared scheduler)
- -> decltype(from(ObserveOnObserver<item_type>(obj, std::move(scheduler))))
- {
- return from(ObserveOnObserver<item_type>(obj, std::move(scheduler)));
- }
-#if RXCPP_USE_WINRT
- auto observe_on_dispatcher()
- -> decltype(from(ObserveOnObserver<item_type>(obj, std::static_pointer_cast<Scheduler>(winrt::CoreDispatcherScheduler::Current()))))
- {
- return from(ObserveOnObserver<item_type>(obj, std::static_pointer_cast<Scheduler>(winrt::CoreDispatcherScheduler::Current())));
- }
-#else
- auto on_dispatcher()
- -> decltype(from(ObserveOnDispatcher<item_type>(obj)))
- {
- return from(ObserveOnDispatcher<item_type>(obj));
- }
-#endif
- template <class OnNext>
- void for_each(OnNext onNext) {
- ForEach<item_type>(obj, onNext);
- }
- auto subscribe(std::shared_ptr<Observer<item_type>> observer) -> decltype(obj->Subscribe(observer)) {
- return obj->Subscribe(observer);
- }
- template <class OnNext>
- auto subscribe(OnNext onNext) -> decltype(Subscribe(obj, onNext)) {
- auto result = Subscribe(obj, onNext);
- return result;
- }
- template <class OnNext, class OnComplete>
- auto subscribe(OnNext onNext, OnComplete onComplete)
- -> decltype(Subscribe(obj, onNext, onComplete)) {
- auto result = Subscribe(obj, onNext, onComplete);
- return result;
- }
- template <class OnNext, class OnComplete, class OnError>
- auto subscribe(OnNext onNext, OnComplete onComplete, OnError onError)
- -> decltype(Subscribe(obj, onNext, onComplete, onError)) {
- auto result = Subscribe(obj, onNext, onComplete, onError);
- return result;
- }
-#if RXCPP_USE_VARIADIC_TEMPLATE
- template <class Tag, class... ChainArg>
- auto chain(ChainArg&&... arg)
- -> decltype(from(rxcpp_chain(Tag(), obj, std::forward<ChainArg>(arg)...))) {
- return from(rxcpp_chain(Tag(), obj, std::forward<ChainArg>(arg)...));
- }
-#else
- template <class Tag>
- auto chain()
- -> decltype(from(rxcpp_chain(Tag(), obj))) {
- return from(rxcpp_chain(Tag(), obj));
- }
- template <class Tag, class ChainArg>
- auto chain(ChainArg&& arg)
- -> decltype(from(rxcpp_chain(Tag(), obj, std::forward<ChainArg>(arg)))) {
- return from(rxcpp_chain(Tag(), obj, std::forward<ChainArg>(arg)));
- }
- template <class Tag,
- class ChainArg1,
- class ChainArg2>
- auto chain(
- ChainArg1&& arg1,
- ChainArg2&& arg2)
- -> decltype(from(rxcpp_chain(Tag(), obj,
- std::forward<ChainArg1>(arg1),
- std::forward<ChainArg2>(arg2)))) {
- return from(rxcpp_chain(Tag(), obj,
- std::forward<ChainArg1>(arg1),
- std::forward<ChainArg2>(arg2)));
- }
- template <class Tag,
- class ChainArg1,
- class ChainArg2,
- class ChainArg3>
- auto chain(
- ChainArg1&& arg1,
- ChainArg2&& arg2,
- ChainArg3&& arg3)
- -> decltype(from(rxcpp_chain(Tag(), obj,
- std::forward<ChainArg1>(arg1),
- std::forward<ChainArg2>(arg2),
- std::forward<ChainArg3>(arg3)))) {
- return from(rxcpp_chain(Tag(), obj,
- std::forward<ChainArg1>(arg1),
- std::forward<ChainArg2>(arg2),
- std::forward<ChainArg3>(arg3)));
- }
- template <class Tag,
- class ChainArg1,
- class ChainArg2,
- class ChainArg3,
- class ChainArg4>
- auto chain(
- ChainArg1&& arg1,
- ChainArg2&& arg2,
- ChainArg3&& arg3,
- ChainArg4&& arg4)
- -> decltype(from(rxcpp_chain(Tag(), obj,
- std::forward<ChainArg1>(arg1),
- std::forward<ChainArg2>(arg2),
- std::forward<ChainArg3>(arg3),
- std::forward<ChainArg4>(arg4)))) {
- return from(rxcpp_chain(Tag(), obj,
- std::forward<ChainArg1>(arg1),
- std::forward<ChainArg2>(arg2),
- std::forward<ChainArg3>(arg3),
- std::forward<ChainArg4>(arg4)));
- }
- template <class Tag,
- class ChainArg1,
- class ChainArg2,
- class ChainArg3,
- class ChainArg4,
- class ChainArg5>
- auto chain(
- ChainArg1&& arg1,
- ChainArg2&& arg2,
- ChainArg3&& arg3,
- ChainArg4&& arg4,
- ChainArg5&& arg5)
- -> decltype(from(rxcpp_chain(Tag(), obj,
- std::forward<ChainArg1>(arg1),
- std::forward<ChainArg2>(arg2),
- std::forward<ChainArg3>(arg3),
- std::forward<ChainArg4>(arg4),
- std::forward<ChainArg5>(arg5)))) {
- return from(rxcpp_chain(Tag(), obj,
- std::forward<ChainArg1>(arg1),
- std::forward<ChainArg2>(arg2),
- std::forward<ChainArg3>(arg3),
- std::forward<ChainArg4>(arg4),
- std::forward<ChainArg5>(arg5)));
- }
-#endif
- };
-
- template<class T>
- Binder<std::shared_ptr<Observable<T>>> from(std::shared_ptr<Observable<T>> obj) {
- return Binder<std::shared_ptr<Observable<T>>>(std::move(obj)); }
-
- template<class T>
- Binder < std::shared_ptr < ConnectableObservable<T >> > from(std::shared_ptr < ConnectableObservable < T >> obj) {
- return Binder < std::shared_ptr < ConnectableObservable<T >> >(std::move(obj)); }
-
- template<class K, class T>
- Binder<std::shared_ptr<GroupedObservable<K, T>>> from(std::shared_ptr<GroupedObservable<K, T>> obj) {
- return Binder<std::shared_ptr<GroupedObservable<K, T>>>(std::move(obj)); }
-
- template<class T>
- Binder<std::shared_ptr<Observable<T>>> from(std::shared_ptr<Subject<T>> obj) {
- return Binder<std::shared_ptr<Observable<T>>>(observable(obj)); }
-
- template<class T>
- Binder<std::shared_ptr<Observable<T>>> from(std::shared_ptr<BehaviorSubject<T>> obj) {
- return Binder<std::shared_ptr<Observable<T>>>(observable(obj)); }
-
- template<class K, class T>
- Binder<std::shared_ptr<GroupedObservable<K, T>>> from(std::shared_ptr<GroupedSubject<K, T>> obj) {
- return Binder<std::shared_ptr<GroupedObservable<K, T>>>(std::move(obj)); }
-
- template<class T>
- Binder<std::shared_ptr<TestableObservable<T>>> from(std::shared_ptr<TestableObservable<T>> obj) {
- return Binder<std::shared_ptr<TestableObservable<T>>>(std::move(obj)); }
-
- template<class Obj>
- Binder<Obj> from(Binder<Obj> binder) {
- return std::move(binder); }
-
- template<class T>
- T item(const Binder<std::shared_ptr<Observable<T>>>&);
-
- template<class T, class K>
- T item(const Binder<std::shared_ptr<GroupedObservable<K, T>>>&);
-}
-
-#endif
diff --git a/Rx/CPP/test/operators/Merge.cpp b/Rx/CPP/test/operators/Merge.cpp
deleted file mode 100644
index 7e26d8f..0000000
--- a/Rx/CPP/test/operators/Merge.cpp
+++ /dev/null
@@ -1,60 +0,0 @@
-#include "cpprx/rx.hpp"
-namespace rx=rxcpp;
-
-#include "catch.hpp"
-
-SCENARIO("merge issue 5", "[merge][issue][operators]"){
- GIVEN("Empty and Never"){
- auto scheduler = std::make_shared<rx::TestScheduler>();
- typedef rx::TestScheduler::Messages<int> m;
-
- WHEN("merged 4 times"){
-
- std::vector<int> empty;
- auto o = rx::observable(rx::from(rx::Iterate(empty))
- .merge(rx::Never<int>()));
-
- auto res1 = scheduler->Start<int>(
- [o]() {
- return o;
- }
- );
- auto res2 = scheduler->Start<int>(
- [o]() {
- return o;
- }
- );
- auto res3 = scheduler->Start<int>(
- [o]() {
- return o;
- }
- );
- auto res4 = scheduler->Start<int>(
- [o]() {
- return o;
- }
- );
-
- THEN("1 - the output is empty and subscribed"){
- std::vector<m::RecordedT> required;
- auto actual = res1->Messages();
- REQUIRE(required == actual);
- }
- THEN("2 - the output is empty and subscribed"){
- std::vector<m::RecordedT> required;
- auto actual = res2->Messages();
- REQUIRE(required == actual);
- }
- THEN("3 - the output is empty and subscribed"){
- std::vector<m::RecordedT> required;
- auto actual = res3->Messages();
- REQUIRE(required == actual);
- }
- THEN("4 - the output is empty and subscribed"){
- std::vector<m::RecordedT> required;
- auto actual = res4->Messages();
- REQUIRE(required == actual);
- }
- }
- }
-}
diff --git a/Rx/CPP/test/operators/Publish.cpp b/Rx/CPP/test/operators/Publish.cpp
deleted file mode 100644
index 26e6e5b..0000000
--- a/Rx/CPP/test/operators/Publish.cpp
+++ /dev/null
@@ -1,111 +0,0 @@
-#include "cpprx/rx.hpp"
-namespace rx=rxcpp;
-
-#include "catch.hpp"
-
-SCENARIO("publish_last", "[publish_last][publish][multicast][operators]"){
- GIVEN("a test hot observable of longs"){
- auto scheduler = std::make_shared<rx::TestScheduler>();
- typedef rx::TestScheduler::Messages<long> m;
-
- long invoked = 0;
-
- auto xs = scheduler->CreateHotObservable(
- []() {
- m::RecordedT messages[] = {
- m::OnNext(110, 7),
- m::OnNext(220, 3),
- m::OnNext(280, 4),
- m::OnNext(290, 1),
- m::OnNext(340, 8),
- m::OnNext(360, 5),
- m::OnNext(370, 6),
- m::OnNext(390, 7),
- m::OnNext(410, 13),
- m::OnNext(430, 2),
- m::OnNext(450, 9),
- m::OnNext(520, 11),
- m::OnNext(560, 20),
- m::OnCompleted(600)
- };
- return m::ToVector(messages);
- }()
- );
-
- auto res = scheduler->CreateObserver<long>();
-
- rx::SerialDisposable subscription;
- std::shared_ptr<rx::ConnectableObservable<long>> ys;
-
- WHEN("subscribed and then connected"){
-
- scheduler->ScheduleAbsolute(rx::TestScheduler::Created,
- [&invoked, &ys, &xs](rx::Scheduler::shared) {
- ys = rx::observable(rx::from(xs)
- .publish_last());
- return rx::Disposable::Empty();
- });
-
- scheduler->ScheduleAbsolute(rx::TestScheduler::Subscribed, [&subscription, &ys, &res](rx::Scheduler::shared) {
- subscription.Set(ys->Subscribe(res));
- return rx::Disposable::Empty();
- });
-
- scheduler->ScheduleAbsolute(rx::TestScheduler::Disposed, [&subscription](rx::Scheduler::shared) {
- subscription.Dispose();
- return rx::Disposable::Empty();
- });
-
- auto connection = std::make_shared<rx::SerialDisposable>();
- scheduler->ScheduleAbsolute(300, [connection, &ys](rx::Scheduler::shared) {
- connection->Set(ys->Connect());
- return rx::Disposable::Empty();
- });
- scheduler->ScheduleAbsolute(400, [connection](rx::Scheduler::shared) {
- connection->Dispose();
- return rx::Disposable::Empty();
- });
-
- connection = std::make_shared<rx::SerialDisposable>();
- scheduler->ScheduleAbsolute(500, [connection, &ys](rx::Scheduler::shared) {
- connection->Set(ys->Connect());
- return rx::Disposable::Empty();
- });
- scheduler->ScheduleAbsolute(550, [connection](rx::Scheduler::shared) {
- connection->Dispose();
- return rx::Disposable::Empty();
- });
-
- connection = std::make_shared<rx::SerialDisposable>();
- scheduler->ScheduleAbsolute(650, [connection, &ys](rx::Scheduler::shared) {
- connection->Set(ys->Connect());
- return rx::Disposable::Empty();
- });
- scheduler->ScheduleAbsolute(800, [connection](rx::Scheduler::shared) {
- connection->Dispose();
- return rx::Disposable::Empty();
- });
-
- scheduler->Start();
-
- THEN("the output is empty"){
- std::vector<m::RecordedT> required;
- auto actual = res->Messages();
- REQUIRE(required == actual);
- }
-
- THEN("there were 3 subscription/unsubscription"){
- rx::Subscription items[] = {
- m::Subscribe(300, 400),
- m::Subscribe(500, 550),
- m::Subscribe(650, 800)
- };
- auto required = m::ToVector(items);
- auto actual = xs->Subscriptions();
- REQUIRE(required == actual);
- }
-
- }
- }
-}
-
diff --git a/Rx/CPP/test/operators/Return.cpp b/Rx/CPP/test/operators/Return.cpp
deleted file mode 100644
index 44c38cf..0000000
--- a/Rx/CPP/test/operators/Return.cpp
+++ /dev/null
@@ -1,119 +0,0 @@
-#include "cpprx/rx.hpp"
-namespace rx=rxcpp;
-
-#include "catch.hpp"
-
-SCENARIO("return basic", "[return][operators]"){
- GIVEN("return 42"){
- auto scheduler = std::make_shared<rx::TestScheduler>();
- typedef rx::TestScheduler::Messages<int> m;
-
- auto res = scheduler->Start<int>(
- [=]() {
- return rx::Return(42, scheduler);
- }
- );
-
- WHEN("started"){
-
- THEN("the output is 42"){
- m::RecordedT items[] = {
- m::OnNext(201, 42),
- m::OnCompleted(201)
- };
- auto required = m::ToVector(items);
- auto actual = res->Messages();
- REQUIRE(required == actual);
- }
- }
- }
-}
-
-SCENARIO("return disposed", "[return][operators]"){
- GIVEN("test scheduler"){
- auto scheduler = std::make_shared<rx::TestScheduler>();
- typedef rx::TestScheduler::Messages<int> m;
-
- WHEN("return 42 after disposed"){
- auto res = scheduler->Start<int>(
- [&]() {
- return rx::Return(42, scheduler);
- },
- 200
- );
-
- THEN("the output is empty"){
- std::vector<m::RecordedT> required;
- auto actual = res->Messages();
- REQUIRE(required == actual);
- }
- }
- }
-}
-
-SCENARIO("return disposed after next", "[return][operators]"){
- GIVEN("return 42 after disposal"){
- auto scheduler = std::make_shared<rx::TestScheduler>();
- typedef rx::TestScheduler::Messages<int> m;
-
- rx::SerialDisposable d;
-
- auto xs = rx::Return(42, scheduler);
-
- auto res = scheduler->CreateObserver<int>();
-
- scheduler->ScheduleAbsolute(
- 100,
- [&](rx::Scheduler::shared) {
- d.Set(from(xs).subscribe(
- [&](int x){
- d.Dispose(); res->OnNext(x);},
- [&](){
- res->OnCompleted();},
- [&](std::exception_ptr ex){
- res->OnError(ex);}));
- return d;
- }
- );
-
- WHEN("started"){
-
- scheduler->Start();
-
- THEN("the output is 42"){
- m::RecordedT items[] = {
- m::OnNext(101, 42)
- };
- auto required = m::ToVector(items);
- auto actual = res->Messages();
- REQUIRE(required == actual);
- }
- }
- }
-}
-
-SCENARIO("return observer throws", "[return][operators]"){
- GIVEN("return 42"){
- auto scheduler = std::make_shared<rx::TestScheduler>();
- typedef rx::TestScheduler::Messages<int> m;
-
- auto xs = rx::Return(42, scheduler);
-
- WHEN("subscribed to onnext that throws"){
- from(xs).subscribe([](int){ throw std::runtime_error("onnext throws"); });
-
- THEN("the exception is not supressed"){
- REQUIRE_THROWS(scheduler->Start());
- }
- }
-
- WHEN("subscribed to oncompleted that throws"){
- from(xs).subscribe([](int){},[](){ throw std::runtime_error("oncompleted throws"); });
-
- THEN("the exception is not supressed"){
- REQUIRE_THROWS(scheduler->Start());
- }
- }
- }
-}
-
diff --git a/Rx/CPP/test/operators/Select.cpp b/Rx/CPP/test/operators/Select.cpp
deleted file mode 100644
index 2de7f21..0000000
--- a/Rx/CPP/test/operators/Select.cpp
+++ /dev/null
@@ -1,181 +0,0 @@
-#include "cpprx/rx.hpp"
-namespace rx=rxcpp;
-
-#include "catch.hpp"
-
-SCENARIO("select throws", "[select][map][operators]"){
- GIVEN("select"){
- WHEN("subscribed to onnext that throws"){
- THEN("the exception is not supressed"){
- auto next_throws = [](int){
- throw std::runtime_error("onnext throws"); };
- REQUIRE_THROWS(from(rx::Return(1))
- .select([](int v){return v;})
- .subscribe(next_throws));
- }
- }
-
- WHEN("subscribed to throw operator"){
- THEN("the exception is not supressed"){
- REQUIRE_THROWS(from(rx::Throw<int>(std::runtime_error("throw operator")))
- .select([](int v){return v;})
- .subscribe([](int){}, [](){}, [](std::exception_ptr){ throw std::runtime_error("onerror throws"); }));
- }
- }
-
- WHEN("subscribed to oncompleted that throws"){
- THEN("the exception is not supressed"){
- REQUIRE_THROWS(from(rx::Empty<int>())
- .select([](int v){return v;})
- .subscribe([](int){}, [](){ throw std::runtime_error("oncompleted throws"); }, [](std::exception_ptr){}));
- }
- }
- }
-}
-
-SCENARIO("select should throw", "[select][map][operators][hide]"){
- GIVEN("select"){
- WHEN("subscribe throws"){
- THEN("the exception is not supressed"){
- // not yet sure why this fails
- auto subscribe_throws = [](std::shared_ptr<rxcpp::Observer<int>> observer) -> rxcpp::Disposable {
- throw std::runtime_error("subscribe throws"); };
- REQUIRE_THROWS(from(rx::CreateObservable<int>(subscribe_throws))
- .select([](int v){return v;})
- .subscribe([](int){}));
- }
- }
- }
-}
-
-SCENARIO("select stops on completion", "[select][map][operators]"){
- GIVEN("a test hot observable of ints"){
- auto scheduler = std::make_shared<rx::TestScheduler>();
- typedef rx::TestScheduler::Messages<int> m;
-
- long invoked = 0;
-
- auto xs = scheduler->CreateHotObservable(
- []() {
- m::RecordedT messages[] = {
- m::OnNext(180, 1),
- m::OnNext(210, 2),
- m::OnNext(240, 3),
- m::OnNext(290, 4),
- m::OnNext(350, 5),
- m::OnCompleted(400),
- m::OnNext(410, -1),
- m::OnCompleted(420),
- m::OnError(430, std::exception())
- };
- return m::ToVector(messages);
- }()
- );
-
- WHEN("mapped to ints that are one larger"){
-
- auto res = scheduler->Start<int>(
- [xs, &invoked]() {
- return rx::observable(rx::from(xs)
- .select([&invoked](int x) {
- invoked++;
- return x + 1;
- }));
- }
- );
-
- THEN("the output only contains primes"){
- m::RecordedT items[] = {
- m::OnNext(210, 3),
- m::OnNext(240, 4),
- m::OnNext(290, 5),
- m::OnNext(350, 6),
- m::OnCompleted(400),
- };
- auto required = m::ToVector(items);
- auto actual = res->Messages();
- REQUIRE(required == actual);
- }
-
- THEN("there was one subscription and one unsubscription"){
- rx::Subscription items[] = {
- m::Subscribe(200, 400)
- };
- auto required = m::ToVector(items);
- auto actual = xs->Subscriptions();
- REQUIRE(required == actual);
- }
-
- THEN("where was called until completed"){
- REQUIRE(4 == invoked);
- }
- }
- }
-}
-
-SCENARIO("select stops on disposal", "[select][map][operators]"){
- GIVEN("a test hot observable of ints"){
- auto scheduler = std::make_shared<rx::TestScheduler>();
- typedef rx::TestScheduler::Messages<int> m;
-
- long invoked = 0;
-
- auto xs = scheduler->CreateHotObservable(
- []() {
- m::RecordedT messages[] = {
- m::OnNext(100, 1),
- m::OnNext(200, 2),
- m::OnNext(500, 3),
- m::OnNext(600, 4)
- };
- return m::ToVector(messages);
- }()
- );
-
- auto res = scheduler->CreateObserver<int>();
-
- WHEN("the ints are identity mapped"){
-
- rx::SerialDisposable d;
-
- d.Set(observable(from(xs)
- .select([&](int x) {
- invoked++;
- if (scheduler->Clock() > 400) {
- d.Dispose();
- }
- return x;
- }))
- ->Subscribe(observer(res))
- );
-
- scheduler->ScheduleAbsolute(rx::TestScheduler::Disposed, [&](rx::Scheduler::shared) {
- d.Dispose(); return rx::Disposable::Empty();});
-
- scheduler->Start();
-
- THEN("the output only contains values that arrived before disposal"){
- m::RecordedT items[] = {
- m::OnNext(100, 1),
- m::OnNext(200, 2)
- };
- auto required = m::ToVector(items);
- auto actual = res->Messages();
- REQUIRE(required == actual);
- }
-
- THEN("there was one subscription and one unsubscription"){
- rx::Subscription items[] = {
- m::Subscribe(0, 500)
- };
- auto required = m::ToVector(items);
- auto actual = xs->Subscriptions();
- REQUIRE(required == actual);
- }
-
- THEN("select was called until disposed"){
- REQUIRE(3 == invoked);
- }
- }
- }
-}
diff --git a/Rx/CPP/test/operators/SelectMany.cpp b/Rx/CPP/test/operators/SelectMany.cpp
deleted file mode 100644
index 9daef6c..0000000
--- a/Rx/CPP/test/operators/SelectMany.cpp
+++ /dev/null
@@ -1,279 +0,0 @@
-#include "cpprx/rx.hpp"
-namespace rx=rxcpp;
-
-#include "catch.hpp"
-
-SCENARIO("select_many completes", "[select_many][map][operators]"){
- GIVEN("two cold observables. one of ints. one of strings."){
- auto scheduler = std::make_shared<rx::TestScheduler>();
- typedef rx::TestScheduler::Messages<int> m;
- typedef rx::TestScheduler::Messages<std::string> ms;
-
- long invoked = 0;
-
- auto xs = scheduler->CreateColdObservable(
- []() {
- m::RecordedT messages[] = {
- m::OnNext(100, 4),
- m::OnNext(200, 2),
- m::OnNext(300, 3),
- m::OnNext(400, 1),
- m::OnCompleted(500)
- };
- return m::ToVector(messages);
- }()
- );
-
- auto ys = scheduler->CreateColdObservable(
- []() {
- ms::RecordedT messages[] = {
- ms::OnNext(50, "foo"),
- ms::OnNext(100, "bar"),
- ms::OnNext(150, "baz"),
- ms::OnNext(200, "qux"),
- ms::OnCompleted(250)
- };
- return ms::ToVector(messages);
- }()
- );
-
- WHEN("each int is mapped to the strings"){
-
- auto res = scheduler->Start<std::string>(
- [&]() {
- return observable(from(xs)
- .select_many([&](int){return ys;}));
- }
- );
-
- THEN("the output contains strings repeated for each int"){
- ms::RecordedT items[] = {
- ms::OnNext(350, "foo"),
- ms::OnNext(400, "bar"),
- ms::OnNext(450, "foo"),
- ms::OnNext(450, "baz"),
- ms::OnNext(500, "bar"),
- ms::OnNext(500, "qux"),
- ms::OnNext(550, "baz"),
- ms::OnNext(550, "foo"),
- ms::OnNext(600, "bar"),
- ms::OnNext(600, "qux"),
- ms::OnNext(650, "baz"),
- ms::OnNext(650, "foo"),
- ms::OnNext(700, "qux"),
- ms::OnNext(700, "bar"),
- ms::OnNext(750, "baz"),
- ms::OnNext(800, "qux"),
- ms::OnCompleted(850)
- };
- auto required = ms::ToVector(items);
- auto actual = res->Messages();
- REQUIRE(required == actual);
- }
-
- THEN("there was one subscription and one unsubscription to the ints"){
- rx::Subscription items[] = {
- m::Subscribe(200, 700)
- };
- auto required = m::ToVector(items);
- auto actual = xs->Subscriptions();
- REQUIRE(required == actual);
- }
-
- THEN("there were four subscription and unsubscription to the strings"){
- rx::Subscription items[] = {
- ms::Subscribe(300, 550),
- ms::Subscribe(400, 650),
- ms::Subscribe(500, 750),
- ms::Subscribe(600, 850)
- };
- auto required = m::ToVector(items);
- auto actual = ys->Subscriptions();
- REQUIRE(required == actual);
- }
- }
- }
-}
-
-SCENARIO("select_many source never ends", "[select_many][map][operators]"){
- GIVEN("two cold observables. one of ints. one of strings."){
- auto scheduler = std::make_shared<rx::TestScheduler>();
- typedef rx::TestScheduler::Messages<int> m;
- typedef rx::TestScheduler::Messages<std::string> ms;
-
- long invoked = 0;
-
- auto xs = scheduler->CreateColdObservable(
- []() {
- m::RecordedT messages[] = {
- m::OnNext(100, 4),
- m::OnNext(200, 2),
- m::OnNext(300, 3),
- m::OnNext(400, 1),
- m::OnNext(500, 5),
- m::OnNext(700, 0)
- };
- return m::ToVector(messages);
- }()
- );
-
- auto ys = scheduler->CreateColdObservable(
- []() {
- ms::RecordedT messages[] = {
- ms::OnNext(55, "foo"),
- ms::OnNext(104, "bar"),
- ms::OnNext(153, "baz"),
- ms::OnNext(202, "qux"),
- ms::OnCompleted(251)
- };
- return ms::ToVector(messages);
- }()
- );
-
- WHEN("each int is mapped to the strings"){
-
- auto res = scheduler->Start<std::string>(
- [&]() {
- return observable(from(xs)
- .select_many([&](int){return ys;}));
- }
- );
-
- THEN("the output contains strings repeated for each int"){
- ms::RecordedT items[] = {
- ms::OnNext(355, "foo"),
- ms::OnNext(404, "bar"),
- ms::OnNext(453, "baz"),
- ms::OnNext(455, "foo"),
- ms::OnNext(502, "qux"),
- ms::OnNext(504, "bar"),
- ms::OnNext(553, "baz"),
- ms::OnNext(555, "foo"),
- ms::OnNext(602, "qux"),
- ms::OnNext(604, "bar"),
- ms::OnNext(653, "baz"),
- ms::OnNext(655, "foo"),
- ms::OnNext(702, "qux"),
- ms::OnNext(704, "bar"),
- ms::OnNext(753, "baz"),
- ms::OnNext(755, "foo"),
- ms::OnNext(802, "qux"),
- ms::OnNext(804, "bar"),
- ms::OnNext(853, "baz"),
- ms::OnNext(902, "qux"),
- ms::OnNext(955, "foo")
- };
- auto required = ms::ToVector(items);
- auto actual = res->Messages();
- REQUIRE(required == actual);
- }
-
- THEN("there was one subscription and one unsubscription to the ints"){
- rx::Subscription items[] = {
- m::Subscribe(200, 1000)
- };
- auto required = m::ToVector(items);
- auto actual = xs->Subscriptions();
- REQUIRE(required == actual);
- }
-
- THEN("there were four subscription and unsubscription to the strings"){
- rx::Subscription items[] = {
- ms::Subscribe(300, 551),
- ms::Subscribe(400, 651),
- ms::Subscribe(500, 751),
- ms::Subscribe(600, 851),
- ms::Subscribe(700, 951),
- ms::Subscribe(900, 1000)
- };
- auto required = m::ToVector(items);
- auto actual = ys->Subscriptions();
- REQUIRE(required == actual);
- }
- }
- }
-}
-
-SCENARIO("select_many inner error", "[select_many][map][operators]"){
- GIVEN("two cold observables. one of ints. one of strings."){
- auto scheduler = std::make_shared<rx::TestScheduler>();
- typedef rx::TestScheduler::Messages<int> m;
- typedef rx::TestScheduler::Messages<std::string> ms;
-
- long invoked = 0;
-
- auto xs = scheduler->CreateColdObservable(
- []() {
- m::RecordedT messages[] = {
- m::OnNext(100, 4),
- m::OnNext(200, 2),
- m::OnNext(300, 3),
- m::OnNext(400, 1),
- m::OnCompleted(500)
- };
- return m::ToVector(messages);
- }()
- );
-
- auto ys = scheduler->CreateColdObservable(
- []() {
- ms::RecordedT messages[] = {
- ms::OnNext(55, "foo"),
- ms::OnNext(104, "bar"),
- ms::OnNext(153, "baz"),
- ms::OnNext(202, "qux"),
- ms::OnError(301, std::exception())
- };
- return ms::ToVector(messages);
- }()
- );
-
- WHEN("each int is mapped to the strings"){
-
- auto res = scheduler->Start<std::string>(
- [&]() {
- return observable(from(xs)
- .select_many([&](int){return ys;}));
- }
- );
-
- THEN("the output contains strings repeated for each int"){
- ms::RecordedT items[] = {
- ms::OnNext(355, "foo"),
- ms::OnNext(404, "bar"),
- ms::OnNext(453, "baz"),
- ms::OnNext(455, "foo"),
- ms::OnNext(502, "qux"),
- ms::OnNext(504, "bar"),
- ms::OnNext(553, "baz"),
- ms::OnNext(555, "foo"),
- ms::OnError(601, std::exception())
- };
- auto required = ms::ToVector(items);
- auto actual = res->Messages();
- REQUIRE(required == actual);
- }
-
- THEN("there was one subscription and one unsubscription to the ints"){
- rx::Subscription items[] = {
- m::Subscribe(200, 601)
- };
- auto required = m::ToVector(items);
- auto actual = xs->Subscriptions();
- REQUIRE(required == actual);
- }
-
- THEN("there were four subscription and unsubscription to the strings"){
- rx::Subscription items[] = {
- ms::Subscribe(300, 601),
- ms::Subscribe(400, 601),
- ms::Subscribe(500, 601),
- ms::Subscribe(600, 601)
- };
- auto required = ms::ToVector(items);
- auto actual = ys->Subscriptions();
- REQUIRE(required == actual);
- }
- }
- }
-}
diff --git a/Rx/CPP/test/operators/Where.cpp b/Rx/CPP/test/operators/Where.cpp
deleted file mode 100644
index ddfbb3a..0000000
--- a/Rx/CPP/test/operators/Where.cpp
+++ /dev/null
@@ -1,389 +0,0 @@
-#include "cpprx/rx.hpp"
-namespace rx=rxcpp;
-
-#include "catch.hpp"
-
-bool IsPrime(int x)
-{
- if (x < 2) return false;
- for (int i = 2; i <= x/2; ++i)
- {
- if (x % i == 0)
- return false;
- }
- return true;
-}
-
-SCENARIO("where stops on completion", "[where][filter][operators]"){
- GIVEN("a test hot observable of ints"){
- auto scheduler = std::make_shared<rx::TestScheduler>();
- typedef rx::TestScheduler::Messages<int> m;
-
- long invoked = 0;
-
- auto xs = scheduler->CreateHotObservable(
- []() {
- m::RecordedT messages[] = {
- m::OnNext(110, 1),
- m::OnNext(180, 2),
- m::OnNext(230, 3),
- m::OnNext(270, 4),
- m::OnNext(340, 5),
- m::OnNext(380, 6),
- m::OnNext(390, 7),
- m::OnNext(450, 8),
- m::OnNext(470, 9),
- m::OnNext(560, 10),
- m::OnNext(580, 11),
- m::OnCompleted(600),
- m::OnNext(610, 12),
- m::OnError(620, std::exception()),
- m::OnCompleted(630)
- };
- return m::ToVector(messages);
- }()
- );
-
- WHEN("filtered to ints that are primes"){
-
- auto res = scheduler->Start<int>(
- [xs, &invoked]() {
- return rx::observable(rx::from(xs)
- .where([&invoked](int x) {
- invoked++;
- return IsPrime(x);
- }));
- }
- );
-
- THEN("the output only contains primes"){
- m::RecordedT items[] = {
- m::OnNext(230, 3),
- m::OnNext(340, 5),
- m::OnNext(390, 7),
- m::OnNext(580, 11),
- m::OnCompleted(600)
- };
- auto required = m::ToVector(items);
- auto actual = res->Messages();
- REQUIRE(required == actual);
- }
-
- THEN("there was one subscription and one unsubscription"){
- rx::Subscription items[] = {
- m::Subscribe(200, 600)
- };
- auto required = m::ToVector(items);
- auto actual = xs->Subscriptions();
- REQUIRE(required == actual);
- }
-
- THEN("where was called until completed"){
- REQUIRE(9 == invoked);
- }
- }
- }
-}
-
-SCENARIO("where stops on disposal", "[where][filter][operators]"){
- GIVEN("a test hot observable of ints"){
- auto scheduler = std::make_shared<rx::TestScheduler>();
- typedef rx::TestScheduler::Messages<int> m;
-
- long invoked = 0;
-
- auto xs = scheduler->CreateHotObservable(
- []() {
- m::RecordedT messages[] = {
- m::OnNext(110, 1),
- m::OnNext(180, 2),
- m::OnNext(230, 3),
- m::OnNext(270, 4),
- m::OnNext(340, 5),
- m::OnNext(380, 6),
- m::OnNext(390, 7),
- m::OnNext(450, 8),
- m::OnNext(470, 9),
- m::OnNext(560, 10),
- m::OnNext(580, 11),
- m::OnCompleted(600)
- };
- return m::ToVector(messages);
- }()
- );
-
- WHEN("filtered to ints that are primes"){
-
- auto res = scheduler->Start<int>(
- [xs, &invoked]() {
- return rx::observable(rx::from(xs)
- .where([&invoked](int x) {
- invoked++;
- return IsPrime(x);
- }));
- },
- 400
- );
-
- THEN("the output only contains primes that arrived before disposal"){
- m::RecordedT items[] = {
- m::OnNext(230, 3),
- m::OnNext(340, 5),
- m::OnNext(390, 7)
- };
- auto required = m::ToVector(items);
- auto actual = res->Messages();
- REQUIRE(required == actual);
- }
-
- THEN("there was one subscription and one unsubscription"){
- rx::Subscription items[] = {
- m::Subscribe(200, 400)
- };
- auto required = m::ToVector(items);
- auto actual = xs->Subscriptions();
- REQUIRE(required == actual);
- }
-
- THEN("where was called until disposed"){
- REQUIRE(5 == invoked);
- }
- }
- }
-}
-
-SCENARIO("where stops on error", "[where][filter][operators]"){
- GIVEN("a test hot observable of ints"){
- auto scheduler = std::make_shared<rx::TestScheduler>();
- typedef rx::TestScheduler::Messages<int> m;
-
- long invoked = 0;
-
- std::exception ex;
-
- auto xs = scheduler->CreateHotObservable(
- [ex]() {
- m::RecordedT messages[] = {
- m::OnNext(110, 1),
- m::OnNext(180, 2),
- m::OnNext(230, 3),
- m::OnNext(270, 4),
- m::OnNext(340, 5),
- m::OnNext(380, 6),
- m::OnNext(390, 7),
- m::OnNext(450, 8),
- m::OnNext(470, 9),
- m::OnNext(560, 10),
- m::OnNext(580, 11),
- m::OnError(600, ex),
- m::OnNext(610, 12),
- m::OnError(620, std::exception()),
- m::OnCompleted(630)
- };
- return m::ToVector(messages);
- }()
- );
-
- WHEN("filtered to ints that are primes"){
-
- auto res = scheduler->Start<int>(
- [xs, &invoked]() {
- return rx::observable(rx::from(xs)
- .where([&invoked](int x) {
- invoked++;
- return IsPrime(x);
- }));
- }
- );
-
- THEN("the output only contains primes"){
- m::RecordedT items[] = {
- m::OnNext(230, 3),
- m::OnNext(340, 5),
- m::OnNext(390, 7),
- m::OnNext(580, 11),
- m::OnError(600, ex),
- };
- auto required = m::ToVector(items);
- auto actual = res->Messages();
- REQUIRE(required == actual);
- }
-
- THEN("there was one subscription and one unsubscription"){
- rx::Subscription items[] = {
- m::Subscribe(200, 600)
- };
- auto required = m::ToVector(items);
- auto actual = xs->Subscriptions();
- REQUIRE(required == actual);
- }
-
- THEN("where was called until error"){
- REQUIRE(9 == invoked);
- }
- }
- }
-}
-
-SCENARIO("where stops on throw from predicate", "[where][filter][operators]"){
- GIVEN("a test hot observable of ints"){
- auto scheduler = std::make_shared<rx::TestScheduler>();
- typedef rx::TestScheduler::Messages<int> m;
-
- long invoked = 0;
-
- std::exception ex;
-
- auto xs = scheduler->CreateHotObservable(
- []() {
- m::RecordedT messages[] = {
- m::OnNext(110, 1),
- m::OnNext(180, 2),
- m::OnNext(230, 3),
- m::OnNext(270, 4),
- m::OnNext(340, 5),
- m::OnNext(380, 6),
- m::OnNext(390, 7),
- m::OnNext(450, 8),
- m::OnNext(470, 9),
- m::OnNext(560, 10),
- m::OnNext(580, 11),
- m::OnCompleted(600),
- m::OnNext(610, 12),
- m::OnError(620, std::exception()),
- m::OnCompleted(630)
- };
- return m::ToVector(messages);
- }()
- );
-
- WHEN("filtered to ints that are primes"){
-
- auto res = scheduler->Start<int>(
- [ex, xs, &invoked]() {
- return rx::observable(rx::from(xs)
- .where([ex, &invoked](int x) {
- invoked++;
- if (x > 5) {
- throw ex;
- }
- return IsPrime(x);
- }));
- }
- );
-
- THEN("the output only contains primes"){
- m::RecordedT items[] = {
- m::OnNext(230, 3),
- m::OnNext(340, 5),
- m::OnError(380, ex)
- };
- auto required = m::ToVector(items);
- auto actual = res->Messages();
- REQUIRE(required == actual);
- }
-
- THEN("there was one subscription and one unsubscription"){
- rx::Subscription items[] = {
- m::Subscribe(200, 380)
- };
- auto required = m::ToVector(items);
- auto actual = xs->Subscriptions();
- REQUIRE(required == actual);
- }
-
- THEN("where was called until error"){
- REQUIRE(4 == invoked);
- }
- }
- }
-}
-
-SCENARIO("where stops on dispose from predicate", "[where][filter][operators]"){
- GIVEN("a test hot observable of ints"){
- auto scheduler = std::make_shared<rx::TestScheduler>();
- typedef rx::TestScheduler::Messages<int> m;
-
- long invoked = 0;
-
- auto xs = scheduler->CreateHotObservable(
- []() {
- m::RecordedT messages[] = {
- m::OnNext(110, 1),
- m::OnNext(180, 2),
- m::OnNext(230, 3),
- m::OnNext(270, 4),
- m::OnNext(340, 5),
- m::OnNext(380, 6),
- m::OnNext(390, 7),
- m::OnNext(450, 8),
- m::OnNext(470, 9),
- m::OnNext(560, 10),
- m::OnNext(580, 11),
- m::OnCompleted(600),
- m::OnNext(610, 12),
- m::OnError(620, std::exception()),
- m::OnCompleted(630)
- };
- return m::ToVector(messages);
- }()
- );
-
- auto res = scheduler->CreateObserver<int>();
-
- rx::SerialDisposable d;
- std::shared_ptr<rx::Observable<int>> ys;
-
- WHEN("filtered to ints that are primes"){
-
- scheduler->ScheduleAbsolute(rx::TestScheduler::Created,
- [&invoked, &d, &ys, &xs](rx::Scheduler::shared) {
- ys = rx::observable(rx::from(xs)
- .where([&invoked, &d](int x) {
- invoked++;
- if (x == 8)
- d.Dispose();
- return IsPrime(x);
- }));
- return rx::Disposable::Empty();
- });
-
- scheduler->ScheduleAbsolute(rx::TestScheduler::Subscribed, [&d, &ys, &res](rx::Scheduler::shared) {
- d.Set(ys->Subscribe(res));
- return rx::Disposable::Empty();
- });
-
- scheduler->ScheduleAbsolute(rx::TestScheduler::Disposed, [&d](rx::Scheduler::shared) {
- d.Dispose();
- return rx::Disposable::Empty();
- });
-
- scheduler->Start();
-
- THEN("the output only contains primes"){
- m::RecordedT items[] = {
- m::OnNext(230, 3),
- m::OnNext(340, 5),
- m::OnNext(390, 7)
- };
- auto required = m::ToVector(items);
- auto actual = res->Messages();
- REQUIRE(required == actual);
- }
-
- THEN("there was one subscription and one unsubscription"){
- rx::Subscription items[] = {
- m::Subscribe(200, 450)
- };
- auto required = m::ToVector(items);
- auto actual = xs->Subscriptions();
- REQUIRE(required == actual);
- }
-
- THEN("where was called until disposed"){
- REQUIRE(6 == invoked);
- }
- }
- }
-}
-
diff --git a/Rx/CPP/test/test.cpp b/Rx/CPP/test/test.cpp
deleted file mode 100644
index 0c7c351..0000000
--- a/Rx/CPP/test/test.cpp
+++ /dev/null
@@ -1,2 +0,0 @@
-#define CATCH_CONFIG_MAIN
-#include "catch.hpp"
diff --git a/Rx/CPP/testbench/data.txt b/Rx/CPP/testbench/data.txt
deleted file mode 100644
index b16aea6..0000000
--- a/Rx/CPP/testbench/data.txt
+++ /dev/null
@@ -1,655 +0,0 @@
-{'var': [('concurrency', 1), ('args', '-test async-gated')], 'result': {'workingset': 22437888.0, 'privatemem': 25964544.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 71.9785421875}}
-{'var': [('concurrency', 1), ('args', '-test async-gated')], 'result': {'workingset': 22626304.0, 'privatemem': 26136576.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 71.956228125}}
-{'var': [('concurrency', 1), ('args', '-test async-gated')], 'result': {'workingset': 22503424.0, 'privatemem': 25968640.0, 'nonpaged': 25384.0, 'virtualmem': 556580864.0, 'time': 71.741975}}
-{'var': [('concurrency', 1), ('args', '-test async-gated')], 'result': {'workingset': 22667264.0, 'privatemem': 26177536.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 71.189240625}}
-{'var': [('concurrency', 1), ('args', '-test async-gated')], 'result': {'workingset': 22323200.0, 'privatemem': 25808896.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 71.7897296875}}
-{'var': [('concurrency', 1), ('args', '-test ums-gated')], 'result': {'workingset': 14917632.0, 'privatemem': 20385792.0, 'nonpaged': 26784.0, 'virtualmem': 577224704.0, 'time': 45.734965625}}
-{'var': [('concurrency', 1), ('args', '-test ums-gated')], 'result': {'workingset': 15060992.0, 'privatemem': 20545536.0, 'nonpaged': 26784.0, 'virtualmem': 577224704.0, 'time': 45.028878125}}
-{'var': [('concurrency', 1), ('args', '-test ums-gated')], 'result': {'workingset': 15052800.0, 'privatemem': 20529152.0, 'nonpaged': 26768.0, 'virtualmem': 577224704.0, 'time': 45.5304375}}
-{'var': [('concurrency', 1), ('args', '-test ums-gated')], 'result': {'workingset': 14934016.0, 'privatemem': 20406272.0, 'nonpaged': 26784.0, 'virtualmem': 577224704.0, 'time': 45.898271875}}
-{'var': [('concurrency', 1), ('args', '-test ums-gated')], 'result': {'workingset': 14991360.0, 'privatemem': 20447232.0, 'nonpaged': 26784.0, 'virtualmem': 577224704.0, 'time': 45.425371875}}
-{'var': [('concurrency', 2), ('args', '-test async-gated')], 'result': {'workingset': 22626304.0, 'privatemem': 26013696.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 32.748084375}}
-{'var': [('concurrency', 2), ('args', '-test async-gated')], 'result': {'workingset': 22806528.0, 'privatemem': 26202112.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 33.5510765625}}
-{'var': [('concurrency', 2), ('args', '-test async-gated')], 'result': {'workingset': 22556672.0, 'privatemem': 26021888.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 33.0404453125}}
-{'var': [('concurrency', 2), ('args', '-test async-gated')], 'result': {'workingset': 22609920.0, 'privatemem': 26038272.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 34.0872890625}}
-{'var': [('concurrency', 2), ('args', '-test async-gated')], 'result': {'workingset': 22573056.0, 'privatemem': 25976832.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 33.026740625}}
-{'var': [('concurrency', 2), ('args', '-test ums-gated')], 'result': {'workingset': 15093760.0, 'privatemem': 21082112.0, 'nonpaged': 27744.0, 'virtualmem': 594001920.0, 'time': 23.0056984375}}
-{'var': [('concurrency', 2), ('args', '-test ums-gated')], 'result': {'workingset': 15208448.0, 'privatemem': 20918272.0, 'nonpaged': 27264.0, 'virtualmem': 585613312.0, 'time': 23.2537171875}}
-{'var': [('concurrency', 2), ('args', '-test ums-gated')], 'result': {'workingset': 15208448.0, 'privatemem': 20905984.0, 'nonpaged': 27264.0, 'virtualmem': 585613312.0, 'time': 23.2316484375}}
-{'var': [('concurrency', 2), ('args', '-test ums-gated')], 'result': {'workingset': 15192064.0, 'privatemem': 20910080.0, 'nonpaged': 27264.0, 'virtualmem': 585613312.0, 'time': 23.259509375}}
-{'var': [('concurrency', 2), ('args', '-test ums-gated')], 'result': {'workingset': 15273984.0, 'privatemem': 20979712.0, 'nonpaged': 27264.0, 'virtualmem': 585613312.0, 'time': 23.3385359375}}
-{'var': [('concurrency', 3), ('args', '-test async-gated')], 'result': {'workingset': 22581248.0, 'privatemem': 25952256.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 20.2717265625}}
-{'var': [('concurrency', 3), ('args', '-test async-gated')], 'result': {'workingset': 22667264.0, 'privatemem': 26046464.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 20.2175609375}}
-{'var': [('concurrency', 3), ('args', '-test async-gated')], 'result': {'workingset': 22732800.0, 'privatemem': 26042368.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 20.07530625}}
-{'var': [('concurrency', 3), ('args', '-test async-gated')], 'result': {'workingset': 22589440.0, 'privatemem': 26013696.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 20.281884375}}
-{'var': [('concurrency', 3), ('args', '-test async-gated')], 'result': {'workingset': 22831104.0, 'privatemem': 26185728.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 20.05386875}}
-{'var': [('concurrency', 3), ('args', '-test ums-gated')], 'result': {'workingset': 15245312.0, 'privatemem': 21233664.0, 'nonpaged': 27744.0, 'virtualmem': 594001920.0, 'time': 15.3586671875}}
-{'var': [('concurrency', 3), ('args', '-test ums-gated')], 'result': {'workingset': 15310848.0, 'privatemem': 21250048.0, 'nonpaged': 27744.0, 'virtualmem': 594001920.0, 'time': 15.70775625}}
-{'var': [('concurrency', 3), ('args', '-test ums-gated')], 'result': {'workingset': 15347712.0, 'privatemem': 21254144.0, 'nonpaged': 27744.0, 'virtualmem': 594001920.0, 'time': 15.6456703125}}
-{'var': [('concurrency', 3), ('args', '-test ums-gated')], 'result': {'workingset': 15273984.0, 'privatemem': 21180416.0, 'nonpaged': 27744.0, 'virtualmem': 594001920.0, 'time': 15.303421875}}
-{'var': [('concurrency', 3), ('args', '-test ums-gated')], 'result': {'workingset': 15335424.0, 'privatemem': 21299200.0, 'nonpaged': 27744.0, 'virtualmem': 594001920.0, 'time': 15.4817796875}}
-{'var': [('concurrency', 4), ('args', '-test async-gated')], 'result': {'workingset': 22630400.0, 'privatemem': 25980928.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.7404328125}}
-{'var': [('concurrency', 4), ('args', '-test async-gated')], 'result': {'workingset': 22482944.0, 'privatemem': 25964544.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 15.2058328125}}
-{'var': [('concurrency', 4), ('args', '-test async-gated')], 'result': {'workingset': 22646784.0, 'privatemem': 25972736.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 17.3264390625}}
-{'var': [('concurrency', 4), ('args', '-test async-gated')], 'result': {'workingset': 22634496.0, 'privatemem': 26091520.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 16.233396875}}
-{'var': [('concurrency', 4), ('args', '-test async-gated')], 'result': {'workingset': 22749184.0, 'privatemem': 26120192.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 15.4778453125}}
-{'var': [('concurrency', 4), ('args', '-test ums-gated')], 'result': {'workingset': 15200256.0, 'privatemem': 21196800.0, 'nonpaged': 27744.0, 'virtualmem': 594001920.0, 'time': 12.3187859375}}
-{'var': [('concurrency', 4), ('args', '-test ums-gated')], 'result': {'workingset': 15474688.0, 'privatemem': 21725184.0, 'nonpaged': 28224.0, 'virtualmem': 602390528.0, 'time': 11.6904421875}}
-{'var': [('concurrency', 4), ('args', '-test ums-gated')], 'result': {'workingset': 15384576.0, 'privatemem': 21630976.0, 'nonpaged': 28224.0, 'virtualmem': 602390528.0, 'time': 10.795390625}}
-{'var': [('concurrency', 4), ('args', '-test ums-gated')], 'result': {'workingset': 15364096.0, 'privatemem': 21606400.0, 'nonpaged': 28224.0, 'virtualmem': 602390528.0, 'time': 10.5224484375}}
-{'var': [('concurrency', 4), ('args', '-test ums-gated')], 'result': {'workingset': 15343616.0, 'privatemem': 21590016.0, 'nonpaged': 28224.0, 'virtualmem': 602390528.0, 'time': 10.4604203125}}
-{'var': [('concurrency', 5), ('args', '-test async-gated')], 'result': {'workingset': 22536192.0, 'privatemem': 25972736.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 14.291790625}}
-{'var': [('concurrency', 5), ('args', '-test async-gated')], 'result': {'workingset': 22753280.0, 'privatemem': 26103808.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.8192703125}}
-{'var': [('concurrency', 5), ('args', '-test async-gated')], 'result': {'workingset': 22585344.0, 'privatemem': 25919488.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 14.1479078125}}
-{'var': [('concurrency', 5), ('args', '-test async-gated')], 'result': {'workingset': 22728704.0, 'privatemem': 26058752.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.7772765625}}
-{'var': [('concurrency', 5), ('args', '-test async-gated')], 'result': {'workingset': 22691840.0, 'privatemem': 26103808.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.4325453125}}
-{'var': [('concurrency', 5), ('args', '-test ums-gated')], 'result': {'workingset': 15458304.0, 'privatemem': 21950464.0, 'nonpaged': 28704.0, 'virtualmem': 610779136.0, 'time': 11.653565625}}
-{'var': [('concurrency', 5), ('args', '-test ums-gated')], 'result': {'workingset': 15622144.0, 'privatemem': 22114304.0, 'nonpaged': 28688.0, 'virtualmem': 610779136.0, 'time': 11.60025}}
-{'var': [('concurrency', 5), ('args', '-test ums-gated')], 'result': {'workingset': 15491072.0, 'privatemem': 21975040.0, 'nonpaged': 28704.0, 'virtualmem': 610779136.0, 'time': 15.956359375}}
-{'var': [('concurrency', 5), ('args', '-test ums-gated')], 'result': {'workingset': 15429632.0, 'privatemem': 21938176.0, 'nonpaged': 28704.0, 'virtualmem': 610779136.0, 'time': 16.7639015625}}
-{'var': [('concurrency', 5), ('args', '-test ums-gated')], 'result': {'workingset': 15560704.0, 'privatemem': 22102016.0, 'nonpaged': 28704.0, 'virtualmem': 610779136.0, 'time': 12.432678125}}
-{'var': [('concurrency', 6), ('args', '-test async-gated')], 'result': {'workingset': 22630400.0, 'privatemem': 26091520.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 14.482378125}}
-{'var': [('concurrency', 6), ('args', '-test async-gated')], 'result': {'workingset': 22724608.0, 'privatemem': 26005504.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 14.6995578125}}
-{'var': [('concurrency', 6), ('args', '-test async-gated')], 'result': {'workingset': 22601728.0, 'privatemem': 25972736.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.7111109375}}
-{'var': [('concurrency', 6), ('args', '-test async-gated')], 'result': {'workingset': 22675456.0, 'privatemem': 26017792.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 14.24071875}}
-{'var': [('concurrency', 6), ('args', '-test async-gated')], 'result': {'workingset': 22822912.0, 'privatemem': 26206208.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 14.1442453125}}
-{'var': [('concurrency', 6), ('args', '-test ums-gated')], 'result': {'workingset': 15446016.0, 'privatemem': 22118400.0, 'nonpaged': 28944.0, 'virtualmem': 614973440.0, 'time': 11.3196953125}}
-{'var': [('concurrency', 6), ('args', '-test ums-gated')], 'result': {'workingset': 15351808.0, 'privatemem': 21860352.0, 'nonpaged': 28704.0, 'virtualmem': 610779136.0, 'time': 13.8507890625}}
-{'var': [('concurrency', 6), ('args', '-test ums-gated')], 'result': {'workingset': 15536128.0, 'privatemem': 22384640.0, 'nonpaged': 29184.0, 'virtualmem': 619167744.0, 'time': 11.411578125}}
-{'var': [('concurrency', 6), ('args', '-test ums-gated')], 'result': {'workingset': 15728640.0, 'privatemem': 22585344.0, 'nonpaged': 29184.0, 'virtualmem': 619167744.0, 'time': 11.3764765625}}
-{'var': [('concurrency', 6), ('args', '-test ums-gated')], 'result': {'workingset': 15695872.0, 'privatemem': 22331392.0, 'nonpaged': 28944.0, 'virtualmem': 614973440.0, 'time': 11.253040625}}
-{'var': [('concurrency', 7), ('args', '-test async-gated')], 'result': {'workingset': 22650880.0, 'privatemem': 25956352.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 14.1586765625}}
-{'var': [('concurrency', 7), ('args', '-test async-gated')], 'result': {'workingset': 22700032.0, 'privatemem': 26046464.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 14.2853515625}}
-{'var': [('concurrency', 7), ('args', '-test async-gated')], 'result': {'workingset': 22663168.0, 'privatemem': 25964544.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 14.9393859375}}
-{'var': [('concurrency', 7), ('args', '-test async-gated')], 'result': {'workingset': 22597632.0, 'privatemem': 25968640.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.95501875}}
-{'var': [('concurrency', 7), ('args', '-test async-gated')], 'result': {'workingset': 22794240.0, 'privatemem': 26148864.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.9703578125}}
-{'var': [('concurrency', 7), ('args', '-test ums-gated')], 'result': {'workingset': 15720448.0, 'privatemem': 22822912.0, 'nonpaged': 29648.0, 'virtualmem': 627556352.0, 'time': 9.88916875}}
-{'var': [('concurrency', 7), ('args', '-test ums-gated')], 'result': {'workingset': 15872000.0, 'privatemem': 22978560.0, 'nonpaged': 29648.0, 'virtualmem': 627556352.0, 'time': 9.7966875}}
-{'var': [('concurrency', 7), ('args', '-test ums-gated')], 'result': {'workingset': 15642624.0, 'privatemem': 22474752.0, 'nonpaged': 29184.0, 'virtualmem': 619167744.0, 'time': 10.072915625}}
-{'var': [('concurrency', 7), ('args', '-test ums-gated')], 'result': {'workingset': 15605760.0, 'privatemem': 22548480.0, 'nonpaged': 29424.0, 'virtualmem': 623362048.0, 'time': 10.3262265625}}
-{'var': [('concurrency', 7), ('args', '-test ums-gated')], 'result': {'workingset': 15503360.0, 'privatemem': 22335488.0, 'nonpaged': 29184.0, 'virtualmem': 619167744.0, 'time': 10.3073703125}}
-{'var': [('concurrency', 8), ('args', '-test async-gated')], 'result': {'workingset': 22671360.0, 'privatemem': 26075136.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.7767140625}}
-{'var': [('concurrency', 8), ('args', '-test async-gated')], 'result': {'workingset': 22683648.0, 'privatemem': 26046464.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.6023046875}}
-{'var': [('concurrency', 8), ('args', '-test async-gated')], 'result': {'workingset': 22581248.0, 'privatemem': 25968640.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.590659375}}
-{'var': [('concurrency', 8), ('args', '-test async-gated')], 'result': {'workingset': 22671360.0, 'privatemem': 26128384.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.797509375}}
-{'var': [('concurrency', 8), ('args', '-test async-gated')], 'result': {'workingset': 22626304.0, 'privatemem': 26001408.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 14.114903125}}
-{'var': [('concurrency', 8), ('args', '-test ums-gated')], 'result': {'workingset': 15843328.0, 'privatemem': 23093248.0, 'nonpaged': 29904.0, 'virtualmem': 631750656.0, 'time': 10.8031640625}}
-{'var': [('concurrency', 8), ('args', '-test ums-gated')], 'result': {'workingset': 15695872.0, 'privatemem': 22933504.0, 'nonpaged': 29904.0, 'virtualmem': 631750656.0, 'time': 10.78183125}}
-{'var': [('concurrency', 8), ('args', '-test ums-gated')], 'result': {'workingset': 15626240.0, 'privatemem': 22466560.0, 'nonpaged': 29184.0, 'virtualmem': 619167744.0, 'time': 10.79186875}}
-{'var': [('concurrency', 8), ('args', '-test ums-gated')], 'result': {'workingset': 15998976.0, 'privatemem': 23089152.0, 'nonpaged': 29664.0, 'virtualmem': 627556352.0, 'time': 10.6507984375}}
-{'var': [('concurrency', 8), ('args', '-test ums-gated')], 'result': {'workingset': 15769600.0, 'privatemem': 22892544.0, 'nonpaged': 29664.0, 'virtualmem': 627556352.0, 'time': 10.7464046875}}
-{'var': [('concurrency', 10), ('args', '-test async-gated')], 'result': {'workingset': 22761472.0, 'privatemem': 26107904.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.5812421875}}
-{'var': [('concurrency', 10), ('args', '-test async-gated')], 'result': {'workingset': 22626304.0, 'privatemem': 26030080.0, 'nonpaged': 25640.0, 'virtualmem': 560775168.0, 'time': 13.8055078125}}
-{'var': [('concurrency', 10), ('args', '-test async-gated')], 'result': {'workingset': 23019520.0, 'privatemem': 26374144.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.661046875}}
-{'var': [('concurrency', 10), ('args', '-test async-gated')], 'result': {'workingset': 22810624.0, 'privatemem': 26165248.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.8447890625}}
-{'var': [('concurrency', 10), ('args', '-test async-gated')], 'result': {'workingset': 22786048.0, 'privatemem': 26157056.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.7037859375}}
-{'var': [('concurrency', 10), ('args', '-test ums-gated')], 'result': {'workingset': 15937536.0, 'privatemem': 23482368.0, 'nonpaged': 30384.0, 'virtualmem': 640139264.0, 'time': 9.9560078125}}
-{'var': [('concurrency', 10), ('args', '-test ums-gated')], 'result': {'workingset': 15732736.0, 'privatemem': 22953984.0, 'nonpaged': 29888.0, 'virtualmem': 631750656.0, 'time': 9.9779875}}
-{'var': [('concurrency', 10), ('args', '-test ums-gated')], 'result': {'workingset': 15806464.0, 'privatemem': 23216128.0, 'nonpaged': 30144.0, 'virtualmem': 635944960.0, 'time': 10.0446703125}}
-{'var': [('concurrency', 10), ('args', '-test ums-gated')], 'result': {'workingset': 15765504.0, 'privatemem': 23171072.0, 'nonpaged': 30128.0, 'virtualmem': 635944960.0, 'time': 9.8954875}}
-{'var': [('concurrency', 10), ('args', '-test ums-gated')], 'result': {'workingset': 15732736.0, 'privatemem': 22679552.0, 'nonpaged': 29424.0, 'virtualmem': 623362048.0, 'time': 10.1007609375}}
-{'var': [('concurrency', 12), ('args', '-test async-gated')], 'result': {'workingset': 22589440.0, 'privatemem': 25964544.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.4936453125}}
-{'var': [('concurrency', 12), ('args', '-test async-gated')], 'result': {'workingset': 22732800.0, 'privatemem': 26148864.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.54201875}}
-{'var': [('concurrency', 12), ('args', '-test async-gated')], 'result': {'workingset': 22609920.0, 'privatemem': 25964544.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.8461453125}}
-{'var': [('concurrency', 12), ('args', '-test async-gated')], 'result': {'workingset': 22749184.0, 'privatemem': 26103808.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.5201171875}}
-{'var': [('concurrency', 12), ('args', '-test async-gated')], 'result': {'workingset': 22740992.0, 'privatemem': 26173440.0, 'nonpaged': 25384.0, 'virtualmem': 556580864.0, 'time': 13.7564125}}
-{'var': [('concurrency', 12), ('args', '-test ums-gated')], 'result': {'workingset': 16015360.0, 'privatemem': 23687168.0, 'nonpaged': 30512.0, 'virtualmem': 644333568.0, 'time': 10.308821875}}
-{'var': [('concurrency', 12), ('args', '-test ums-gated')], 'result': {'workingset': 15978496.0, 'privatemem': 23896064.0, 'nonpaged': 30992.0, 'virtualmem': 652722176.0, 'time': 10.3545609375}}
-{'var': [('concurrency', 12), ('args', '-test ums-gated')], 'result': {'workingset': 16105472.0, 'privatemem': 23773184.0, 'nonpaged': 30512.0, 'virtualmem': 644333568.0, 'time': 10.39604375}}
-{'var': [('concurrency', 12), ('args', '-test ums-gated')], 'result': {'workingset': 16003072.0, 'privatemem': 23670784.0, 'nonpaged': 30512.0, 'virtualmem': 644333568.0, 'time': 11.3077953125}}
-{'var': [('concurrency', 12), ('args', '-test ums-gated')], 'result': {'workingset': 15835136.0, 'privatemem': 23347200.0, 'nonpaged': 30272.0, 'virtualmem': 640139264.0, 'time': 11.2470921875}}
-{'var': [('concurrency', 14), ('args', '-test async-gated')], 'result': {'workingset': 22630400.0, 'privatemem': 26017792.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 14.5840734375}}
-{'var': [('concurrency', 14), ('args', '-test async-gated')], 'result': {'workingset': 22843392.0, 'privatemem': 26238976.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 14.7056515625}}
-{'var': [('concurrency', 14), ('args', '-test async-gated')], 'result': {'workingset': 22765568.0, 'privatemem': 26152960.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 14.4621296875}}
-{'var': [('concurrency', 14), ('args', '-test async-gated')], 'result': {'workingset': 22626304.0, 'privatemem': 26009600.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.7261640625}}
-{'var': [('concurrency', 14), ('args', '-test async-gated')], 'result': {'workingset': 22659072.0, 'privatemem': 26132480.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.43949375}}
-{'var': [('concurrency', 14), ('args', '-test ums-gated')], 'result': {'workingset': 16134144.0, 'privatemem': 24227840.0, 'nonpaged': 31232.0, 'virtualmem': 656916480.0, 'time': 10.1509875}}
-{'var': [('concurrency', 14), ('args', '-test ums-gated')], 'result': {'workingset': 15835136.0, 'privatemem': 23486464.0, 'nonpaged': 30512.0, 'virtualmem': 644333568.0, 'time': 10.4571375}}
-{'var': [('concurrency', 14), ('args', '-test ums-gated')], 'result': {'workingset': 15953920.0, 'privatemem': 23937024.0, 'nonpaged': 30992.0, 'virtualmem': 652722176.0, 'time': 10.21300625}}
-{'var': [('concurrency', 14), ('args', '-test ums-gated')], 'result': {'workingset': 16056320.0, 'privatemem': 24068096.0, 'nonpaged': 30992.0, 'virtualmem': 652722176.0, 'time': 10.3364984375}}
-{'var': [('concurrency', 14), ('args', '-test ums-gated')], 'result': {'workingset': 15851520.0, 'privatemem': 23621632.0, 'nonpaged': 30752.0, 'virtualmem': 648527872.0, 'time': 10.205690625}}
-{'var': [('concurrency', 16), ('args', '-test async-gated')], 'result': {'workingset': 22704128.0, 'privatemem': 26152960.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.4346625}}
-{'var': [('concurrency', 16), ('args', '-test async-gated')], 'result': {'workingset': 22941696.0, 'privatemem': 26288128.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.588709375}}
-{'var': [('concurrency', 16), ('args', '-test async-gated')], 'result': {'workingset': 22573056.0, 'privatemem': 25997312.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.383815625}}
-{'var': [('concurrency', 16), ('args', '-test async-gated')], 'result': {'workingset': 22818816.0, 'privatemem': 26148864.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.60400625}}
-{'var': [('concurrency', 16), ('args', '-test async-gated')], 'result': {'workingset': 22716416.0, 'privatemem': 26120192.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.3768921875}}
-{'var': [('concurrency', 16), ('args', '-test ums-gated')], 'result': {'workingset': 16101376.0, 'privatemem': 24428544.0, 'nonpaged': 31712.0, 'virtualmem': 665305088.0, 'time': 9.846940625}}
-{'var': [('concurrency', 16), ('args', '-test ums-gated')], 'result': {'workingset': 16089088.0, 'privatemem': 24199168.0, 'nonpaged': 31232.0, 'virtualmem': 656916480.0, 'time': 11.1524609375}}
-{'var': [('concurrency', 16), ('args', '-test ums-gated')], 'result': {'workingset': 16199680.0, 'privatemem': 24178688.0, 'nonpaged': 30992.0, 'virtualmem': 652722176.0, 'time': 9.9980328125}}
-{'var': [('concurrency', 16), ('args', '-test ums-gated')], 'result': {'workingset': 16023552.0, 'privatemem': 23977984.0, 'nonpaged': 30992.0, 'virtualmem': 652722176.0, 'time': 11.2873078125}}
-{'var': [('concurrency', 16), ('args', '-test ums-gated')], 'result': {'workingset': 16134144.0, 'privatemem': 24387584.0, 'nonpaged': 31472.0, 'virtualmem': 661110784.0, 'time': 9.934396875}}
-{'var': [('concurrency', 20), ('args', '-test async-gated')], 'result': {'workingset': 22781952.0, 'privatemem': 26120192.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.4010015625}}
-{'var': [('concurrency', 20), ('args', '-test async-gated')], 'result': {'workingset': 22585344.0, 'privatemem': 25985024.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.2167890625}}
-{'var': [('concurrency', 20), ('args', '-test async-gated')], 'result': {'workingset': 22740992.0, 'privatemem': 26152960.0, 'nonpaged': 25768.0, 'virtualmem': 564969472.0, 'time': 13.4800796875}}
-{'var': [('concurrency', 20), ('args', '-test async-gated')], 'result': {'workingset': 22671360.0, 'privatemem': 26050560.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.449178125}}
-{'var': [('concurrency', 20), ('args', '-test async-gated')], 'result': {'workingset': 22671360.0, 'privatemem': 26058752.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.2931078125}}
-{'var': [('concurrency', 20), ('args', '-test ums-gated')], 'result': {'workingset': 16310272.0, 'privatemem': 25399296.0, 'nonpaged': 32912.0, 'virtualmem': 686276608.0, 'time': 10.06823125}}
-{'var': [('concurrency', 20), ('args', '-test ums-gated')], 'result': {'workingset': 16154624.0, 'privatemem': 24883200.0, 'nonpaged': 32432.0, 'virtualmem': 677888000.0, 'time': 10.0306984375}}
-{'var': [('concurrency', 20), ('args', '-test ums-gated')], 'result': {'workingset': 16171008.0, 'privatemem': 25038848.0, 'nonpaged': 32672.0, 'virtualmem': 682082304.0, 'time': 10.06961875}}
-{'var': [('concurrency', 20), ('args', '-test ums-gated')], 'result': {'workingset': 16216064.0, 'privatemem': 24817664.0, 'nonpaged': 32192.0, 'virtualmem': 673693696.0, 'time': 10.0746796875}}
-{'var': [('concurrency', 20), ('args', '-test ums-gated')], 'result': {'workingset': 16375808.0, 'privatemem': 25542656.0, 'nonpaged': 33152.0, 'virtualmem': 690470912.0, 'time': 10.037271875}}
-{'var': [('concurrency', 24), ('args', '-test async-gated')], 'result': {'workingset': 22589440.0, 'privatemem': 25985024.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.4086859375}}
-{'var': [('concurrency', 24), ('args', '-test async-gated')], 'result': {'workingset': 22634496.0, 'privatemem': 26005504.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.3663890625}}
-{'var': [('concurrency', 24), ('args', '-test async-gated')], 'result': {'workingset': 22691840.0, 'privatemem': 26034176.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.3019828125}}
-{'var': [('concurrency', 24), ('args', '-test async-gated')], 'result': {'workingset': 22786048.0, 'privatemem': 26144768.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.389559375}}
-{'var': [('concurrency', 24), ('args', '-test async-gated')], 'result': {'workingset': 22593536.0, 'privatemem': 26005504.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.2155328125}}
-{'var': [('concurrency', 24), ('args', '-test ums-gated')], 'result': {'workingset': 16252928.0, 'privatemem': 25710592.0, 'nonpaged': 33632.0, 'virtualmem': 698859520.0, 'time': 9.93735}}
-{'var': [('concurrency', 24), ('args', '-test ums-gated')], 'result': {'workingset': 16265216.0, 'privatemem': 25427968.0, 'nonpaged': 33152.0, 'virtualmem': 690470912.0, 'time': 9.9944796875}}
-{'var': [('concurrency', 24), ('args', '-test ums-gated')], 'result': {'workingset': 16236544.0, 'privatemem': 25595904.0, 'nonpaged': 33392.0, 'virtualmem': 694665216.0, 'time': 9.94461875}}
-{'var': [('concurrency', 24), ('args', '-test ums-gated')], 'result': {'workingset': 16257024.0, 'privatemem': 25403392.0, 'nonpaged': 33152.0, 'virtualmem': 690470912.0, 'time': 9.94913125}}
-{'var': [('concurrency', 24), ('args', '-test ums-gated')], 'result': {'workingset': 16424960.0, 'privatemem': 26009600.0, 'nonpaged': 33872.0, 'virtualmem': 703053824.0, 'time': 9.9931234375}}
-{'var': [('concurrency', 28), ('args', '-test async-gated')], 'result': {'workingset': 22814720.0, 'privatemem': 26169344.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.376209375}}
-{'var': [('concurrency', 28), ('args', '-test async-gated')], 'result': {'workingset': 22528000.0, 'privatemem': 25866240.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.2378046875}}
-{'var': [('concurrency', 28), ('args', '-test async-gated')], 'result': {'workingset': 22761472.0, 'privatemem': 26128384.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.225084375}}
-{'var': [('concurrency', 28), ('args', '-test async-gated')], 'result': {'workingset': 22663168.0, 'privatemem': 26038272.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.23915625}}
-{'var': [('concurrency', 28), ('args', '-test async-gated')], 'result': {'workingset': 22831104.0, 'privatemem': 26140672.0, 'nonpaged': 25768.0, 'virtualmem': 564969472.0, 'time': 13.35693125}}
-{'var': [('concurrency', 28), ('args', '-test ums-gated')], 'result': {'workingset': 16650240.0, 'privatemem': 26861568.0, 'nonpaged': 34832.0, 'virtualmem': 719831040.0, 'time': 9.7327859375}}
-{'var': [('concurrency', 28), ('args', '-test ums-gated')], 'result': {'workingset': 16547840.0, 'privatemem': 26378240.0, 'nonpaged': 34352.0, 'virtualmem': 711442432.0, 'time': 9.775103125}}
-{'var': [('concurrency', 28), ('args', '-test ums-gated')], 'result': {'workingset': 16654336.0, 'privatemem': 26513408.0, 'nonpaged': 34472.0, 'virtualmem': 713539584.0, 'time': 9.8092875}}
-{'var': [('concurrency', 28), ('args', '-test ums-gated')], 'result': {'workingset': 16445440.0, 'privatemem': 26304512.0, 'nonpaged': 34352.0, 'virtualmem': 711442432.0, 'time': 9.834784375}}
-{'var': [('concurrency', 28), ('args', '-test ums-gated')], 'result': {'workingset': 16510976.0, 'privatemem': 26243072.0, 'nonpaged': 34112.0, 'virtualmem': 707248128.0, 'time': 9.9615171875}}
-{'var': [('concurrency', 32), ('args', '-test async-gated')], 'result': {'workingset': 22589440.0, 'privatemem': 26005504.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.234246875}}
-{'var': [('concurrency', 32), ('args', '-test async-gated')], 'result': {'workingset': 22814720.0, 'privatemem': 26140672.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.1942140625}}
-{'var': [('concurrency', 32), ('args', '-test async-gated')], 'result': {'workingset': 22704128.0, 'privatemem': 26079232.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.3161734375}}
-{'var': [('concurrency', 32), ('args', '-test async-gated')], 'result': {'workingset': 22708224.0, 'privatemem': 26030080.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.2072671875}}
-{'var': [('concurrency', 32), ('args', '-test async-gated')], 'result': {'workingset': 22691840.0, 'privatemem': 26120192.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.2228828125}}
-{'var': [('concurrency', 32), ('args', '-test ums-gated')], 'result': {'workingset': 16568320.0, 'privatemem': 27033600.0, 'nonpaged': 35312.0, 'virtualmem': 728219648.0, 'time': 9.8727921875}}
-{'var': [('concurrency', 32), ('args', '-test ums-gated')], 'result': {'workingset': 16764928.0, 'privatemem': 27238400.0, 'nonpaged': 35312.0, 'virtualmem': 728219648.0, 'time': 9.8168890625}}
-{'var': [('concurrency', 32), ('args', '-test ums-gated')], 'result': {'workingset': 16842752.0, 'privatemem': 27193344.0, 'nonpaged': 35192.0, 'virtualmem': 726122496.0, 'time': 9.8725515625}}
-{'var': [('concurrency', 32), ('args', '-test ums-gated')], 'result': {'workingset': 16732160.0, 'privatemem': 27230208.0, 'nonpaged': 35312.0, 'virtualmem': 728219648.0, 'time': 9.8796578125}}
-{'var': [('concurrency', 32), ('args', '-test ums-gated')], 'result': {'workingset': 16576512.0, 'privatemem': 26882048.0, 'nonpaged': 35072.0, 'virtualmem': 724025344.0, 'time': 9.851103125}}
-{'var': [('concurrency', 40), ('args', '-test async-gated')], 'result': {'workingset': 22679552.0, 'privatemem': 25993216.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.183775}}
-{'var': [('concurrency', 40), ('args', '-test async-gated')], 'result': {'workingset': 22642688.0, 'privatemem': 26030080.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.1523140625}}
-{'var': [('concurrency', 40), ('args', '-test async-gated')], 'result': {'workingset': 22642688.0, 'privatemem': 26009600.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.2646}}
-{'var': [('concurrency', 40), ('args', '-test async-gated')], 'result': {'workingset': 22609920.0, 'privatemem': 26025984.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.190975}}
-{'var': [('concurrency', 40), ('args', '-test async-gated')], 'result': {'workingset': 22806528.0, 'privatemem': 26173440.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.290859375}}
-{'var': [('concurrency', 40), ('args', '-test ums-gated')], 'result': {'workingset': 17313792.0, 'privatemem': 29270016.0, 'nonpaged': 38312.0, 'virtualmem': 780648448.0, 'time': 9.8081125}}
-{'var': [('concurrency', 40), ('args', '-test ums-gated')], 'result': {'workingset': 17297408.0, 'privatemem': 29560832.0, 'nonpaged': 38672.0, 'virtualmem': 786939904.0, 'time': 9.803896875}}
-{'var': [('concurrency', 40), ('args', '-test ums-gated')], 'result': {'workingset': 17514496.0, 'privatemem': 29667328.0, 'nonpaged': 38552.0, 'virtualmem': 784842752.0, 'time': 10.44371875}}
-{'var': [('concurrency', 40), ('args', '-test ums-gated')], 'result': {'workingset': 17350656.0, 'privatemem': 29356032.0, 'nonpaged': 38312.0, 'virtualmem': 780648448.0, 'time': 10.5586140625}}
-{'var': [('concurrency', 40), ('args', '-test ums-gated')], 'result': {'workingset': 17219584.0, 'privatemem': 29265920.0, 'nonpaged': 38072.0, 'virtualmem': 776454144.0, 'time': 11.02230625}}
-{'var': [('concurrency', 48), ('args', '-test async-gated')], 'result': {'workingset': 29392896.0, 'privatemem': 32837632.0, 'nonpaged': 25384.0, 'virtualmem': 556580864.0, 'time': 14.5534375}}
-{'var': [('concurrency', 48), ('args', '-test async-gated')], 'result': {'workingset': 29511680.0, 'privatemem': 32817152.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 15.04296875}}
-{'var': [('concurrency', 48), ('args', '-test async-gated')], 'result': {'workingset': 29323264.0, 'privatemem': 32690176.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.5768078125}}
-{'var': [('concurrency', 48), ('args', '-test async-gated')], 'result': {'workingset': 29327360.0, 'privatemem': 32718848.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.1712328125}}
-{'var': [('concurrency', 48), ('args', '-test async-gated')], 'result': {'workingset': 22704128.0, 'privatemem': 26030080.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.193025}}
-{'var': [('concurrency', 48), ('args', '-test ums-gated')], 'result': {'workingset': 17764352.0, 'privatemem': 30863360.0, 'nonpaged': 40232.0, 'virtualmem': 814202880.0, 'time': 9.7636984375}}
-{'var': [('concurrency', 48), ('args', '-test ums-gated')], 'result': {'workingset': 17707008.0, 'privatemem': 30818304.0, 'nonpaged': 40232.0, 'virtualmem': 814202880.0, 'time': 9.7707}}
-{'var': [('concurrency', 48), ('args', '-test ums-gated')], 'result': {'workingset': 17625088.0, 'privatemem': 30760960.0, 'nonpaged': 40232.0, 'virtualmem': 814202880.0, 'time': 9.812396875}}
-{'var': [('concurrency', 48), ('args', '-test ums-gated')], 'result': {'workingset': 17649664.0, 'privatemem': 30711808.0, 'nonpaged': 40232.0, 'virtualmem': 814202880.0, 'time': 10.313584375}}
-{'var': [('concurrency', 48), ('args', '-test ums-gated')], 'result': {'workingset': 17674240.0, 'privatemem': 30810112.0, 'nonpaged': 40232.0, 'virtualmem': 814202880.0, 'time': 9.8304125}}
-{'var': [('concurrency', 56), ('args', '-test async-gated')], 'result': {'workingset': 29548544.0, 'privatemem': 32927744.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.1279546875}}
-{'var': [('concurrency', 56), ('args', '-test async-gated')], 'result': {'workingset': 29532160.0, 'privatemem': 32894976.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.1256796875}}
-{'var': [('concurrency', 56), ('args', '-test async-gated')], 'result': {'workingset': 29585408.0, 'privatemem': 32956416.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.14424375}}
-{'var': [('concurrency', 56), ('args', '-test async-gated')], 'result': {'workingset': 29421568.0, 'privatemem': 32800768.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.1787703125}}
-{'var': [('concurrency', 56), ('args', '-test async-gated')], 'result': {'workingset': 29347840.0, 'privatemem': 32718848.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.121146875}}
-{'var': [('concurrency', 56), ('args', '-test ums-gated')], 'result': {'workingset': 17829888.0, 'privatemem': 32083968.0, 'nonpaged': 42152.0, 'virtualmem': 847757312.0, 'time': 9.7840515625}}
-{'var': [('concurrency', 56), ('args', '-test ums-gated')], 'result': {'workingset': 17981440.0, 'privatemem': 32190464.0, 'nonpaged': 42152.0, 'virtualmem': 847757312.0, 'time': 9.774884375}}
-{'var': [('concurrency', 56), ('args', '-test ums-gated')], 'result': {'workingset': 17907712.0, 'privatemem': 32178176.0, 'nonpaged': 42152.0, 'virtualmem': 847757312.0, 'time': 9.7712421875}}
-{'var': [('concurrency', 56), ('args', '-test ums-gated')], 'result': {'workingset': 17809408.0, 'privatemem': 32092160.0, 'nonpaged': 42152.0, 'virtualmem': 847757312.0, 'time': 9.883371875}}
-{'var': [('concurrency', 56), ('args', '-test ums-gated')], 'result': {'workingset': 18104320.0, 'privatemem': 32366592.0, 'nonpaged': 42152.0, 'virtualmem': 847757312.0, 'time': 9.8319875}}
-{'var': [('concurrency', 64), ('args', '-test async-gated')], 'result': {'workingset': 29380608.0, 'privatemem': 32731136.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.139365625}}
-{'var': [('concurrency', 64), ('args', '-test async-gated')], 'result': {'workingset': 29401088.0, 'privatemem': 32792576.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.1221734375}}
-{'var': [('concurrency', 64), ('args', '-test async-gated')], 'result': {'workingset': 29298688.0, 'privatemem': 32735232.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.3343921875}}
-{'var': [('concurrency', 64), ('args', '-test async-gated')], 'result': {'workingset': 29564928.0, 'privatemem': 32948224.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.144190625}}
-{'var': [('concurrency', 64), ('args', '-test async-gated')], 'result': {'workingset': 29511680.0, 'privatemem': 32894976.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.147003125}}
-{'var': [('concurrency', 64), ('args', '-test ums-gated')], 'result': {'workingset': 18358272.0, 'privatemem': 34308096.0, 'nonpaged': 45032.0, 'virtualmem': 898088960.0, 'time': 9.80116875}}
-{'var': [('concurrency', 64), ('args', '-test ums-gated')], 'result': {'workingset': 18325504.0, 'privatemem': 33714176.0, 'nonpaged': 44072.0, 'virtualmem': 881311744.0, 'time': 9.898659375}}
-{'var': [('concurrency', 64), ('args', '-test ums-gated')], 'result': {'workingset': 18300928.0, 'privatemem': 33689600.0, 'nonpaged': 44072.0, 'virtualmem': 881311744.0, 'time': 9.7784}}
-{'var': [('concurrency', 64), ('args', '-test ums-gated')], 'result': {'workingset': 18210816.0, 'privatemem': 33574912.0, 'nonpaged': 44072.0, 'virtualmem': 881311744.0, 'time': 9.9189640625}}
-{'var': [('concurrency', 64), ('args', '-test ums-gated')], 'result': {'workingset': 18202624.0, 'privatemem': 33566720.0, 'nonpaged': 44072.0, 'virtualmem': 881311744.0, 'time': 9.7934265625}}
-{'var': [('concurrency', 80), ('args', '-test async-gated')], 'result': {'workingset': 29495296.0, 'privatemem': 32886784.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.111571875}}
-{'var': [('concurrency', 80), ('args', '-test async-gated')], 'result': {'workingset': 29429760.0, 'privatemem': 32776192.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.199890625}}
-{'var': [('concurrency', 80), ('args', '-test async-gated')], 'result': {'workingset': 29442048.0, 'privatemem': 32886784.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.11831875}}
-{'var': [('concurrency', 80), ('args', '-test async-gated')], 'result': {'workingset': 29597696.0, 'privatemem': 32931840.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.1347890625}}
-{'var': [('concurrency', 80), ('args', '-test async-gated')], 'result': {'workingset': 29417472.0, 'privatemem': 32739328.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.171440625}}
-{'var': [('concurrency', 80), ('args', '-test ums-gated')], 'result': {'workingset': 19292160.0, 'privatemem': 38002688.0, 'nonpaged': 49832.0, 'virtualmem': 981975040.0, 'time': 9.7851578125}}
-{'var': [('concurrency', 80), ('args', '-test ums-gated')], 'result': {'workingset': 19222528.0, 'privatemem': 37990400.0, 'nonpaged': 49832.0, 'virtualmem': 981975040.0, 'time': 9.759603125}}
-{'var': [('concurrency', 80), ('args', '-test ums-gated')], 'result': {'workingset': 19308544.0, 'privatemem': 38092800.0, 'nonpaged': 49928.0, 'virtualmem': 981975040.0, 'time': 9.73698125}}
-{'var': [('concurrency', 80), ('args', '-test ums-gated')], 'result': {'workingset': 19214336.0, 'privatemem': 38002688.0, 'nonpaged': 49832.0, 'virtualmem': 981975040.0, 'time': 9.7582359375}}
-{'var': [('concurrency', 80), ('args', '-test ums-gated')], 'result': {'workingset': 19324928.0, 'privatemem': 38129664.0, 'nonpaged': 49832.0, 'virtualmem': 981975040.0, 'time': 9.7412640625}}
-{'var': [('concurrency', 96), ('args', '-test async-gated')], 'result': {'workingset': 29474816.0, 'privatemem': 32837632.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.169203125}}
-{'var': [('concurrency', 96), ('args', '-test async-gated')], 'result': {'workingset': 29614080.0, 'privatemem': 32976896.0, 'nonpaged': 25384.0, 'virtualmem': 556580864.0, 'time': 13.1191375}}
-{'var': [('concurrency', 96), ('args', '-test async-gated')], 'result': {'workingset': 29626368.0, 'privatemem': 32968704.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.1113484375}}
-{'var': [('concurrency', 96), ('args', '-test async-gated')], 'result': {'workingset': 29511680.0, 'privatemem': 33058816.0, 'nonpaged': 25640.0, 'virtualmem': 560775168.0, 'time': 13.1464140625}}
-{'var': [('concurrency', 96), ('args', '-test async-gated')], 'result': {'workingset': 29458432.0, 'privatemem': 32747520.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.1111234375}}
-{'var': [('concurrency', 96), ('args', '-test ums-gated')], 'result': {'workingset': 20041728.0, 'privatemem': 41103360.0, 'nonpaged': 53672.0, 'virtualmem': 1049083904.0, 'time': 9.7898}}
-{'var': [('concurrency', 96), ('args', '-test ums-gated')], 'result': {'workingset': 19968000.0, 'privatemem': 41009152.0, 'nonpaged': 53672.0, 'virtualmem': 1049083904.0, 'time': 9.855309375}}
-{'var': [('concurrency', 96), ('args', '-test ums-gated')], 'result': {'workingset': 19824640.0, 'privatemem': 40890368.0, 'nonpaged': 53672.0, 'virtualmem': 1049083904.0, 'time': 9.9260921875}}
-{'var': [('concurrency', 96), ('args', '-test ums-gated')], 'result': {'workingset': 19947520.0, 'privatemem': 41054208.0, 'nonpaged': 53672.0, 'virtualmem': 1049083904.0, 'time': 9.9416703125}}
-{'var': [('concurrency', 96), ('args', '-test ums-gated')], 'result': {'workingset': 19808256.0, 'privatemem': 40882176.0, 'nonpaged': 53672.0, 'virtualmem': 1049083904.0, 'time': 9.8916515625}}
-{'var': [('concurrency', 112), ('args', '-test async-gated')], 'result': {'workingset': 29691904.0, 'privatemem': 33034240.0, 'nonpaged': 25640.0, 'virtualmem': 560775168.0, 'time': 15.11079375}}
-{'var': [('concurrency', 112), ('args', '-test async-gated')], 'result': {'workingset': 29458432.0, 'privatemem': 32755712.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.1449734375}}
-{'var': [('concurrency', 112), ('args', '-test async-gated')], 'result': {'workingset': 29315072.0, 'privatemem': 32628736.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.13280625}}
-{'var': [('concurrency', 112), ('args', '-test async-gated')], 'result': {'workingset': 29417472.0, 'privatemem': 32788480.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.1016015625}}
-{'var': [('concurrency', 112), ('args', '-test async-gated')], 'result': {'workingset': 29417472.0, 'privatemem': 32735232.0, 'nonpaged': 25384.0, 'virtualmem': 556580864.0, 'time': 13.1100125}}
-{'var': [('concurrency', 112), ('args', '-test ums-gated')], 'result': {'workingset': 20836352.0, 'privatemem': 44212224.0, 'nonpaged': 57512.0, 'virtualmem': 1116192768.0, 'time': 10.02668125}}
-{'var': [('concurrency', 112), ('args', '-test ums-gated')], 'result': {'workingset': 20934656.0, 'privatemem': 44322816.0, 'nonpaged': 57512.0, 'virtualmem': 1116192768.0, 'time': 9.9877078125}}
-{'var': [('concurrency', 112), ('args', '-test ums-gated')], 'result': {'workingset': 21037056.0, 'privatemem': 45981696.0, 'nonpaged': 60152.0, 'virtualmem': 1162330112.0, 'time': 9.9358015625}}
-{'var': [('concurrency', 112), ('args', '-test ums-gated')], 'result': {'workingset': 20824064.0, 'privatemem': 44150784.0, 'nonpaged': 57512.0, 'virtualmem': 1116192768.0, 'time': 9.98304375}}
-{'var': [('concurrency', 112), ('args', '-test ums-gated')], 'result': {'workingset': 20856832.0, 'privatemem': 44257280.0, 'nonpaged': 57512.0, 'virtualmem': 1116192768.0, 'time': 10.009546875}}
-{'var': [('concurrency', 128), ('args', '-test async-gated')], 'result': {'workingset': 29589504.0, 'privatemem': 33009664.0, 'nonpaged': 25640.0, 'virtualmem': 560775168.0, 'time': 13.0923984375}}
-{'var': [('concurrency', 128), ('args', '-test async-gated')], 'result': {'workingset': 29470720.0, 'privatemem': 32874496.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.163709375}}
-{'var': [('concurrency', 128), ('args', '-test async-gated')], 'result': {'workingset': 29483008.0, 'privatemem': 32849920.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.1063703125}}
-{'var': [('concurrency', 128), ('args', '-test async-gated')], 'result': {'workingset': 29450240.0, 'privatemem': 32800768.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.0826171875}}
-{'var': [('concurrency', 128), ('args', '-test async-gated')], 'result': {'workingset': 29528064.0, 'privatemem': 32833536.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.086065625}}
-{'var': [('concurrency', 128), ('args', '-test ums-gated')], 'result': {'workingset': 21835776.0, 'privatemem': 48500736.0, 'nonpaged': 63032.0, 'virtualmem': 1212661760.0, 'time': 10.0842015625}}
-{'var': [('concurrency', 128), ('args', '-test ums-gated')], 'result': {'workingset': 21663744.0, 'privatemem': 47255552.0, 'nonpaged': 61352.0, 'virtualmem': 1183301632.0, 'time': 10.0181609375}}
-{'var': [('concurrency', 128), ('args', '-test ums-gated')], 'result': {'workingset': 21577728.0, 'privatemem': 47198208.0, 'nonpaged': 61352.0, 'virtualmem': 1183301632.0, 'time': 10.846165625}}
-{'var': [('concurrency', 128), ('args', '-test ums-gated')], 'result': {'workingset': 21389312.0, 'privatemem': 46759936.0, 'nonpaged': 61112.0, 'virtualmem': 1179107328.0, 'time': 11.5423390625}}
-{'var': [('concurrency', 128), ('args', '-test ums-gated')], 'result': {'workingset': 21254144.0, 'privatemem': 46899200.0, 'nonpaged': 61352.0, 'virtualmem': 1183301632.0, 'time': 11.306240625}}
-{'var': [('concurrency', 160), ('args', '-test async-gated')], 'result': {'workingset': 29491200.0, 'privatemem': 32927744.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.85168125}}
-{'var': [('concurrency', 160), ('args', '-test async-gated')], 'result': {'workingset': 29646848.0, 'privatemem': 33005568.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 14.58709375}}
-{'var': [('concurrency', 160), ('args', '-test async-gated')], 'result': {'workingset': 29536256.0, 'privatemem': 32862208.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.5917140625}}
-{'var': [('concurrency', 160), ('args', '-test async-gated')], 'result': {'workingset': 29532160.0, 'privatemem': 32821248.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.1530390625}}
-{'var': [('concurrency', 160), ('args', '-test async-gated')], 'result': {'workingset': 29405184.0, 'privatemem': 32788480.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.08974375}}
-{'var': [('concurrency', 160), ('args', '-test ums-gated')], 'result': {'workingset': 23420928.0, 'privatemem': 55808000.0, 'nonpaged': 72872.0, 'virtualmem': 1384628224.0, 'time': 10.2232734375}}
-{'var': [('concurrency', 160), ('args', '-test ums-gated')], 'result': {'workingset': 23494656.0, 'privatemem': 55554048.0, 'nonpaged': 72392.0, 'virtualmem': 1376239616.0, 'time': 10.3183484375}}
-{'var': [('concurrency', 160), ('args', '-test ums-gated')], 'result': {'workingset': 23584768.0, 'privatemem': 55844864.0, 'nonpaged': 72872.0, 'virtualmem': 1384628224.0, 'time': 10.3544203125}}
-{'var': [('concurrency', 160), ('args', '-test ums-gated')], 'result': {'workingset': 23617536.0, 'privatemem': 55844864.0, 'nonpaged': 72872.0, 'virtualmem': 1384628224.0, 'time': 10.2523703125}}
-{'var': [('concurrency', 160), ('args', '-test ums-gated')], 'result': {'workingset': 23609344.0, 'privatemem': 55885824.0, 'nonpaged': 72872.0, 'virtualmem': 1384628224.0, 'time': 10.154103125}}
-{'var': [('concurrency', 192), ('args', '-test async-gated')], 'result': {'workingset': 29544448.0, 'privatemem': 32878592.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.0866078125}}
-{'var': [('concurrency', 192), ('args', '-test async-gated')], 'result': {'workingset': 29507584.0, 'privatemem': 32878592.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.0993953125}}
-{'var': [('concurrency', 192), ('args', '-test async-gated')], 'result': {'workingset': 29483008.0, 'privatemem': 32841728.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.10189375}}
-{'var': [('concurrency', 192), ('args', '-test async-gated')], 'result': {'workingset': 29470720.0, 'privatemem': 32874496.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.0977}}
-{'var': [('concurrency', 192), ('args', '-test async-gated')], 'result': {'workingset': 29581312.0, 'privatemem': 32894976.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.0975171875}}
-{'var': [('concurrency', 192), ('args', '-test ums-gated')], 'result': {'workingset': 24719360.0, 'privatemem': 61693952.0, 'nonpaged': 80792.0, 'virtualmem': 1523040256.0, 'time': 10.415759375}}
-{'var': [('concurrency', 192), ('args', '-test ums-gated')], 'result': {'workingset': 24862720.0, 'privatemem': 61919232.0, 'nonpaged': 80792.0, 'virtualmem': 1523040256.0, 'time': 10.2971765625}}
-{'var': [('concurrency', 192), ('args', '-test ums-gated')], 'result': {'workingset': 24784896.0, 'privatemem': 61628416.0, 'nonpaged': 80552.0, 'virtualmem': 1518845952.0, 'time': 10.34406875}}
-{'var': [('concurrency', 192), ('args', '-test ums-gated')], 'result': {'workingset': 24969216.0, 'privatemem': 61984768.0, 'nonpaged': 80792.0, 'virtualmem': 1523040256.0, 'time': 10.2925640625}}
-{'var': [('concurrency', 192), ('args', '-test ums-gated')], 'result': {'workingset': 24752128.0, 'privatemem': 61415424.0, 'nonpaged': 80312.0, 'virtualmem': 1514651648.0, 'time': 10.284221875}}
-{'var': [('concurrency', 224), ('args', '-test async-gated')], 'result': {'workingset': 29650944.0, 'privatemem': 33046528.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.15705625}}
-{'var': [('concurrency', 224), ('args', '-test async-gated')], 'result': {'workingset': 29700096.0, 'privatemem': 33017856.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.122590625}}
-{'var': [('concurrency', 224), ('args', '-test async-gated')], 'result': {'workingset': 29659136.0, 'privatemem': 33026048.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.08970625}}
-{'var': [('concurrency', 224), ('args', '-test async-gated')], 'result': {'workingset': 29491200.0, 'privatemem': 32915456.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.1275171875}}
-{'var': [('concurrency', 224), ('args', '-test async-gated')], 'result': {'workingset': 29532160.0, 'privatemem': 32882688.0, 'nonpaged': 25384.0, 'virtualmem': 556580864.0, 'time': 13.14285}}
-{'var': [('concurrency', 224), ('args', '-test ums-gated')], 'result': {'workingset': 26378240.0, 'privatemem': 67780608.0, 'nonpaged': 88352.0, 'virtualmem': 1657257984.0, 'time': 10.4648703125}}
-{'var': [('concurrency', 224), ('args', '-test ums-gated')], 'result': {'workingset': 26124288.0, 'privatemem': 67293184.0, 'nonpaged': 88112.0, 'virtualmem': 1653063680.0, 'time': 10.5292671875}}
-{'var': [('concurrency', 224), ('args', '-test ums-gated')], 'result': {'workingset': 26046464.0, 'privatemem': 67276800.0, 'nonpaged': 87992.0, 'virtualmem': 1648869376.0, 'time': 10.491190625}}
-{'var': [('concurrency', 224), ('args', '-test ums-gated')], 'result': {'workingset': 26034176.0, 'privatemem': 67489792.0, 'nonpaged': 88232.0, 'virtualmem': 1653063680.0, 'time': 10.5243890625}}
-{'var': [('concurrency', 224), ('args', '-test ums-gated')], 'result': {'workingset': 26234880.0, 'privatemem': 67649536.0, 'nonpaged': 88352.0, 'virtualmem': 1657257984.0, 'time': 10.5925109375}}
-{'var': [('concurrency', 256), ('args', '-test async-gated')], 'result': {'workingset': 29548544.0, 'privatemem': 32944128.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.150478125}}
-{'var': [('concurrency', 256), ('args', '-test async-gated')], 'result': {'workingset': 29741056.0, 'privatemem': 33099776.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.1190796875}}
-{'var': [('concurrency', 256), ('args', '-test async-gated')], 'result': {'workingset': 29720576.0, 'privatemem': 33005568.0, 'nonpaged': 25384.0, 'virtualmem': 556580864.0, 'time': 13.178025}}
-{'var': [('concurrency', 256), ('args', '-test async-gated')], 'result': {'workingset': 29536256.0, 'privatemem': 32948224.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.1318578125}}
-{'var': [('concurrency', 256), ('args', '-test async-gated')], 'result': {'workingset': 29933568.0, 'privatemem': 33325056.0, 'nonpaged': 26120.0, 'virtualmem': 569163776.0, 'time': 13.130896875}}
-{'var': [('concurrency', 256), ('args', '-test ums-gated')], 'result': {'workingset': 27303936.0, 'privatemem': 73404416.0, 'nonpaged': 96272.0, 'virtualmem': 1795670016.0, 'time': 10.5394765625}}
-{'var': [('concurrency', 256), ('args', '-test ums-gated')], 'result': {'workingset': 27607040.0, 'privatemem': 73625600.0, 'nonpaged': 96032.0, 'virtualmem': 1791475712.0, 'time': 10.565934375}}
-{'var': [('concurrency', 256), ('args', '-test ums-gated')], 'result': {'workingset': 27287552.0, 'privatemem': 72835072.0, 'nonpaged': 95552.0, 'virtualmem': 1783087104.0, 'time': 10.6236890625}}
-{'var': [('concurrency', 256), ('args', '-test ums-gated')], 'result': {'workingset': 27480064.0, 'privatemem': 73379840.0, 'nonpaged': 96032.0, 'virtualmem': 1791475712.0, 'time': 10.57548125}}
-{'var': [('concurrency', 256), ('args', '-test ums-gated')], 'result': {'workingset': 27201536.0, 'privatemem': 73240576.0, 'nonpaged': 96032.0, 'virtualmem': 1791475712.0, 'time': 10.68160625}}
-{'var': [('concurrency', 320), ('args', '-test async-gated')], 'result': {'workingset': 29671424.0, 'privatemem': 33038336.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.175703125}}
-{'var': [('concurrency', 320), ('args', '-test async-gated')], 'result': {'workingset': 29827072.0, 'privatemem': 33165312.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.1375234375}}
-{'var': [('concurrency', 320), ('args', '-test async-gated')], 'result': {'workingset': 29777920.0, 'privatemem': 33116160.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.121140625}}
-{'var': [('concurrency', 320), ('args', '-test async-gated')], 'result': {'workingset': 29589504.0, 'privatemem': 32870400.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.1075078125}}
-{'var': [('concurrency', 320), ('args', '-test async-gated')], 'result': {'workingset': 29704192.0, 'privatemem': 33001472.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.150696875}}
-{'var': [('concurrency', 320), ('args', '-test ums-gated')], 'result': {'workingset': 29577216.0, 'privatemem': 84500480.0, 'nonpaged': 111152.0, 'virtualmem': 2055716864.0, 'time': 10.8671703125}}
-{'var': [('concurrency', 320), ('args', '-test ums-gated')], 'result': {'workingset': 29835264.0, 'privatemem': 84918272.0, 'nonpaged': 111392.0, 'virtualmem': 2059911168.0, 'time': 10.893078125}}
-{'var': [('concurrency', 320), ('args', '-test ums-gated')], 'result': {'workingset': 29667328.0, 'privatemem': 84197376.0, 'nonpaged': 110672.0, 'virtualmem': 2047328256.0, 'time': 10.899709375}}
-{'var': [('concurrency', 320), ('args', '-test ums-gated')], 'result': {'workingset': 29663232.0, 'privatemem': 84520960.0, 'nonpaged': 111152.0, 'virtualmem': 2055716864.0, 'time': 10.9027828125}}
-{'var': [('concurrency', 320), ('args', '-test ums-gated')], 'result': {'workingset': 29720576.0, 'privatemem': 84615168.0, 'nonpaged': 111152.0, 'virtualmem': 2055716864.0, 'time': 10.904421875}}
-{'var': [('concurrency', 384), ('args', '-test async-gated')], 'result': {'workingset': 29646848.0, 'privatemem': 32960512.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.132984375}}
-{'var': [('concurrency', 384), ('args', '-test async-gated')], 'result': {'workingset': 29839360.0, 'privatemem': 33132544.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.13160625}}
-{'var': [('concurrency', 384), ('args', '-test async-gated')], 'result': {'workingset': 29978624.0, 'privatemem': 33378304.0, 'nonpaged': 25880.0, 'virtualmem': 564969472.0, 'time': 13.1281796875}}
-{'var': [('concurrency', 384), ('args', '-test async-gated')], 'result': {'workingset': 29798400.0, 'privatemem': 33095680.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.1194140625}}
-{'var': [('concurrency', 384), ('args', '-test async-gated')], 'result': {'workingset': 29880320.0, 'privatemem': 33148928.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.140121875}}
-{'var': [('concurrency', 384), ('args', '-test ums-gated')], 'result': {'workingset': 32329728.0, 'privatemem': 96473088.0, 'nonpaged': 126752.0, 'virtualmem': 2328346624.0, 'time': 11.03265625}}
-{'var': [('concurrency', 384), ('args', '-test ums-gated')], 'result': {'workingset': 32165888.0, 'privatemem': 96047104.0, 'nonpaged': 126272.0, 'virtualmem': 2319958016.0, 'time': 11.1066328125}}
-{'var': [('concurrency', 384), ('args', '-test ums-gated')], 'result': {'workingset': 32178176.0, 'privatemem': 96284672.0, 'nonpaged': 126512.0, 'virtualmem': 2324152320.0, 'time': 11.0177765625}}
-{'var': [('concurrency', 384), ('args', '-test ums-gated')], 'result': {'workingset': 32161792.0, 'privatemem': 96284672.0, 'nonpaged': 126752.0, 'virtualmem': 2328346624.0, 'time': 11.15135}}
-{'var': [('concurrency', 384), ('args', '-test ums-gated')], 'result': {'workingset': 32096256.0, 'privatemem': 96309248.0, 'nonpaged': 126752.0, 'virtualmem': 2328346624.0, 'time': 11.1041015625}}
-{'var': [('concurrency', 448), ('args', '-test async-gated')], 'result': {'workingset': 29798400.0, 'privatemem': 33148928.0, 'nonpaged': 25384.0, 'virtualmem': 556580864.0, 'time': 13.127125}}
-{'var': [('concurrency', 448), ('args', '-test async-gated')], 'result': {'workingset': 29913088.0, 'privatemem': 33284096.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.1395265625}}
-{'var': [('concurrency', 448), ('args', '-test async-gated')], 'result': {'workingset': 29921280.0, 'privatemem': 33263616.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.136646875}}
-{'var': [('concurrency', 448), ('args', '-test async-gated')], 'result': {'workingset': 29761536.0, 'privatemem': 33140736.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.1379828125}}
-{'var': [('concurrency', 448), ('args', '-test async-gated')], 'result': {'workingset': 29818880.0, 'privatemem': 33173504.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 14.7975015625}}
-{'var': [('concurrency', 448), ('args', '-test ums-gated')], 'result': {'workingset': 34549760.0, 'privatemem': 107462656.0, 'nonpaged': 141632.0, 'virtualmem': 2588393472.0, 'time': 12.9889609375}}
-{'var': [('concurrency', 448), ('args', '-test ums-gated')], 'result': {'workingset': 34643968.0, 'privatemem': 108085248.0, 'nonpaged': 142352.0, 'virtualmem': 2600976384.0, 'time': 13.0880796875}}
-{'var': [('concurrency', 448), ('args', '-test ums-gated')], 'result': {'workingset': 34697216.0, 'privatemem': 107810816.0, 'nonpaged': 141872.0, 'virtualmem': 2592587776.0, 'time': 13.2690765625}}
-{'var': [('concurrency', 448), ('args', '-test ums-gated')], 'result': {'workingset': 34508800.0, 'privatemem': 107683840.0, 'nonpaged': 141872.0, 'virtualmem': 2592587776.0, 'time': 12.4901671875}}
-{'var': [('concurrency', 448), ('args', '-test ums-gated')], 'result': {'workingset': 34443264.0, 'privatemem': 107638784.0, 'nonpaged': 141872.0, 'virtualmem': 2592587776.0, 'time': 11.23786875}}
-{'var': [('concurrency', 512), ('args', '-test async-gated')], 'result': {'workingset': 29847552.0, 'privatemem': 33222656.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.127740625}}
-{'var': [('concurrency', 512), ('args', '-test async-gated')], 'result': {'workingset': 29859840.0, 'privatemem': 33206272.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.22630625}}
-{'var': [('concurrency', 512), ('args', '-test async-gated')], 'result': {'workingset': 29896704.0, 'privatemem': 33259520.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.1849640625}}
-{'var': [('concurrency', 512), ('args', '-test async-gated')], 'result': {'workingset': 29884416.0, 'privatemem': 33206272.0, 'nonpaged': 25384.0, 'virtualmem': 556580864.0, 'time': 13.13985}}
-{'var': [('concurrency', 512), ('args', '-test async-gated')], 'result': {'workingset': 30007296.0, 'privatemem': 33333248.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.1424328125}}
-{'var': [('concurrency', 512), ('args', '-test ums-gated')], 'result': {'workingset': 37142528.0, 'privatemem': 119185408.0, 'nonpaged': 156992.0, 'virtualmem': 2856828928.0, 'time': 11.397996875}}
-{'var': [('concurrency', 512), ('args', '-test ums-gated')], 'result': {'workingset': 37056512.0, 'privatemem': 119328768.0, 'nonpaged': 157232.0, 'virtualmem': 2861023232.0, 'time': 11.38355}}
-{'var': [('concurrency', 512), ('args', '-test ums-gated')], 'result': {'workingset': 37068800.0, 'privatemem': 119164928.0, 'nonpaged': 156992.0, 'virtualmem': 2856828928.0, 'time': 11.4034015625}}
-{'var': [('concurrency', 512), ('args', '-test ums-gated')], 'result': {'workingset': 37187584.0, 'privatemem': 119382016.0, 'nonpaged': 157232.0, 'virtualmem': 2861023232.0, 'time': 11.341525}}
-{'var': [('concurrency', 512), ('args', '-test ums-gated')], 'result': {'workingset': 37076992.0, 'privatemem': 119296000.0, 'nonpaged': 157232.0, 'virtualmem': 2861023232.0, 'time': 11.373334375}}
-{'var': [('concurrency', 640), ('args', '-test async-gated')], 'result': {'workingset': 30105600.0, 'privatemem': 33378304.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.18291875}}
-{'var': [('concurrency', 640), ('args', '-test async-gated')], 'result': {'workingset': 30064640.0, 'privatemem': 33406976.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.201753125}}
-{'var': [('concurrency', 640), ('args', '-test async-gated')], 'result': {'workingset': 30154752.0, 'privatemem': 33447936.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.1939015625}}
-{'var': [('concurrency', 640), ('args', '-test async-gated')], 'result': {'workingset': 30044160.0, 'privatemem': 33349632.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.2285859375}}
-{'var': [('concurrency', 640), ('args', '-test async-gated')], 'result': {'workingset': 30068736.0, 'privatemem': 33341440.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.1834984375}}
-{'var': [('concurrency', 640), ('args', '-test ums-gated')], 'result': {'workingset': 47366144.0, 'privatemem': 141705216.0, 'nonpaged': 188192.0, 'virtualmem': 3402088448.0, 'time': 11.7742625}}
-{'var': [('concurrency', 640), ('args', '-test ums-gated')], 'result': {'workingset': 47321088.0, 'privatemem': 141434880.0, 'nonpaged': 187712.0, 'virtualmem': 3393699840.0, 'time': 11.8519890625}}
-{'var': [('concurrency', 640), ('args', '-test ums-gated')], 'result': {'workingset': 47198208.0, 'privatemem': 141729792.0, 'nonpaged': 188432.0, 'virtualmem': 3406282752.0, 'time': 11.8748625}}
-{'var': [('concurrency', 640), ('args', '-test ums-gated')], 'result': {'workingset': 47349760.0, 'privatemem': 141578240.0, 'nonpaged': 187952.0, 'virtualmem': 3397894144.0, 'time': 11.80855625}}
-{'var': [('concurrency', 640), ('args', '-test ums-gated')], 'result': {'workingset': 47333376.0, 'privatemem': 141635584.0, 'nonpaged': 188192.0, 'virtualmem': 3402088448.0, 'time': 11.8793171875}}
-{'var': [('concurrency', 768), ('args', '-test async-gated')], 'result': {'workingset': 30441472.0, 'privatemem': 33677312.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.1907140625}}
-{'var': [('concurrency', 768), ('args', '-test async-gated')], 'result': {'workingset': 30380032.0, 'privatemem': 33607680.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.224996875}}
-{'var': [('concurrency', 768), ('args', '-test async-gated')], 'result': {'workingset': 30326784.0, 'privatemem': 33628160.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.1955234375}}
-{'var': [('concurrency', 768), ('args', '-test async-gated')], 'result': {'workingset': 30355456.0, 'privatemem': 33726464.0, 'nonpaged': 26008.0, 'virtualmem': 569163776.0, 'time': 13.1947671875}}
-{'var': [('concurrency', 768), ('args', '-test async-gated')], 'result': {'workingset': 30322688.0, 'privatemem': 33738752.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.2064796875}}
-{'var': [('concurrency', 768), ('args', '-test ums-gated')], 'result': {'workingset': 52543488.0, 'privatemem': 163958784.0, 'nonpaged': 219032.0, 'virtualmem': 3947347968.0, 'time': 11.974178125}}
-{'var': [('concurrency', 768), ('args', '-test ums-gated')], 'result': {'workingset': 52502528.0, 'privatemem': 164315136.0, 'nonpaged': 219512.0, 'virtualmem': 3955736576.0, 'time': 11.9167046875}}
-{'var': [('concurrency', 768), ('args', '-test ums-gated')], 'result': {'workingset': 52707328.0, 'privatemem': 164122624.0, 'nonpaged': 219032.0, 'virtualmem': 3947347968.0, 'time': 12.118128125}}
-{'var': [('concurrency', 768), ('args', '-test ums-gated')], 'result': {'workingset': 52293632.0, 'privatemem': 163651584.0, 'nonpaged': 218792.0, 'virtualmem': 3943153664.0, 'time': 12.049109375}}
-{'var': [('concurrency', 768), ('args', '-test ums-gated')], 'result': {'workingset': 52748288.0, 'privatemem': 163999744.0, 'nonpaged': 219032.0, 'virtualmem': 3947347968.0, 'time': 12.0723515625}}
-{'var': [('concurrency', 896), ('args', '-test async-gated')], 'result': {'workingset': 30642176.0, 'privatemem': 33882112.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.1681703125}}
-{'var': [('concurrency', 896), ('args', '-test async-gated')], 'result': {'workingset': 30302208.0, 'privatemem': 33697792.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.1825015625}}
-{'var': [('concurrency', 896), ('args', '-test async-gated')], 'result': {'workingset': 30408704.0, 'privatemem': 33726464.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.2253203125}}
-{'var': [('concurrency', 896), ('args', '-test async-gated')], 'result': {'workingset': 30486528.0, 'privatemem': 33800192.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.250696875}}
-{'var': [('concurrency', 896), ('args', '-test async-gated')], 'result': {'workingset': 30560256.0, 'privatemem': 33894400.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.174471875}}
-{'var': [('concurrency', 896), ('args', '-test ums-gated')], 'result': {'workingset': 58105856.0, 'privatemem': 186347520.0, 'nonpaged': 249512.0, 'virtualmem': 4480024576.0, 'time': 12.09041875}}
-{'var': [('concurrency', 896), ('args', '-test ums-gated')], 'result': {'workingset': 57851904.0, 'privatemem': 186142720.0, 'nonpaged': 249752.0, 'virtualmem': 4484218880.0, 'time': 11.9983140625}}
-{'var': [('concurrency', 896), ('args', '-test ums-gated')], 'result': {'workingset': 57663488.0, 'privatemem': 185761792.0, 'nonpaged': 249512.0, 'virtualmem': 4480024576.0, 'time': 12.26386875}}
-{'var': [('concurrency', 896), ('args', '-test ums-gated')], 'result': {'workingset': 57929728.0, 'privatemem': 186257408.0, 'nonpaged': 249752.0, 'virtualmem': 4484218880.0, 'time': 11.9970984375}}
-{'var': [('concurrency', 896), ('args', '-test ums-gated')], 'result': {'workingset': 58085376.0, 'privatemem': 186654720.0, 'nonpaged': 249752.0, 'virtualmem': 4484218880.0, 'time': 12.0862875}}
-{'var': [('concurrency', 1024), ('args', '-test async-gated')], 'result': {'workingset': 30867456.0, 'privatemem': 34107392.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.2160328125}}
-{'var': [('concurrency', 1024), ('args', '-test async-gated')], 'result': {'workingset': 30945280.0, 'privatemem': 34258944.0, 'nonpaged': 25384.0, 'virtualmem': 556580864.0, 'time': 13.2101375}}
-{'var': [('concurrency', 1024), ('args', '-test async-gated')], 'result': {'workingset': 31059968.0, 'privatemem': 34291712.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.3171546875}}
-{'var': [('concurrency', 1024), ('args', '-test async-gated')], 'result': {'workingset': 31064064.0, 'privatemem': 34279424.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.2282890625}}
-{'var': [('concurrency', 1024), ('args', '-test async-gated')], 'result': {'workingset': 31006720.0, 'privatemem': 34263040.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.209078125}}
-{'var': [('concurrency', 1024), ('args', '-test ums-gated')], 'result': {'workingset': 63021056.0, 'privatemem': 208171008.0, 'nonpaged': 280232.0, 'virtualmem': 5016895488.0, 'time': 13.048375}}
-{'var': [('concurrency', 1024), ('args', '-test ums-gated')], 'result': {'workingset': 63369216.0, 'privatemem': 208424960.0, 'nonpaged': 280232.0, 'virtualmem': 5016895488.0, 'time': 12.2770109375}}
-{'var': [('concurrency', 1024), ('args', '-test ums-gated')], 'result': {'workingset': 63447040.0, 'privatemem': 208539648.0, 'nonpaged': 279992.0, 'virtualmem': 5012701184.0, 'time': 12.228196875}}
-{'var': [('concurrency', 1024), ('args', '-test ums-gated')], 'result': {'workingset': 63488000.0, 'privatemem': 208715776.0, 'nonpaged': 280232.0, 'virtualmem': 5016895488.0, 'time': 12.670853125}}
-{'var': [('concurrency', 1024), ('args', '-test ums-gated')], 'result': {'workingset': 63070208.0, 'privatemem': 208207872.0, 'nonpaged': 279992.0, 'virtualmem': 5012701184.0, 'time': 12.4422}}
-{'var': [('concurrency', 1280), ('args', '-test async-gated')], 'result': {'workingset': 31617024.0, 'privatemem': 34848768.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.2811921875}}
-{'var': [('concurrency', 1280), ('args', '-test async-gated')], 'result': {'workingset': 31719424.0, 'privatemem': 34897920.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.22355625}}
-{'var': [('concurrency', 1280), ('args', '-test async-gated')], 'result': {'workingset': 31494144.0, 'privatemem': 34746368.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.22349375}}
-{'var': [('concurrency', 1280), ('args', '-test async-gated')], 'result': {'workingset': 31694848.0, 'privatemem': 34947072.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.2325609375}}
-{'var': [('concurrency', 1280), ('args', '-test async-gated')], 'result': {'workingset': 31547392.0, 'privatemem': 34807808.0, 'nonpaged': 25640.0, 'virtualmem': 560775168.0, 'time': 13.767953125}}
-{'var': [('concurrency', 1280), ('args', '-test ums-gated')], 'result': {'workingset': 73158656.0, 'privatemem': 252420096.0, 'nonpaged': 341912.0, 'virtualmem': 6094831616.0, 'time': 15.0598109375}}
-{'var': [('concurrency', 1280), ('args', '-test ums-gated')], 'result': {'workingset': 65974272.0, 'privatemem': 252903424.0, 'nonpaged': 342152.0, 'virtualmem': 6099025920.0, 'time': 13.8913953125}}
-{'var': [('concurrency', 1280), ('args', '-test ums-gated')], 'result': {'workingset': 66895872.0, 'privatemem': 253501440.0, 'nonpaged': 342632.0, 'virtualmem': 6107414528.0, 'time': 13.2943546875}}
-{'var': [('concurrency', 1280), ('args', '-test ums-gated')], 'result': {'workingset': 67772416.0, 'privatemem': 252964864.0, 'nonpaged': 341912.0, 'virtualmem': 6094831616.0, 'time': 12.7788609375}}
-{'var': [('concurrency', 1280), ('args', '-test ums-gated')], 'result': {'workingset': 66498560.0, 'privatemem': 252874752.0, 'nonpaged': 341912.0, 'virtualmem': 6094831616.0, 'time': 12.8031625}}
-{'var': [('concurrency', 1536), ('args', '-test async-gated')], 'result': {'workingset': 24178688.0, 'privatemem': 27402240.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.357275}}
-{'var': [('concurrency', 1536), ('args', '-test async-gated')], 'result': {'workingset': 23916544.0, 'privatemem': 27070464.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.3384296875}}
-{'var': [('concurrency', 1536), ('args', '-test async-gated')], 'result': {'workingset': 24154112.0, 'privatemem': 27303936.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.3860484375}}
-{'var': [('concurrency', 1536), ('args', '-test async-gated')], 'result': {'workingset': 24080384.0, 'privatemem': 27303936.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.40868125}}
-{'var': [('concurrency', 1536), ('args', '-test async-gated')], 'result': {'workingset': 23764992.0, 'privatemem': 26914816.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.3454890625}}
-{'var': [('concurrency', 1536), ('args', '-test ums-gated')], 'result': {'workingset': 74870784.0, 'privatemem': 296960000.0, 'nonpaged': 403512.0, 'virtualmem': 7172767744.0, 'time': 13.6358265625}}
-{'var': [('concurrency', 1536), ('args', '-test ums-gated')], 'result': {'workingset': 84811776.0, 'privatemem': 298262528.0, 'nonpaged': 403832.0, 'virtualmem': 7176962048.0, 'time': 14.18599375}}
-{'var': [('concurrency', 1536), ('args', '-test ums-gated')], 'result': {'workingset': 75407360.0, 'privatemem': 296779776.0, 'nonpaged': 403592.0, 'virtualmem': 7172767744.0, 'time': 13.6721390625}}
-{'var': [('concurrency', 1536), ('args', '-test ums-gated')], 'result': {'workingset': 75026432.0, 'privatemem': 296505344.0, 'nonpaged': 403112.0, 'virtualmem': 7164379136.0, 'time': 13.3102890625}}
-{'var': [('concurrency', 1536), ('args', '-test ums-gated')], 'result': {'workingset': 74461184.0, 'privatemem': 296538112.0, 'nonpaged': 403272.0, 'virtualmem': 7168573440.0, 'time': 14.0042234375}}
-{'var': [('concurrency', 1792), ('args', '-test async-gated')], 'result': {'workingset': 24694784.0, 'privatemem': 27824128.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.3436484375}}
-{'var': [('concurrency', 1792), ('args', '-test async-gated')], 'result': {'workingset': 24739840.0, 'privatemem': 27815936.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.3563359375}}
-{'var': [('concurrency', 1792), ('args', '-test async-gated')], 'result': {'workingset': 24772608.0, 'privatemem': 27918336.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.4315375}}
-{'var': [('concurrency', 1792), ('args', '-test async-gated')], 'result': {'workingset': 24756224.0, 'privatemem': 27865088.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.345803125}}
-{'var': [('concurrency', 1792), ('args', '-test async-gated')], 'result': {'workingset': 24608768.0, 'privatemem': 27750400.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.402634375}}
-{'var': [('concurrency', 1792), ('args', '-test ums-gated')], 'result': {'workingset': 95748096.0, 'privatemem': 343252992.0, 'nonpaged': 465312.0, 'virtualmem': 8267284480.0, 'time': 14.8233890625}}
-{'var': [('concurrency', 1792), ('args', '-test ums-gated')], 'result': {'workingset': 96260096.0, 'privatemem': 343367680.0, 'nonpaged': 465072.0, 'virtualmem': 8263090176.0, 'time': 14.9048890625}}
-{'var': [('concurrency', 1792), ('args', '-test ums-gated')], 'result': {'workingset': 95764480.0, 'privatemem': 342867968.0, 'nonpaged': 465072.0, 'virtualmem': 8263090176.0, 'time': 14.65851875}}
-{'var': [('concurrency', 1792), ('args', '-test ums-gated')], 'result': {'workingset': 95637504.0, 'privatemem': 342515712.0, 'nonpaged': 464832.0, 'virtualmem': 8258895872.0, 'time': 14.7174265625}}
-{'var': [('concurrency', 1792), ('args', '-test ums-gated')], 'result': {'workingset': 95924224.0, 'privatemem': 342884352.0, 'nonpaged': 464832.0, 'virtualmem': 8258895872.0, 'time': 14.8882921875}}
-{'var': [('concurrency', 2048), ('args', '-test async-gated')], 'result': {'workingset': 25047040.0, 'privatemem': 28094464.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.3807953125}}
-{'var': [('concurrency', 2048), ('args', '-test async-gated')], 'result': {'workingset': 24981504.0, 'privatemem': 28151808.0, 'nonpaged': 25640.0, 'virtualmem': 560775168.0, 'time': 13.398909375}}
-{'var': [('concurrency', 2048), ('args', '-test async-gated')], 'result': {'workingset': 25075712.0, 'privatemem': 28147712.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.359221875}}
-{'var': [('concurrency', 2048), ('args', '-test async-gated')], 'result': {'workingset': 25006080.0, 'privatemem': 28098560.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.3784}}
-{'var': [('concurrency', 2048), ('args', '-test async-gated')], 'result': {'workingset': 24997888.0, 'privatemem': 28069888.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.3560390625}}
-{'var': [('concurrency', 2048), ('args', '-test ums-gated')], 'result': {'workingset': 105529344.0, 'privatemem': 386404352.0, 'nonpaged': 526512.0, 'virtualmem': 9336832000.0, 'time': 15.17243125}}
-{'var': [('concurrency', 2048), ('args', '-test ums-gated')], 'result': {'workingset': 106209280.0, 'privatemem': 387317760.0, 'nonpaged': 526992.0, 'virtualmem': 9345220608.0, 'time': 15.41375625}}
-{'var': [('concurrency', 2048), ('args', '-test ums-gated')], 'result': {'workingset': 107094016.0, 'privatemem': 388059136.0, 'nonpaged': 526752.0, 'virtualmem': 9341026304.0, 'time': 15.4270546875}}
-{'var': [('concurrency', 2048), ('args', '-test ums-gated')], 'result': {'workingset': 106483712.0, 'privatemem': 387428352.0, 'nonpaged': 526272.0, 'virtualmem': 9332637696.0, 'time': 15.0365046875}}
-{'var': [('concurrency', 2048), ('args', '-test ums-gated')], 'result': {'workingset': 106057728.0, 'privatemem': 386617344.0, 'nonpaged': 526272.0, 'virtualmem': 9332637696.0, 'time': 15.11465}}
-{'var': [('concurrency', 2560), ('args', '-test async-gated')], 'result': {'workingset': 25714688.0, 'privatemem': 28733440.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.4772109375}}
-{'var': [('concurrency', 2560), ('args', '-test async-gated')], 'result': {'workingset': 29986816.0, 'privatemem': 33038336.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.39680625}}
-{'var': [('concurrency', 2560), ('args', '-test async-gated')], 'result': {'workingset': 30007296.0, 'privatemem': 33005568.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.43141875}}
-{'var': [('concurrency', 2560), ('args', '-test async-gated')], 'result': {'workingset': 25714688.0, 'privatemem': 28782592.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.4375484375}}
-{'var': [('concurrency', 2560), ('args', '-test async-gated')], 'result': {'workingset': 29941760.0, 'privatemem': 33050624.0, 'nonpaged': 25528.0, 'virtualmem': 560775168.0, 'time': 13.40918125}}
-{'var': [('concurrency', 2560), ('args', '-test ums-gated')], 'result': {'workingset': 124895232.0, 'privatemem': 473268224.0, 'nonpaged': 649152.0, 'virtualmem': 11480121344.0, 'time': 15.8352921875}}
-{'var': [('concurrency', 2560), ('args', '-test ums-gated')], 'result': {'workingset': 125243392.0, 'privatemem': 474202112.0, 'nonpaged': 649152.0, 'virtualmem': 11480121344.0, 'time': 15.9860609375}}
-{'var': [('concurrency', 2560), ('args', '-test ums-gated')], 'result': {'workingset': 126054400.0, 'privatemem': 474787840.0, 'nonpaged': 648912.0, 'virtualmem': 11475927040.0, 'time': 15.8798015625}}
-{'var': [('concurrency', 2560), ('args', '-test ums-gated')], 'result': {'workingset': 125100032.0, 'privatemem': 473649152.0, 'nonpaged': 648912.0, 'virtualmem': 11475927040.0, 'time': 15.90209375}}
-{'var': [('concurrency', 2560), ('args', '-test ums-gated')], 'result': {'workingset': 127406080.0, 'privatemem': 482037760.0, 'nonpaged': 658512.0, 'virtualmem': 11643699200.0, 'time': 16.0772640625}}
-{'var': [('concurrency', 3072), ('args', '-test async-gated')], 'result': {'workingset': 30760960.0, 'privatemem': 33771520.0, 'nonpaged': 25640.0, 'virtualmem': 560775168.0, 'time': 13.4638640625}}
-{'var': [('concurrency', 3072), ('args', '-test async-gated')], 'result': {'workingset': 30720000.0, 'privatemem': 33730560.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.4992015625}}
-{'var': [('concurrency', 3072), ('args', '-test async-gated')], 'result': {'workingset': 30593024.0, 'privatemem': 33632256.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.460190625}}
-{'var': [('concurrency', 3072), ('args', '-test async-gated')], 'result': {'workingset': 30691328.0, 'privatemem': 33710080.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.584534375}}
-{'var': [('concurrency', 3072), ('args', '-test async-gated')], 'result': {'workingset': 30756864.0, 'privatemem': 33738752.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 14.8325828125}}
-{'var': [('concurrency', 3072), ('args', '-test ums-gated')], 'result': {'workingset': 145821696.0, 'privatemem': 562421760.0, 'nonpaged': 772032.0, 'virtualmem': 13627604992.0, 'time': 18.0121359375}}
-{'var': [('concurrency', 3072), ('args', '-test ums-gated')], 'result': {'workingset': 145391616.0, 'privatemem': 562782208.0, 'nonpaged': 772416.0, 'virtualmem': 13635993600.0, 'time': 16.273371875}}
-{'var': [('concurrency', 3072), ('args', '-test ums-gated')], 'result': {'workingset': 145211392.0, 'privatemem': 561577984.0, 'nonpaged': 771936.0, 'virtualmem': 13627604992.0, 'time': 16.684478125}}
-{'var': [('concurrency', 3072), ('args', '-test ums-gated')], 'result': {'workingset': 145367040.0, 'privatemem': 561598464.0, 'nonpaged': 771936.0, 'virtualmem': 13627604992.0, 'time': 16.70395}}
-{'var': [('concurrency', 3072), ('args', '-test ums-gated')], 'result': {'workingset': 145969152.0, 'privatemem': 562495488.0, 'nonpaged': 771936.0, 'virtualmem': 13627604992.0, 'time': 16.7380234375}}
-{'var': [('concurrency', 3584), ('args', '-test async-gated')], 'result': {'workingset': 31399936.0, 'privatemem': 34484224.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.5152703125}}
-{'var': [('concurrency', 3584), ('args', '-test async-gated')], 'result': {'workingset': 31645696.0, 'privatemem': 34541568.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.5179421875}}
-{'var': [('concurrency', 3584), ('args', '-test async-gated')], 'result': {'workingset': 31395840.0, 'privatemem': 34435072.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.486846875}}
-{'var': [('concurrency', 3584), ('args', '-test async-gated')], 'result': {'workingset': 31571968.0, 'privatemem': 34500608.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.5053265625}}
-{'var': [('concurrency', 3584), ('args', '-test async-gated')], 'result': {'workingset': 31473664.0, 'privatemem': 34447360.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.506196875}}
-{'var': [('concurrency', 3584), ('args', '-test ums-gated')], 'result': {'workingset': 166944768.0, 'privatemem': 650125312.0, 'nonpaged': 895176.0, 'virtualmem': 15795929088.0, 'time': 17.12616875}}
-{'var': [('concurrency', 3584), ('args', '-test ums-gated')], 'result': {'workingset': 166453248.0, 'privatemem': 650084352.0, 'nonpaged': 895656.0, 'virtualmem': 15804317696.0, 'time': 17.1012453125}}
-{'var': [('concurrency', 3584), ('args', '-test ums-gated')], 'result': {'workingset': 166957056.0, 'privatemem': 650522624.0, 'nonpaged': 895416.0, 'virtualmem': 15800123392.0, 'time': 17.041084375}}
-{'var': [('concurrency', 3584), ('args', '-test ums-gated')], 'result': {'workingset': 166461440.0, 'privatemem': 651186176.0, 'nonpaged': 896136.0, 'virtualmem': 15812706304.0, 'time': 17.265559375}}
-{'var': [('concurrency', 3584), ('args', '-test ums-gated')], 'result': {'workingset': 166281216.0, 'privatemem': 650743808.0, 'nonpaged': 895416.0, 'virtualmem': 15800123392.0, 'time': 17.20788125}}
-{'var': [('concurrency', 4096), ('args', '-test async-gated')], 'result': {'workingset': 33193984.0, 'privatemem': 36044800.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.543359375}}
-{'var': [('concurrency', 4096), ('args', '-test async-gated')], 'result': {'workingset': 33120256.0, 'privatemem': 35979264.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.5913015625}}
-{'var': [('concurrency', 4096), ('args', '-test async-gated')], 'result': {'workingset': 32976896.0, 'privatemem': 35794944.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.5597421875}}
-{'var': [('concurrency', 4096), ('args', '-test async-gated')], 'result': {'workingset': 32976896.0, 'privatemem': 35885056.0, 'nonpaged': 25288.0, 'virtualmem': 556580864.0, 'time': 13.561975}}
-{'var': [('concurrency', 4096), ('args', '-test async-gated')], 'result': {'workingset': 33013760.0, 'privatemem': 35872768.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.552240625}}
-{'var': [('concurrency', 4096), ('args', '-test ums-gated')], 'result': {'workingset': 188612608.0, 'privatemem': 740990976.0, 'nonpaged': 1019232.0, 'virtualmem': 17964384256.0, 'time': 18.23205}}
-{'var': [('concurrency', 4096), ('args', '-test ums-gated')], 'result': {'workingset': 190369792.0, 'privatemem': 742092800.0, 'nonpaged': 1018176.0, 'virtualmem': 17947607040.0, 'time': 18.1267921875}}
-{'var': [('concurrency', 4096), ('args', '-test ums-gated')], 'result': {'workingset': 190291968.0, 'privatemem': 751833088.0, 'nonpaged': 1034976.0, 'virtualmem': 18241208320.0, 'time': 18.278765625}}
-{'var': [('concurrency', 4096), ('args', '-test ums-gated')], 'result': {'workingset': 187871232.0, 'privatemem': 739778560.0, 'nonpaged': 1018512.0, 'virtualmem': 17951801344.0, 'time': 18.356121875}}
-{'var': [('concurrency', 4096), ('args', '-test ums-gated')], 'result': {'workingset': 188469248.0, 'privatemem': 739135488.0, 'nonpaged': 1018512.0, 'virtualmem': 17951801344.0, 'time': 17.9174328125}}
-{'var': [('concurrency', 5120), ('args', '-test async-gated')], 'result': {'workingset': 34922496.0, 'privatemem': 37539840.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.705434375}}
-{'var': [('concurrency', 5120), ('args', '-test async-gated')], 'result': {'workingset': 34988032.0, 'privatemem': 37617664.0, 'nonpaged': 25640.0, 'virtualmem': 560775168.0, 'time': 13.677278125}}
-{'var': [('concurrency', 5120), ('args', '-test async-gated')], 'result': {'workingset': 34988032.0, 'privatemem': 37523456.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.64224375}}
-{'var': [('concurrency', 5120), ('args', '-test async-gated')], 'result': {'workingset': 35012608.0, 'privatemem': 37642240.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.65468125}}
-{'var': [('concurrency', 5120), ('args', '-test async-gated')], 'result': {'workingset': 35115008.0, 'privatemem': 37711872.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.70276875}}
-{'var': [('concurrency', 5120), ('args', '-test ums-gated')], 'result': {'workingset': 228339712.0, 'privatemem': 915566592.0, 'nonpaged': 1264176.0, 'virtualmem': 22246768640.0, 'time': 19.006409375}}
-{'var': [('concurrency', 5120), ('args', '-test ums-gated')], 'result': {'workingset': 229093376.0, 'privatemem': 916045824.0, 'nonpaged': 1264296.0, 'virtualmem': 22263349248.0, 'time': 19.33424375}}
-{'var': [('concurrency', 5120), ('args', '-test ums-gated')], 'result': {'workingset': 228802560.0, 'privatemem': 915972096.0, 'nonpaged': 1264184.0, 'virtualmem': 22263349248.0, 'time': 19.201040625}}
-{'var': [('concurrency', 5120), ('args', '-test ums-gated')], 'result': {'workingset': 228282368.0, 'privatemem': 915853312.0, 'nonpaged': 1263936.0, 'virtualmem': 22242574336.0, 'time': 19.1797125}}
-{'var': [('concurrency', 5120), ('args', '-test ums-gated')], 'result': {'workingset': 227971072.0, 'privatemem': 915865600.0, 'nonpaged': 1264896.0, 'virtualmem': 22259351552.0, 'time': 20.5840234375}}
-{'var': [('concurrency', 6144), ('args', '-test async-gated')], 'result': {'workingset': 36610048.0, 'privatemem': 39178240.0, 'nonpaged': 25640.0, 'virtualmem': 560775168.0, 'time': 15.2996234375}}
-{'var': [('concurrency', 6144), ('args', '-test async-gated')], 'result': {'workingset': 36446208.0, 'privatemem': 39006208.0, 'nonpaged': 25640.0, 'virtualmem': 560775168.0, 'time': 15.2134390625}}
-{'var': [('concurrency', 6144), ('args', '-test async-gated')], 'result': {'workingset': 36413440.0, 'privatemem': 39055360.0, 'nonpaged': 25880.0, 'virtualmem': 564969472.0, 'time': 14.35226875}}
-{'var': [('concurrency', 6144), ('args', '-test async-gated')], 'result': {'workingset': 36429824.0, 'privatemem': 39075840.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.8014796875}}
-{'var': [('concurrency', 6144), ('args', '-test async-gated')], 'result': {'workingset': 36474880.0, 'privatemem': 39116800.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.7755546875}}
-{'var': [('concurrency', 6144), ('args', '-test ums-gated')], 'result': {'workingset': 267964416.0, 'privatemem': 1090080768.0, 'nonpaged': 1509464.0, 'virtualmem': 26549927936.0, 'time': 19.5823140625}}
-{'var': [('concurrency', 6144), ('args', '-test ums-gated')], 'result': {'workingset': 268500992.0, 'privatemem': 1091354624.0, 'nonpaged': 1509816.0, 'virtualmem': 26554122240.0, 'time': 19.5744}}
-{'var': [('concurrency', 6144), ('args', '-test ums-gated')], 'result': {'workingset': 269398016.0, 'privatemem': 1090744320.0, 'nonpaged': 1509576.0, 'virtualmem': 26549927936.0, 'time': 19.7508015625}}
-{'var': [('concurrency', 6144), ('args', '-test ums-gated')], 'result': {'workingset': 269123584.0, 'privatemem': 1093181440.0, 'nonpaged': 1514664.0, 'virtualmem': 26642202624.0, 'time': 19.75071875}}
-{'var': [('concurrency', 6144), ('args', '-test ums-gated')], 'result': {'workingset': 269733888.0, 'privatemem': 1091674112.0, 'nonpaged': 1511384.0, 'virtualmem': 26583482368.0, 'time': 19.5216640625}}
-{'var': [('concurrency', 7168), ('args', '-test async-gated')], 'result': {'workingset': 36532224.0, 'privatemem': 39153664.0, 'nonpaged': 25384.0, 'virtualmem': 556580864.0, 'time': 13.9015625}}
-{'var': [('concurrency', 7168), ('args', '-test async-gated')], 'result': {'workingset': 36720640.0, 'privatemem': 39264256.0, 'nonpaged': 25864.0, 'virtualmem': 564969472.0, 'time': 13.90245}}
-{'var': [('concurrency', 7168), ('args', '-test async-gated')], 'result': {'workingset': 31596544.0, 'privatemem': 34111488.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.8932265625}}
-{'var': [('concurrency', 7168), ('args', '-test async-gated')], 'result': {'workingset': 31571968.0, 'privatemem': 34131968.0, 'nonpaged': 25880.0, 'virtualmem': 564969472.0, 'time': 13.9260484375}}
-{'var': [('concurrency', 7168), ('args', '-test async-gated')], 'result': {'workingset': 31571968.0, 'privatemem': 34066432.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 13.954315625}}
-{'var': [('concurrency', 7168), ('args', '-test ums-gated')], 'result': {'workingset': 315875328.0, 'privatemem': 1271836672.0, 'nonpaged': 1755264.0, 'virtualmem': 30861475840.0, 'time': 19.696196875}}
-{'var': [('concurrency', 7168), ('args', '-test ums-gated')], 'result': {'workingset': 312127488.0, 'privatemem': 1268944896.0, 'nonpaged': 1755944.0, 'virtualmem': 30869929984.0, 'time': 19.7884125}}
-{'var': [('concurrency', 7168), ('args', '-test ums-gated')], 'result': {'workingset': 313524224.0, 'privatemem': 1270001664.0, 'nonpaged': 1755344.0, 'virtualmem': 30861475840.0, 'time': 19.5355734375}}
-{'var': [('concurrency', 7168), ('args', '-test ums-gated')], 'result': {'workingset': 313815040.0, 'privatemem': 1271222272.0, 'nonpaged': 1756064.0, 'virtualmem': 30874058752.0, 'time': 19.61661875}}
-{'var': [('concurrency', 7168), ('args', '-test ums-gated')], 'result': {'workingset': 314990592.0, 'privatemem': 1271472128.0, 'nonpaged': 1755624.0, 'virtualmem': 30865735680.0, 'time': 20.050821875}}
-{'var': [('concurrency', 8192), ('args', '-test async-gated')], 'result': {'workingset': 38105088.0, 'privatemem': 40636416.0, 'nonpaged': 25384.0, 'virtualmem': 556580864.0, 'time': 14.0955625}}
-{'var': [('concurrency', 8192), ('args', '-test async-gated')], 'result': {'workingset': 37982208.0, 'privatemem': 40583168.0, 'nonpaged': 25640.0, 'virtualmem': 560775168.0, 'time': 14.040196875}}
-{'var': [('concurrency', 8192), ('args', '-test async-gated')], 'result': {'workingset': 38129664.0, 'privatemem': 40685568.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 14.042221875}}
-{'var': [('concurrency', 8192), ('args', '-test async-gated')], 'result': {'workingset': 38043648.0, 'privatemem': 40665088.0, 'nonpaged': 25528.0, 'virtualmem': 560775168.0, 'time': 14.1191921875}}
-{'var': [('concurrency', 8192), ('args', '-test async-gated')], 'result': {'workingset': 37933056.0, 'privatemem': 40538112.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 14.0314734375}}
-{'var': [('concurrency', 8192), ('args', '-test ums-gated')], 'result': {'workingset': 356925440.0, 'privatemem': 1448673280.0, 'nonpaged': 2001264.0, 'virtualmem': 35157557248.0, 'time': 20.15775}}
-{'var': [('concurrency', 8192), ('args', '-test ums-gated')], 'result': {'workingset': 354324480.0, 'privatemem': 1447530496.0, 'nonpaged': 2001984.0, 'virtualmem': 35170140160.0, 'time': 19.9642671875}}
-{'var': [('concurrency', 8192), ('args', '-test ums-gated')], 'result': {'workingset': 355999744.0, 'privatemem': 1446727680.0, 'nonpaged': 2001984.0, 'virtualmem': 35170140160.0, 'time': 19.937840625}}
-{'var': [('concurrency', 8192), ('args', '-test ums-gated')], 'result': {'workingset': 355708928.0, 'privatemem': 1447718912.0, 'nonpaged': 2001984.0, 'virtualmem': 35170140160.0, 'time': 21.3836453125}}
-{'var': [('concurrency', 8192), ('args', '-test ums-gated')], 'result': {'workingset': 355086336.0, 'privatemem': 1448427520.0, 'nonpaged': 2001984.0, 'virtualmem': 35170140160.0, 'time': 20.5806625}}
-{'var': [('concurrency', 10240), ('args', '-test async-gated')], 'result': {'workingset': 40574976.0, 'privatemem': 42999808.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 14.212690625}}
-{'var': [('concurrency', 10240), ('args', '-test async-gated')], 'result': {'workingset': 40849408.0, 'privatemem': 43442176.0, 'nonpaged': 25880.0, 'virtualmem': 564969472.0, 'time': 14.26136875}}
-{'var': [('concurrency', 10240), ('args', '-test async-gated')], 'result': {'workingset': 40611840.0, 'privatemem': 43065344.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 14.2927234375}}
-{'var': [('concurrency', 10240), ('args', '-test async-gated')], 'result': {'workingset': 35049472.0, 'privatemem': 37515264.0, 'nonpaged': 25768.0, 'virtualmem': 564969472.0, 'time': 14.2932515625}}
-{'var': [('concurrency', 10240), ('args', '-test async-gated')], 'result': {'workingset': 40902656.0, 'privatemem': 43450368.0, 'nonpaged': 25880.0, 'virtualmem': 564969472.0, 'time': 14.29265625}}
-{'var': [('concurrency', 10240), ('args', '-test ums-gated')], 'result': {'workingset': 437157888.0, 'privatemem': 1799569408.0, 'nonpaged': 2493704.0, 'virtualmem': 43789238272.0, 'time': 22.39598125}}
-{'var': [('concurrency', 10240), ('args', '-test ums-gated')], 'result': {'workingset': 438943744.0, 'privatemem': 1800122368.0, 'nonpaged': 2493624.0, 'virtualmem': 43789238272.0, 'time': 22.3933875}}
-{'var': [('concurrency', 10240), ('args', '-test ums-gated')], 'result': {'workingset': 454443008.0, 'privatemem': 1816186880.0, 'nonpaged': 2493264.0, 'virtualmem': 43797430272.0, 'time': 22.156965625}}
-{'var': [('concurrency', 10240), ('args', '-test ums-gated')], 'result': {'workingset': 441925632.0, 'privatemem': 1810481152.0, 'nonpaged': 2503344.0, 'virtualmem': 43973591040.0, 'time': 22.4793375}}
-{'var': [('concurrency', 10240), ('args', '-test ums-gated')], 'result': {'workingset': 437071872.0, 'privatemem': 1798299648.0, 'nonpaged': 2493624.0, 'virtualmem': 43789238272.0, 'time': 22.3045375}}
-{'var': [('concurrency', 12288), ('args', '-test async-gated')], 'result': {'workingset': 43515904.0, 'privatemem': 45961216.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 14.59280625}}
-{'var': [('concurrency', 12288), ('args', '-test async-gated')], 'result': {'workingset': 43683840.0, 'privatemem': 46112768.0, 'nonpaged': 25640.0, 'virtualmem': 560775168.0, 'time': 14.596046875}}
-{'var': [('concurrency', 12288), ('args', '-test async-gated')], 'result': {'workingset': 43720704.0, 'privatemem': 46157824.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 14.590865625}}
-{'var': [('concurrency', 12288), ('args', '-test async-gated')], 'result': {'workingset': 43683840.0, 'privatemem': 46100480.0, 'nonpaged': 25640.0, 'virtualmem': 560775168.0, 'time': 14.609971875}}
-{'var': [('concurrency', 12288), ('args', '-test async-gated')], 'result': {'workingset': 43429888.0, 'privatemem': 45940736.0, 'nonpaged': 25880.0, 'virtualmem': 564969472.0, 'time': 14.6273390625}}
-{'var': [('concurrency', 12288), ('args', '-test ums-gated')], 'result': {'workingset': 516640768.0, 'privatemem': 2149273600.0, 'nonpaged': 2984784.0, 'virtualmem': 52399816704.0, 'time': 26.321934375}}
-{'var': [('concurrency', 12288), ('args', '-test ums-gated')], 'result': {'workingset': 517148672.0, 'privatemem': 2152136704.0, 'nonpaged': 2986944.0, 'virtualmem': 52437565440.0, 'time': 26.177103125}}
-{'var': [('concurrency', 12288), ('args', '-test ums-gated')], 'result': {'workingset': 523063296.0, 'privatemem': 2156064768.0, 'nonpaged': 2985504.0, 'virtualmem': 52412399616.0, 'time': 26.05946875}}
-{'var': [('concurrency', 12288), ('args', '-test ums-gated')], 'result': {'workingset': 518561792.0, 'privatemem': 2162417664.0, 'nonpaged': 2994864.0, 'virtualmem': 52575977472.0, 'time': 28.18605}}
-{'var': [('concurrency', 12288), ('args', '-test ums-gated')], 'result': {'workingset': 525058048.0, 'privatemem': 2157924352.0, 'nonpaged': 2985264.0, 'virtualmem': 52408205312.0, 'time': 26.42195625}}
-{'var': [('concurrency', 14336), ('args', '-test async-gated')], 'result': {'workingset': 40148992.0, 'privatemem': 42582016.0, 'nonpaged': 25384.0, 'virtualmem': 556580864.0, 'time': 15.0295875}}
-{'var': [('concurrency', 14336), ('args', '-test async-gated')], 'result': {'workingset': 40206336.0, 'privatemem': 42512384.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 14.990478125}}
-{'var': [('concurrency', 14336), ('args', '-test async-gated')], 'result': {'workingset': 45486080.0, 'privatemem': 47845376.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 14.9103515625}}
-{'var': [('concurrency', 14336), ('args', '-test async-gated')], 'result': {'workingset': 44941312.0, 'privatemem': 47333376.0, 'nonpaged': 25640.0, 'virtualmem': 560775168.0, 'time': 14.9739078125}}
-{'var': [('concurrency', 14336), ('args', '-test async-gated')], 'result': {'workingset': 46559232.0, 'privatemem': 49074176.0, 'nonpaged': 25640.0, 'virtualmem': 560775168.0, 'time': 14.99918125}}
-{'var': [('concurrency', 14336), ('args', '-test ums-gated')], 'result': {'workingset': 601858048.0, 'privatemem': 2509008896.0, 'nonpaged': 3485304.0, 'virtualmem': 61158797312.0, 'time': 28.8111328125}}
-{'var': [('concurrency', 14336), ('args', '-test ums-gated')], 'result': {'workingset': 604540928.0, 'privatemem': 2506592256.0, 'nonpaged': 3477504.0, 'virtualmem': 61023174656.0, 'time': 28.554359375}}
-{'var': [('concurrency', 14336), ('args', '-test ums-gated')], 'result': {'workingset': 607997952.0, 'privatemem': 2508111872.0, 'nonpaged': 3477024.0, 'virtualmem': 61014786048.0, 'time': 29.05818125}}
-{'var': [('concurrency', 14336), ('args', '-test ums-gated')], 'result': {'workingset': 606982144.0, 'privatemem': 2510180352.0, 'nonpaged': 3477024.0, 'virtualmem': 61014786048.0, 'time': 29.6098046875}}
-{'var': [('concurrency', 14336), ('args', '-test ums-gated')], 'result': {'workingset': 603512832.0, 'privatemem': 2506928128.0, 'nonpaged': 3478584.0, 'virtualmem': 61041356800.0, 'time': 30.173225}}
-{'var': [('concurrency', 16384), ('args', '-test async-gated')], 'result': {'workingset': 42070016.0, 'privatemem': 44314624.0, 'nonpaged': 25640.0, 'virtualmem': 560775168.0, 'time': 16.2156484375}}
-{'var': [('concurrency', 16384), ('args', '-test async-gated')], 'result': {'workingset': 42672128.0, 'privatemem': 44982272.0, 'nonpaged': 25384.0, 'virtualmem': 556580864.0, 'time': 16.160125}}
-{'var': [('concurrency', 16384), ('args', '-test async-gated')], 'result': {'workingset': 42905600.0, 'privatemem': 45236224.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 15.2525890625}}
-{'var': [('concurrency', 16384), ('args', '-test async-gated')], 'result': {'workingset': 43896832.0, 'privatemem': 46153728.0, 'nonpaged': 25384.0, 'virtualmem': 556580864.0, 'time': 15.3214}}
-{'var': [('concurrency', 16384), ('args', '-test async-gated')], 'result': {'workingset': 42004480.0, 'privatemem': 44298240.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 15.23181875}}
-{'var': [('concurrency', 16384), ('args', '-test ums-gated')], 'result': {'workingset': 689721344.0, 'privatemem': 2865324032.0, 'nonpaged': 3968784.0, 'virtualmem': 69622706176.0, 'time': 31.0380265625}}
-{'var': [('concurrency', 16384), ('args', '-test ums-gated')], 'result': {'workingset': 701034496.0, 'privatemem': 2882179072.0, 'nonpaged': 3982704.0, 'virtualmem': 69865975808.0, 'time': 31.334315625}}
-{'var': [('concurrency', 16384), ('args', '-test ums-gated')], 'result': {'workingset': 685584384.0, 'privatemem': 2856980480.0, 'nonpaged': 3968664.0, 'virtualmem': 69621301248.0, 'time': 33.5692328125}}
-{'var': [('concurrency', 16384), ('args', '-test ums-gated')], 'result': {'workingset': 697085952.0, 'privatemem': 2868523008.0, 'nonpaged': 3968784.0, 'virtualmem': 69637881856.0, 'time': 30.9457953125}}
-{'var': [('concurrency', 16384), ('args', '-test ums-gated')], 'result': {'workingset': 690245632.0, 'privatemem': 2862125056.0, 'nonpaged': 3970344.0, 'virtualmem': 69650661376.0, 'time': 33.4727609375}}
-{'var': [('concurrency', 20480), ('args', '-test async-gated')], 'result': {'workingset': 55869440.0, 'privatemem': 58114048.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 15.7086890625}}
-{'var': [('concurrency', 20480), ('args', '-test async-gated')], 'result': {'workingset': 56160256.0, 'privatemem': 58540032.0, 'nonpaged': 25880.0, 'virtualmem': 564969472.0, 'time': 15.7096078125}}
-{'var': [('concurrency', 20480), ('args', '-test async-gated')], 'result': {'workingset': 49836032.0, 'privatemem': 52043776.0, 'nonpaged': 25640.0, 'virtualmem': 560775168.0, 'time': 16.2957859375}}
-{'var': [('concurrency', 20480), ('args', '-test async-gated')], 'result': {'workingset': 55492608.0, 'privatemem': 57851904.0, 'nonpaged': 25880.0, 'virtualmem': 564969472.0, 'time': 16.5145359375}}
-{'var': [('concurrency', 20480), ('args', '-test async-gated')], 'result': {'workingset': 47857664.0, 'privatemem': 50147328.0, 'nonpaged': 25880.0, 'virtualmem': 564969472.0, 'time': 16.8469078125}}
-{'var': [('concurrency', 20480), ('args', '-test ums-gated')], 'result': {'workingset': 862195712.0, 'privatemem': 3575685120.0, 'nonpaged': 4952784.0, 'virtualmem': 86889738240.0, 'time': 40.3810609375}}
-{'var': [('concurrency', 20480), ('args', '-test ums-gated')], 'result': {'workingset': 865746944.0, 'privatemem': 3578298368.0, 'nonpaged': 4952304.0, 'virtualmem': 86881349632.0, 'time': 36.3784328125}}
-{'var': [('concurrency', 20480), ('args', '-test ums-gated')], 'result': {'workingset': 869675008.0, 'privatemem': 3581808640.0, 'nonpaged': 4952544.0, 'virtualmem': 86885543936.0, 'time': 38.871209375}}
-{'var': [('concurrency', 20480), ('args', '-test ums-gated')], 'result': {'workingset': 860774400.0, 'privatemem': 3582889984.0, 'nonpaged': 4966464.0, 'virtualmem': 87128813568.0, 'time': 43.21194375}}
-{'var': [('concurrency', 20480), ('args', '-test ums-gated')], 'result': {'workingset': 855191552.0, 'privatemem': 3567927296.0, 'nonpaged': 4952904.0, 'virtualmem': 86877351936.0, 'time': 38.48225625}}
-{'var': [('concurrency', 24576), ('args', '-test async-gated')], 'result': {'workingset': 57565184.0, 'privatemem': 59461632.0, 'nonpaged': 25880.0, 'virtualmem': 564969472.0, 'time': 16.1426484375}}
-{'var': [('concurrency', 24576), ('args', '-test async-gated')], 'result': {'workingset': 54370304.0, 'privatemem': 56492032.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 16.101009375}}
-{'var': [('concurrency', 24576), ('args', '-test async-gated')], 'result': {'workingset': 62488576.0, 'privatemem': 64598016.0, 'nonpaged': 25400.0, 'virtualmem': 556580864.0, 'time': 15.84624375}}
-{'var': [('concurrency', 24576), ('args', '-test async-gated')], 'result': {'workingset': 57757696.0, 'privatemem': 59613184.0, 'nonpaged': 25640.0, 'virtualmem': 569163776.0, 'time': 15.9433421875}}
-{'var': [('concurrency', 24576), ('args', '-test async-gated')], 'result': {'workingset': 67629056.0, 'privatemem': 69304320.0, 'nonpaged': 25640.0, 'virtualmem': 560775168.0, 'time': 16.0379890625}}
-{'var': [('concurrency', 24576), ('args', '-test ums-gated')], 'result': {'workingset': 1028907008.0, 'privatemem': 4283650048.0, 'nonpaged': 5936184.0, 'virtualmem': 104104235008.0, 'time': 53.8624046875}}
-{'var': [('concurrency', 24576), ('args', '-test ums-gated')], 'result': {'workingset': 1037115392.0, 'privatemem': 4290715648.0, 'nonpaged': 5936304.0, 'virtualmem': 104120815616.0, 'time': 53.877346875}}
-{'var': [('concurrency', 24576), ('args', '-test ums-gated')], 'result': {'workingset': 1037705216.0, 'privatemem': 4291125248.0, 'nonpaged': 5935824.0, 'virtualmem': 104112427008.0, 'time': 54.8691671875}}
-{'var': [('concurrency', 24576), ('args', '-test ums-gated')], 'result': {'workingset': 1043337216.0, 'privatemem': 4301135872.0, 'nonpaged': 5935824.0, 'virtualmem': 104111026176.0, 'time': 46.317490625}}
-{'var': [('concurrency', 24576), ('args', '-test ums-gated')], 'result': {'workingset': 1028558848.0, 'privatemem': 4282368000.0, 'nonpaged': 5936424.0, 'virtualmem': 104108429312.0, 'time': 53.502359375}}
-{'var': [('concurrency', 28672), ('args', '-test async-gated')], 'result': {'workingset': 73793536.0, 'privatemem': 75640832.0, 'nonpaged': 26600.0, 'virtualmem': 577552384.0, 'time': 16.6419671875}}
-{'var': [('concurrency', 28672), ('args', '-test async-gated')], 'result': {'workingset': 74006528.0, 'privatemem': 75755520.0, 'nonpaged': 26008.0, 'virtualmem': 569163776.0, 'time': 16.59216875}}
-{'var': [('concurrency', 28672), ('args', '-test async-gated')], 'result': {'workingset': 74121216.0, 'privatemem': 75894784.0, 'nonpaged': 25640.0, 'virtualmem': 560775168.0, 'time': 16.6399796875}}
-{'var': [('concurrency', 28672), ('args', '-test async-gated')], 'result': {'workingset': 75317248.0, 'privatemem': 77017088.0, 'nonpaged': 25528.0, 'virtualmem': 560775168.0, 'time': 16.6508421875}}
-{'var': [('concurrency', 28672), ('args', '-test async-gated')], 'result': {'workingset': 73236480.0, 'privatemem': 75030528.0, 'nonpaged': 25528.0, 'virtualmem': 560775168.0, 'time': 16.776903125}}
-{'var': [('concurrency', 28672), ('args', '-test ums-gated')], 'result': {'workingset': 1193185280.0, 'privatemem': 4992319488.0, 'nonpaged': 6919104.0, 'virtualmem': 121308942336.0, 'time': 59.2310265625}}
-{'var': [('concurrency', 28672), ('args', '-test ums-gated')], 'result': {'workingset': 1186713600.0, 'privatemem': 4982370304.0, 'nonpaged': 6919584.0, 'virtualmem': 121317330944.0, 'time': 62.308228125}}
-{'var': [('concurrency', 28672), ('args', '-test ums-gated')], 'result': {'workingset': 1204101120.0, 'privatemem': 5004546048.0, 'nonpaged': 6919704.0, 'virtualmem': 121333911552.0, 'time': 59.4607328125}}
-{'var': [('concurrency', 28672), ('args', '-test ums-gated')], 'result': {'workingset': 1186025472.0, 'privatemem': 4979195904.0, 'nonpaged': 6919824.0, 'virtualmem': 121321525248.0, 'time': 68.2966625}}
-{'var': [('concurrency', 28672), ('args', '-test ums-gated')], 'result': {'workingset': 1190494208.0, 'privatemem': 4990369792.0, 'nonpaged': 6919104.0, 'virtualmem': 121308942336.0, 'time': 65.9037140625}}
-{'var': [('concurrency', 32768), ('args', '-test async-gated')], 'result': {'workingset': 69914624.0, 'privatemem': 71544832.0, 'nonpaged': 26008.0, 'virtualmem': 569163776.0, 'time': 17.5821546875}}
-{'var': [('concurrency', 32768), ('args', '-test async-gated')], 'result': {'workingset': 82804736.0, 'privatemem': 84516864.0, 'nonpaged': 25528.0, 'virtualmem': 560775168.0, 'time': 17.4147265625}}
-{'var': [('concurrency', 32768), ('args', '-test async-gated')], 'result': {'workingset': 80211968.0, 'privatemem': 81952768.0, 'nonpaged': 26120.0, 'virtualmem': 569163776.0, 'time': 17.2119453125}}
-{'var': [('concurrency', 32768), ('args', '-test async-gated')], 'result': {'workingset': 72941568.0, 'privatemem': 74739712.0, 'nonpaged': 26008.0, 'virtualmem': 569163776.0, 'time': 17.0826671875}}
-{'var': [('concurrency', 32768), ('args', '-test async-gated')], 'result': {'workingset': 57122816.0, 'privatemem': 59056128.0, 'nonpaged': 25528.0, 'virtualmem': 560775168.0, 'time': 15.8496921875}}
-{'var': [('concurrency', 32768), ('args', '-test ums-gated')], 'result': {'workingset': 1363570688.0, 'privatemem': 5696401408.0, 'nonpaged': 7902864.0, 'virtualmem': 138542813184.0, 'time': 77.319371875}}
-{'var': [('concurrency', 32768), ('args', '-test ums-gated')], 'result': {'workingset': 1359228928.0, 'privatemem': 5693067264.0, 'nonpaged': 7902504.0, 'virtualmem': 138522038272.0, 'time': 75.611196875}}
-{'var': [('concurrency', 32768), ('args', '-test ums-gated')], 'result': {'workingset': 1382010880.0, 'privatemem': 5722746880.0, 'nonpaged': 7903224.0, 'virtualmem': 138563588096.0, 'time': 75.43135625}}
-{'var': [('concurrency', 32768), ('args', '-test ums-gated')], 'result': {'workingset': 1366474752.0, 'privatemem': 5719846912.0, 'nonpaged': 7935264.0, 'virtualmem': 139092529152.0, 'time': 77.2984921875}}
-{'var': [('concurrency', 32768), ('args', '-test ums-gated')], 'result': {'workingset': 1380454400.0, 'privatemem': 5713457152.0, 'nonpaged': 7902744.0, 'virtualmem': 138555199488.0, 'time': 72.9519984375}}
-{'var': [('concurrency', 40960), ('args', '-test async-gated')], 'result': {'workingset': 82169856.0, 'privatemem': 84209664.0, 'nonpaged': 25768.0, 'virtualmem': 564969472.0, 'time': 18.2689421875}}
-{'var': [('concurrency', 40960), ('args', '-test async-gated')], 'result': {'workingset': 86765568.0, 'privatemem': 88666112.0, 'nonpaged': 25768.0, 'virtualmem': 564969472.0, 'time': 17.703690625}}
-{'var': [('concurrency', 40960), ('args', '-test async-gated')], 'result': {'workingset': 89808896.0, 'privatemem': 91951104.0, 'nonpaged': 25744.0, 'virtualmem': 562872320.0, 'time': 17.698275}}
-{'var': [('concurrency', 40960), ('args', '-test async-gated')], 'result': {'workingset': 83464192.0, 'privatemem': 84893696.0, 'nonpaged': 26008.0, 'virtualmem': 569163776.0, 'time': 17.8156953125}}
-{'var': [('concurrency', 40960), ('args', '-test async-gated')], 'result': {'workingset': 89182208.0, 'privatemem': 91365376.0, 'nonpaged': 25888.0, 'virtualmem': 567066624.0, 'time': 17.637353125}}
-{'var': [('concurrency', 40960), ('args', '-test ums-gated')], 'result': {'workingset': 1688113152.0, 'privatemem': 7102902272.0, 'nonpaged': 9870744.0, 'virtualmem': 172987879424.0, 'time': 109.5945375}}
-{'var': [('concurrency', 40960), ('args', '-test ums-gated')], 'result': {'workingset': 1681657856.0, 'privatemem': 7097241600.0, 'nonpaged': 9870264.0, 'virtualmem': 172979490816.0, 'time': 112.0583734375}}
-{'var': [('concurrency', 40960), ('args', '-test ums-gated')], 'result': {'workingset': 1701982208.0, 'privatemem': 7125585920.0, 'nonpaged': 9876984.0, 'virtualmem': 173109383168.0, 'time': 108.868828125}}
-{'var': [('concurrency', 40960), ('args', '-test ums-gated')], 'result': {'workingset': 1696256000.0, 'privatemem': 7110664192.0, 'nonpaged': 9870384.0, 'virtualmem': 172979556352.0, 'time': 100.987990625}}
-{'var': [('concurrency', 40960), ('args', '-test ums-gated')], 'result': {'workingset': 1681092608.0, 'privatemem': 7102992384.0, 'nonpaged': 9881424.0, 'virtualmem': 173160042496.0, 'time': 103.1147171875}}
-{'var': [('concurrency', 49152), ('args', '-test async-gated')], 'result': {'workingset': 88752128.0, 'privatemem': 90644480.0, 'nonpaged': 26368.0, 'virtualmem': 575455232.0, 'time': 19.194690625}}
-{'var': [('concurrency', 49152), ('args', '-test async-gated')], 'result': {'workingset': 91697152.0, 'privatemem': 93396992.0, 'nonpaged': 26240.0, 'virtualmem': 571260928.0, 'time': 19.1130046875}}
-{'var': [('concurrency', 49152), ('args', '-test async-gated')], 'result': {'workingset': 70430720.0, 'privatemem': 72364032.0, 'nonpaged': 26240.0, 'virtualmem': 571260928.0, 'time': 17.7690265625}}
-{'var': [('concurrency', 49152), ('args', '-test async-gated')], 'result': {'workingset': 85979136.0, 'privatemem': 87822336.0, 'nonpaged': 26120.0, 'virtualmem': 569163776.0, 'time': 19.166028125}}
-{'var': [('concurrency', 49152), ('args', '-test async-gated')], 'result': {'workingset': 87728128.0, 'privatemem': 89387008.0, 'nonpaged': 26000.0, 'virtualmem': 567066624.0, 'time': 19.178809375}}
-{'var': [('concurrency', 49152), ('args', '-test ums-gated')], 'result': {'workingset': 2026475520.0, 'privatemem': 8518123520.0, 'nonpaged': 11837784.0, 'virtualmem': 207459684352.0, 'time': 140.7092328125}}
-{'var': [('concurrency', 49152), ('args', '-test ums-gated')], 'result': {'workingset': 2036518912.0, 'privatemem': 8542306304.0, 'nonpaged': 11840544.0, 'virtualmem': 207512752128.0, 'time': 147.6286140625}}
-{'var': [('concurrency', 49152), ('args', '-test ums-gated')], 'result': {'workingset': 2027098112.0, 'privatemem': 8528797696.0, 'nonpaged': 11837424.0, 'virtualmem': 207455424512.0, 'time': 157.0997796875}}
-{'var': [('concurrency', 49152), ('args', '-test ums-gated')], 'result': {'workingset': 2029830144.0, 'privatemem': 8523378688.0, 'nonpaged': 11838144.0, 'virtualmem': 207470809088.0, 'time': 149.35805}}
-{'var': [('concurrency', 49152), ('args', '-test ums-gated')], 'result': {'workingset': 2018607104.0, 'privatemem': 8512258048.0, 'nonpaged': 11837544.0, 'virtualmem': 207443038208.0, 'time': 156.43776875}}
-{'var': [('concurrency', 57344), ('args', '-test async-gated')], 'result': {'workingset': 110104576.0, 'privatemem': 112001024.0, 'nonpaged': 25888.0, 'virtualmem': 567066624.0, 'time': 19.1979890625}}
-{'var': [('concurrency', 57344), ('args', '-test async-gated')], 'result': {'workingset': 117399552.0, 'privatemem': 118956032.0, 'nonpaged': 26368.0, 'virtualmem': 575455232.0, 'time': 19.72220625}}
-{'var': [('concurrency', 57344), ('args', '-test async-gated')], 'result': {'workingset': 102563840.0, 'privatemem': 104300544.0, 'nonpaged': 26000.0, 'virtualmem': 567066624.0, 'time': 19.6945328125}}
-{'var': [('concurrency', 57344), ('args', '-test async-gated')], 'result': {'workingset': 105697280.0, 'privatemem': 107380736.0, 'nonpaged': 26368.0, 'virtualmem': 575455232.0, 'time': 19.43420625}}
-{'var': [('concurrency', 57344), ('args', '-test async-gated')], 'result': {'workingset': 106532864.0, 'privatemem': 108306432.0, 'nonpaged': 26000.0, 'virtualmem': 567066624.0, 'time': 19.3152046875}}
-{'var': [('concurrency', 57344), ('args', '-test ums-gated')], 'result': {'workingset': 2363232256.0, 'privatemem': 9939460096.0, 'nonpaged': 13804464.0, 'virtualmem': 241888612352.0, 'time': 184.053434375}}
-{'var': [('concurrency', 57344), ('args', '-test ums-gated')], 'result': {'workingset': 2365878272.0, 'privatemem': 9953259520.0, 'nonpaged': 13804344.0, 'virtualmem': 241900998656.0, 'time': 192.2616015625}}
-{'var': [('concurrency', 57344), ('args', '-test ums-gated')], 'result': {'workingset': 2358566912.0, 'privatemem': 9937661952.0, 'nonpaged': 13806264.0, 'virtualmem': 241918038016.0, 'time': 189.8282234375}}
-{'var': [('concurrency', 57344), ('args', '-test ums-gated')], 'result': {'workingset': 2342895616.0, 'privatemem': 9925849088.0, 'nonpaged': 13804224.0, 'virtualmem': 241884418048.0, 'time': 182.3936078125}}
-{'var': [('concurrency', 57344), ('args', '-test ums-gated')], 'result': {'workingset': 2347986944.0, 'privatemem': 9933496320.0, 'nonpaged': 13804824.0, 'virtualmem': 241892872192.0, 'time': 186.212921875}}
-{'var': [('concurrency', 65536), ('args', '-test async-gated')], 'result': {'workingset': 130637824.0, 'privatemem': 132468736.0, 'nonpaged': 25528.0, 'virtualmem': 560775168.0, 'time': 20.00561875}}
-{'var': [('concurrency', 65536), ('args', '-test async-gated')], 'result': {'workingset': 115064832.0, 'privatemem': 116396032.0, 'nonpaged': 26008.0, 'virtualmem': 569163776.0, 'time': 20.3946609375}}
-{'var': [('concurrency', 65536), ('args', '-test async-gated')], 'result': {'workingset': 72556544.0, 'privatemem': 74584064.0, 'nonpaged': 26720.0, 'virtualmem': 579649536.0, 'time': 17.1177015625}}
-{'var': [('concurrency', 65536), ('args', '-test async-gated')], 'result': {'workingset': 112943104.0, 'privatemem': 114147328.0, 'nonpaged': 26120.0, 'virtualmem': 569163776.0, 'time': 20.2790203125}}
-{'var': [('concurrency', 65536), ('args', '-test async-gated')], 'result': {'workingset': 129822720.0, 'privatemem': 131096576.0, 'nonpaged': 26128.0, 'virtualmem': 571260928.0, 'time': 20.95596875}}
-{'var': [('concurrency', 65536), ('args', '-test ums-gated')], 'result': {'workingset': 2690383872.0, 'privatemem': 11338743808.0, 'nonpaged': 15772944.0, 'virtualmem': 276378443776.0, 'time': 247.372325}}
-{'var': [('concurrency', 65536), ('args', '-test ums-gated')], 'result': {'workingset': 2684055552.0, 'privatemem': 11335376896.0, 'nonpaged': 15771504.0, 'virtualmem': 276344889344.0, 'time': 240.684809375}}
-{'var': [('concurrency', 65536), ('args', '-test ums-gated')], 'result': {'workingset': 2701897728.0, 'privatemem': 11360075776.0, 'nonpaged': 15772344.0, 'virtualmem': 276374052864.0, 'time': 235.606675}}
-{'var': [('concurrency', 65536), ('args', '-test ums-gated')], 'result': {'workingset': 2961162240.0, 'privatemem': 11630002176.0, 'nonpaged': 15773904.0, 'virtualmem': 276618567680.0, 'time': 277.3269875}}
-{'var': [('concurrency', 65536), ('args', '-test ums-gated')], 'result': {'workingset': 2682052608.0, 'privatemem': 11340992512.0, 'nonpaged': 15776304.0, 'virtualmem': 276428775424.0, 'time': 244.7224234375}}
-{'var': [('concurrency', 81920), ('args', '-test async-gated')], 'result': {'workingset': 138235904.0, 'privatemem': 139558912.0, 'nonpaged': 25648.0, 'virtualmem': 562872320.0, 'time': 21.6494125}}
-{'var': [('concurrency', 81920), ('args', '-test async-gated')], 'result': {'workingset': 89427968.0, 'privatemem': 90931200.0, 'nonpaged': 25528.0, 'virtualmem': 560775168.0, 'time': 17.4579984375}}
-{'var': [('concurrency', 81920), ('args', '-test async-gated')], 'result': {'workingset': 130588672.0, 'privatemem': 131649536.0, 'nonpaged': 26008.0, 'virtualmem': 569163776.0, 'time': 21.278078125}}
-{'var': [('concurrency', 81920), ('args', '-test async-gated')], 'result': {'workingset': 135176192.0, 'privatemem': 136491008.0, 'nonpaged': 25640.0, 'virtualmem': 560775168.0, 'time': 21.5131796875}}
-{'var': [('concurrency', 81920), ('args', '-test async-gated')], 'result': {'workingset': 127688704.0, 'privatemem': 129499136.0, 'nonpaged': 26728.0, 'virtualmem': 581746688.0, 'time': 19.93003125}}
-{'var': [('concurrency', 81920), ('args', '-test ums-gated')], 'result': {'workingset': 3732779008.0, 'privatemem': 14553665536.0, 'nonpaged': 19709064.0, 'virtualmem': 345628565504.0, 'time': 353.601725}}
-{'var': [('concurrency', 81920), ('args', '-test ums-gated')], 'result': {'workingset': 3335438336.0, 'privatemem': 14157639680.0, 'nonpaged': 19704744.0, 'virtualmem': 345205465088.0, 'time': 356.084828125}}
-{'var': [('concurrency', 81920), ('args', '-test ums-gated')], 'result': {'workingset': 3416276992.0, 'privatemem': 14252584960.0, 'nonpaged': 19705824.0, 'virtualmem': 345296756736.0, 'time': 364.665215625}}
-{'var': [('concurrency', 81920), ('args', '-test ums-gated')], 'result': {'workingset': 3340185600.0, 'privatemem': 14166282240.0, 'nonpaged': 19705344.0, 'virtualmem': 345218048000.0, 'time': 330.89671875}}
-{'var': [('concurrency', 81920), ('args', '-test ums-gated')], 'result': {'workingset': 3341864960.0, 'privatemem': 14169149440.0, 'nonpaged': 19707504.0, 'virtualmem': 345255796736.0, 'time': 352.603725}}
-{'var': [('concurrency', 98304), ('args', '-test async-gated')], 'result': {'workingset': 119099392.0, 'privatemem': 120713216.0, 'nonpaged': 26368.0, 'virtualmem': 575455232.0, 'time': 21.3428921875}}
-{'var': [('concurrency', 98304), ('args', '-test async-gated')], 'result': {'workingset': 139829248.0, 'privatemem': 141701120.0, 'nonpaged': 27088.0, 'virtualmem': 588038144.0, 'time': 23.1737}}
-{'var': [('concurrency', 98304), ('args', '-test async-gated')], 'result': {'workingset': 151707648.0, 'privatemem': 153325568.0, 'nonpaged': 26488.0, 'virtualmem': 577552384.0, 'time': 22.1648703125}}
-{'var': [('concurrency', 98304), ('args', '-test async-gated')], 'result': {'workingset': 139603968.0, 'privatemem': 141705216.0, 'nonpaged': 26720.0, 'virtualmem': 579649536.0, 'time': 24.3582796875}}
-{'var': [('concurrency', 98304), ('args', '-test async-gated')], 'result': {'workingset': 126025728.0, 'privatemem': 128827392.0, 'nonpaged': 27568.0, 'virtualmem': 596426752.0, 'time': 21.027715625}}
-{'var': [('concurrency', 98304), ('args', '-test ums-gated')], 'result': {'workingset': 3993194496.0, 'privatemem': 16967299072.0, 'nonpaged': 23638824.0, 'virtualmem': 414117388288.0, 'time': 480.1536890625}}
-{'var': [('concurrency', 98304), ('args', '-test ums-gated')], 'result': {'workingset': 3999387648.0, 'privatemem': 16987381760.0, 'nonpaged': 23638824.0, 'virtualmem': 414117388288.0, 'time': 516.035265625}}
-{'var': [('concurrency', 98304), ('args', '-test ums-gated')], 'result': {'workingset': 4001804288.0, 'privatemem': 17038946304.0, 'nonpaged': 23718144.0, 'virtualmem': 415501574144.0, 'time': 483.755525}}
-{'var': [('concurrency', 98304), ('args', '-test ums-gated')], 'result': {'workingset': 4013903872.0, 'privatemem': 17002704896.0, 'nonpaged': 23639544.0, 'virtualmem': 414158938112.0, 'time': 503.345384375}}
-{'var': [('concurrency', 98304), ('args', '-test ums-gated')], 'result': {'workingset': 4039008256.0, 'privatemem': 17174925312.0, 'nonpaged': 23918784.0, 'virtualmem': 419020464128.0, 'time': 505.355275}}
-{'var': [('concurrency', 114688), ('args', '-test async-gated')], 'result': {'workingset': 164077568.0, 'privatemem': 165376000.0, 'nonpaged': 25648.0, 'virtualmem': 562872320.0, 'time': 23.6242703125}}
-{'var': [('concurrency', 114688), ('args', '-test async-gated')], 'result': {'workingset': 136712192.0, 'privatemem': 138002432.0, 'nonpaged': 26608.0, 'virtualmem': 579649536.0, 'time': 23.1367515625}}
-{'var': [('concurrency', 114688), ('args', '-test async-gated')], 'result': {'workingset': 118976512.0, 'privatemem': 120524800.0, 'nonpaged': 26720.0, 'virtualmem': 579649536.0, 'time': 23.2383796875}}
-{'var': [('concurrency', 114688), ('args', '-test async-gated')], 'result': {'workingset': 127246336.0, 'privatemem': 128696320.0, 'nonpaged': 26608.0, 'virtualmem': 579649536.0, 'time': 23.4868671875}}
-{'var': [('concurrency', 114688), ('args', '-test async-gated')], 'result': {'workingset': 201854976.0, 'privatemem': 202383360.0, 'nonpaged': 26128.0, 'virtualmem': 571260928.0, 'time': 26.734434375}}
-{'var': [('concurrency', 114688), ('args', '-test ums-gated')], 'result': {'workingset': 4636082176.0, 'privatemem': 19810603008.0, 'nonpaged': 27575064.0, 'virtualmem': 483073843200.0, 'time': 602.0996375}}
-{'var': [('concurrency', 114688), ('args', '-test ums-gated')], 'result': {'workingset': 4602040320.0, 'privatemem': 19810873344.0, 'nonpaged': 27579744.0, 'virtualmem': 483141148672.0, 'time': 659.99125625}}
-{'var': [('concurrency', 114688), ('args', '-test ums-gated')], 'result': {'workingset': 4591165440.0, 'privatemem': 19790200832.0, 'nonpaged': 27573024.0, 'virtualmem': 483023708160.0, 'time': 583.1214046875}}
-{'var': [('concurrency', 114688), ('args', '-test ums-gated')], 'result': {'workingset': 4639674368.0, 'privatemem': 19800694784.0, 'nonpaged': 27572544.0, 'virtualmem': 483015319552.0, 'time': 595.6076765625}}
-{'var': [('concurrency', 114688), ('args', '-test ums-gated')], 'result': {'workingset': 4615213056.0, 'privatemem': 19768594432.0, 'nonpaged': 27572304.0, 'virtualmem': 483011125248.0, 'time': 585.95591875}}
-{'var': [('concurrency', 131072), ('args', '-test async-gated')], 'result': {'workingset': 122953728.0, 'privatemem': 124391424.0, 'nonpaged': 26608.0, 'virtualmem': 579649536.0, 'time': 22.2635234375}}
-{'var': [('concurrency', 131072), ('args', '-test async-gated')], 'result': {'workingset': 128253952.0, 'privatemem': 129671168.0, 'nonpaged': 26128.0, 'virtualmem': 571260928.0, 'time': 22.54289375}}
-{'var': [('concurrency', 131072), ('args', '-test async-gated')], 'result': {'workingset': 130244608.0, 'privatemem': 131567616.0, 'nonpaged': 26248.0, 'virtualmem': 573358080.0, 'time': 21.3423078125}}
-{'var': [('concurrency', 131072), ('args', '-test async-gated')], 'result': {'workingset': 120819712.0, 'privatemem': 121860096.0, 'nonpaged': 26128.0, 'virtualmem': 571260928.0, 'time': 22.1759359375}}
-{'var': [('concurrency', 131072), ('args', '-test async-gated')], 'result': {'workingset': 197222400.0, 'privatemem': 197992448.0, 'nonpaged': 26128.0, 'virtualmem': 571260928.0, 'time': 26.0388765625}}
-{'var': [('concurrency', 131072), ('args', '-test ums-gated')], 'result': {'workingset': 5291032576.0, 'privatemem': 22605094912.0, 'nonpaged': 31506624.0, 'virtualmem': 551903141888.0, 'time': 769.2572203125}}
-{'var': [('concurrency', 131072), ('args', '-test ums-gated')], 'result': {'workingset': 5268750336.0, 'privatemem': 22580580352.0, 'nonpaged': 31506624.0, 'virtualmem': 551903141888.0, 'time': 715.4761953125}}
-{'var': [('concurrency', 131072), ('args', '-test ums-gated')], 'result': {'workingset': 5275197440.0, 'privatemem': 22597181440.0, 'nonpaged': 31506504.0, 'virtualmem': 551886561280.0, 'time': 743.6708078125}}
-{'var': [('concurrency', 131072), ('args', '-test ums-gated')], 'result': {'workingset': 5559996416.0, 'privatemem': 22927003648.0, 'nonpaged': 31508664.0, 'virtualmem': 552185012224.0, 'time': 777.7286765625}}
-{'var': [('concurrency', 131072), ('args', '-test ums-gated')], 'result': {'workingset': 5265473536.0, 'privatemem': 22609494016.0, 'nonpaged': 31506384.0, 'virtualmem': 551898947584.0, 'time': 774.769990625}}
-{'var': [('concurrency', 163840), ('args', '-test async-gated')], 'result': {'workingset': 161509376.0, 'privatemem': 163639296.0, 'nonpaged': 26720.0, 'virtualmem': 579649536.0, 'time': 29.432303125}}
-{'var': [('concurrency', 163840), ('args', '-test async-gated')], 'result': {'workingset': 152326144.0, 'privatemem': 153423872.0, 'nonpaged': 27088.0, 'virtualmem': 588038144.0, 'time': 24.661028125}}
-{'var': [('concurrency', 163840), ('args', '-test async-gated')], 'result': {'workingset': 148279296.0, 'privatemem': 150319104.0, 'nonpaged': 26368.0, 'virtualmem': 575455232.0, 'time': 25.9785390625}}
-{'var': [('concurrency', 163840), ('args', '-test async-gated')], 'result': {'workingset': 153616384.0, 'privatemem': 154677248.0, 'nonpaged': 26248.0, 'virtualmem': 573358080.0, 'time': 25.02185}}
-{'var': [('concurrency', 163840), ('args', '-test async-gated')], 'result': {'workingset': 154402816.0, 'privatemem': 155430912.0, 'nonpaged': 26360.0, 'virtualmem': 573358080.0, 'time': 25.0472640625}}
-{'var': [('concurrency', 163840), ('args', '-test ums-gated')], 'result': {'workingset': 6044577792.0, 'privatemem': 28556054528.0, 'nonpaged': 39377064.0, 'virtualmem': 690026848256.0, 'time': 238880.438532812}}
-{'var': [('concurrency', 163840), ('args', '-test ums-gated')], 'result': {'workingset': 6581481472.0, 'privatemem': 28245975040.0, 'nonpaged': 39374664.0, 'virtualmem': 689695236096.0, 'time': 1124.5557}}
-{'var': [('concurrency', 163840), ('args', '-test ums-gated')], 'result': {'workingset': 5939179520.0, 'privatemem': 28300779520.0, 'nonpaged': 39375144.0, 'virtualmem': 689703624704.0, 'time': 61740.7140578125}}
-{'var': [('concurrency', 163840), ('args', '-test ums-gated')], 'result': {'workingset': 6597120000.0, 'privatemem': 28281757696.0, 'nonpaged': 39374904.0, 'virtualmem': 689728397312.0, 'time': 1146.400846875}}
-{'var': [('concurrency', 163840), ('args', '-test ums-gated')], 'result': {'workingset': 6597758976.0, 'privatemem': 28234469376.0, 'nonpaged': 39375264.0, 'virtualmem': 689703690240.0, 'time': 1061.4835671875}}
-{'var': [('concurrency', 196608), ('args', '-test async-gated')], 'result': {'workingset': 187748352.0, 'privatemem': 191131648.0, 'nonpaged': 26840.0, 'virtualmem': 581292032.0, 'time': 28.6244015625}}
-{'var': [('concurrency', 196608), ('args', '-test async-gated')], 'result': {'workingset': 186040320.0, 'privatemem': 189222912.0, 'nonpaged': 27448.0, 'virtualmem': 593874944.0, 'time': 27.09115625}}
-{'var': [('concurrency', 196608), ('args', '-test async-gated')], 'result': {'workingset': 191225856.0, 'privatemem': 192925696.0, 'nonpaged': 27088.0, 'virtualmem': 588038144.0, 'time': 27.2597046875}}
-{'var': [('concurrency', 196608), ('args', '-test async-gated')], 'result': {'workingset': 182910976.0, 'privatemem': 184160256.0, 'nonpaged': 25760.0, 'virtualmem': 562872320.0, 'time': 26.3374671875}}
-{'var': [('concurrency', 196608), ('args', '-test async-gated')], 'result': {'workingset': 178884608.0, 'privatemem': 179732480.0, 'nonpaged': 26608.0, 'virtualmem': 579649536.0, 'time': 26.914534375}}
diff --git a/Rx/CPP/testbench/testbench.cpp b/Rx/CPP/testbench/testbench.cpp
deleted file mode 100644
index 4fd5e8c..0000000
--- a/Rx/CPP/testbench/testbench.cpp
+++ /dev/null
@@ -1,652 +0,0 @@
-// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
-
-// testbench.cpp : Defines the entry point for the console application.
-//
-
-#include "cpprx/rx.hpp"
-#include "cpplinq/linq.hpp"
-
-#include <iostream>
-#include <sstream>
-#include <fstream>
-#include <iomanip>
-#include <string>
-#include <exception>
-#include <regex>
-
-using namespace std;
-
-bool IsPrime(int x);
-
-struct Count {
- Count() : subscriptions(0), nexts(0), completions(0), errors(0), disposals(0) {}
- std::atomic<int> subscriptions;
- std::atomic<int> nexts;
- std::atomic<int> completions;
- std::atomic<int> errors;
- std::atomic<int> disposals;
-};
-template <class T>
-std::shared_ptr<rxcpp::Observable<T>> Record(
- const std::shared_ptr<rxcpp::Observable<T>>& source,
- Count* count
-)
-{
- return rxcpp::CreateObservable<T>(
- [=](std::shared_ptr<rxcpp::Observer<T>> observer) -> rxcpp::Disposable
- {
- ++count->subscriptions;
- rxcpp::ComposableDisposable cd;
- cd.Add(rxcpp::Disposable([=](){
- ++count->disposals;}));
- cd.Add(rxcpp::Subscribe(
- source,
- // on next
- [=](T element)
- {
- ++count->nexts;
- observer->OnNext(std::move(element));
- },
- // on completed
- [=]
- {
- ++count->completions;
- observer->OnCompleted();
- },
- // on error
- [=](const std::exception_ptr& error)
- {
- ++count->errors;
- observer->OnError(error);
- }));
- return cd;
- });
-}
-struct record {};
-template<class T>
-rxcpp::Binder<std::shared_ptr<rxcpp::Observable<T>>> rxcpp_chain(record&&, const std::shared_ptr<rxcpp::Observable<T>>& source, Count* count) {
- return rxcpp::from(Record(source, count));
-}
-
-vector<int> vector_range(int start, int end)
-{
- vector<int> v;
- for (int i = start; i < end; ++i)
- v.push_back(i);
- return v;
-}
-
-void IxToRx(int n) {
- Count sourcecount, takencount, observedcount;
-
- std::cout << "IxToRx: first " << n << " primes squared" << endl;
- auto values = vector_range(2, n * 10);
-
- auto primes = cpplinq::from(values)
- .where(IsPrime)
- .select([](int x) { return std::make_pair(x, x*x); });
-
- auto output = std::make_shared<rxcpp::EventLoopScheduler>();
- rxcpp::from(rxcpp::Iterate(primes))
- .template chain<record>(&sourcecount)
- .take(n)
- .template chain<record>(&takencount)
- .observe_on(output)
- .template chain<record>(&observedcount)
- .for_each(rxcpp::MakeTupleDispatch(
- [](int p, int s) {
- cout << p << " =square=> " << s << endl;
- }));
-
- cout << "location: subscriptions, nexts, completions, errors, disposals" << endl;
- cout << "sourcecount: " << sourcecount.subscriptions << ", " << sourcecount.nexts << ", " << sourcecount.completions << ", " << sourcecount.errors << ", " << sourcecount.disposals << endl;
- cout << "takencount: " << takencount.subscriptions << ", " << takencount.nexts << ", " << takencount.completions << ", " << takencount.errors << ", " << takencount.disposals << endl;
- cout << "observedcount: " << observedcount.subscriptions << ", " << observedcount.nexts << ", " << observedcount.completions << ", " << observedcount.errors << ", " << observedcount.disposals << endl;
-}
-
-void PrintPrimes(int n)
-{
- std::cout << "Rx: first " << n << " primes squared" << endl;
- auto values = rxcpp::Range(2); // infinite (until overflow) stream of integers
- rxcpp::from(values)
- .where(IsPrime)
- .materialize()
- .dematerialize()
- .select([](int x) { return std::make_pair(x, x*x); })
- .take(n)
- .for_each(rxcpp::MakeTupleDispatch(
- [](int p, int s) {
- cout << p << " =square=> " << s << endl;
- }));
-}
-
-void Scan()
-{
- int test = 0;
- auto next = [&](int i) {
- cout << "next " << test << ":" << i << endl;
- };
- auto complete = [&]() {
- cout << "completed " << test << endl;
- };
- auto error = [&](std::exception_ptr e) {
- try {
- std::rethrow_exception(e);
- }
- catch(std::exception ex) {
- cout << ex.what() << endl;
- }
- };
-
- auto input = std::make_shared<rxcpp::ImmediateScheduler>();
-
- auto add = [](int x, int y){return x + y;};
-
- // Usage
- auto obs1 = rxcpp::from(rxcpp::Empty<int>(input)).scan(add);
- auto obs2 = rxcpp::from(rxcpp::Empty<int>(input)).scan(0, add);
-
- auto obs3 = rxcpp::from(rxcpp::Range(1, 3, 1, input)).scan(add);
- auto obs4 = rxcpp::from(rxcpp::Range(1, 3, 1, input)).scan(0, add);
-
- test = 1;
- obs1.subscribe(next, complete, error);
- // => completed 1
-
- test = 2;
- obs2.subscribe(next, complete, error);
- // => next 2:0
- // => completed 2
-
- test = 3;
- obs3.subscribe(next, complete, error);
- // => next 3:1
- // => next 3:3
- // => next 3:6
- // => completed 3
-
- test = 4;
- obs4.subscribe(next, complete, error);
- // => next 4:1
- // => next 4:3
- // => next 4:6
- // => completed 4
-}
-
-void Concat(int n)
-{
- auto input1 = std::make_shared<rxcpp::EventLoopScheduler>();
- auto input2 = std::make_shared<rxcpp::EventLoopScheduler>();
- auto output = std::make_shared<rxcpp::EventLoopScheduler>();
-
- auto values1 = rxcpp::Range(100); // infinite (until overflow) stream of integers
- auto s1 = rxcpp::from(values1)
- .subscribe_on(input1)
- .where(IsPrime)
- .select([](int prime) -> std::tuple<const char *, int> {this_thread::yield(); return std::make_tuple("1:", prime);})
- .take(n/2);
-
- auto values2 = rxcpp::Range(2); // infinite (until overflow) stream of integers
- auto s2 = rxcpp::from(values2)
- .subscribe_on(input2)
- .where(IsPrime)
- .select([](int prime) -> std::tuple<const char *, int> {this_thread::yield(); return std::make_tuple("2:", prime);})
- .take(n/2);
-
- rxcpp::from(s2)
- .concat(s1)
- .take(n)
- .observe_on(output)
- .for_each(rxcpp::MakeTupleDispatch(
- [](const char* s, int p) {
- cout << s << " =concat=> " << p << endl;
- }));
-}
-
-void Combine(int n)
-{
- auto input1 = std::make_shared<rxcpp::EventLoopScheduler>();
- auto input2 = std::make_shared<rxcpp::EventLoopScheduler>();
- auto output = std::make_shared<rxcpp::EventLoopScheduler>();
-
- auto values1 = rxcpp::Range(100); // infinite (until overflow) stream of integers
- auto s1 = rxcpp::from(values1)
- .subscribe_on(input1)
- .where(IsPrime)
- .select([](int prime) -> int {this_thread::yield(); return prime;});
-
- auto values2 = rxcpp::Range(2); // infinite (until overflow) stream of integers
- rxcpp::from(values2)
- .subscribe_on(input2)
- .where(IsPrime)
- .select([](int prime) -> int {this_thread::yield(); return prime;})
- .combine_latest(s1)
- .take(n)
- .observe_on(output)
- .for_each(rxcpp::MakeTupleDispatch(
- [](int p2, int p1) {
- cout << p2 << " =combined=> " << p1 << endl;
- }));
-}
-
-
-
-template<class InputScheduler, class OutputScheduler>
-void Zip(int n)
-{
- auto input1 = std::make_shared<InputScheduler>();
- auto input2 = std::make_shared<InputScheduler>();
- auto output = std::make_shared<OutputScheduler>();
-
- Count s1count, s2count, zipcount, takecount, outputcount;
-
- auto values1 = rxcpp::Range(100); // infinite (until overflow) stream of integers
- auto s1 = rxcpp::from(values1)
- .subscribe_on(input1)
- .where(IsPrime)
- .template chain<record>(&s1count)
- .select([](int prime) -> int {this_thread::yield(); return prime;});
-
- auto values2 = rxcpp::Range(2); // infinite (until overflow) stream of integers
- rxcpp::from(values2)
- .subscribe_on(input2)
- .where(IsPrime)
- .template chain<record>(&s2count)
- .select([](int prime) -> int {this_thread::yield(); return prime;})
- .zip(s1)
- .template chain<record>(&zipcount)
- .take(n)
- .template chain<record>(&takecount)
- .observe_on(output)
- .template chain<record>(&outputcount)
- .for_each(rxcpp::MakeTupleDispatch(
- [](int p2, int p1) {
- cout << p2 << " =zipped=> " << p1 << endl;
- }));
-
- cout << "location: subscriptions, nexts, completions, errors, disposals" << endl;
- cout << "s1count: " << s1count.subscriptions << ", " << s1count.nexts << ", " << s1count.completions << ", " << s1count.errors << ", " << s1count.disposals << endl;
- cout << "s2count: " << s2count.subscriptions << ", " << s2count.nexts << ", " << s2count.completions << ", " << s2count.errors << ", " << s2count.disposals << endl;
- cout << "zipcount: " << zipcount.subscriptions << ", " << zipcount.nexts << ", " << zipcount.completions << ", " << zipcount.errors << ", " << zipcount.disposals << endl;
- cout << "takecount: " << takecount.subscriptions << ", " << takecount.nexts << ", " << takecount.completions << ", " << takecount.errors << ", " << takecount.disposals << endl;
- cout << "outputcount: " << outputcount.subscriptions << ", " << outputcount.nexts << ", " << outputcount.completions << ", " << outputcount.errors << ", " << outputcount.disposals << endl;
-}
-
-void Merge(int n)
-{
- auto input1 = std::make_shared<rxcpp::EventLoopScheduler>();
- auto input2 = std::make_shared<rxcpp::EventLoopScheduler>();
- auto output = std::make_shared<rxcpp::EventLoopScheduler>();
-
- cout << "merge==> <source>: <prime>" << endl;
-
- auto values1 = rxcpp::Range(100); // infinite (until overflow) stream of integers
- auto s1 = rxcpp::from(values1)
- .subscribe_on(input1)
- .where(IsPrime)
- .select([](int prime1) -> std::tuple<const char *, int> {this_thread::yield(); return std::make_tuple("1: ", prime1);});
-
- auto values2 = rxcpp::Range(2); // infinite (until overflow) stream of integers
- rxcpp::from(values2)
- .subscribe_on(input2)
- .where(IsPrime)
- .select([](int prime2) -> std::tuple<const char *, int> {this_thread::yield(); return std::make_tuple("2: ", prime2);})
- .merge(s1)
- .take(n)
- .observe_on(output)
- .for_each(rxcpp::MakeTupleDispatch(
- [](const char* s, int p) {
- cout << s << p << endl;
- }));
-}
-
-void RefCount(int n)
-{
- auto loop = std::make_shared<rxcpp::EventLoopScheduler>();
-
- auto values1 = rxcpp::from(rxcpp::Range(1))
- .where(IsPrime)
- .select([](int p) -> int {cout << endl << "producing: " << p << "-> "; return p;})
- .publish()
- .ref_count(); // infinite (until overflow) stream of prime integers
-
- auto v1 = rxcpp::from(values1)
- .select([](int prime1) -> std::tuple<const char *, int> {return std::make_tuple("1: ", prime1);});
-
- auto v2 = rxcpp::from(values1)
- .select([](int prime1) -> std::tuple<const char *, int> {return std::make_tuple("2: ", prime1);});
-
- cout << "Merge 2 subscriptions to published primes:";
- rxcpp::from(v1)
- .merge(v2)
- .subscribe_on(loop)
- .take(n)
- .for_each(rxcpp::MakeTupleDispatch(
- [](const char* s, int p) {
- cout << s << p << ", ";
- }));
-
- auto values2 = rxcpp::from(rxcpp::Range(100))
- .where(IsPrime)
- .select([](int p) -> int {cout << endl << "producing: " << p << "-> "; return p;})
- .publish(1000)
- .ref_count(); // infinite (until overflow) stream of prime integers
-
- cout << endl << "Subscription 1 - published primes:" << endl;
- rxcpp::from(values2)
- .subscribe_on(loop)
- .take(n/2)
- .for_each(
- [](int p) {
- cout << p << ", ";
- });
-
- cout << endl << "Subscription 2 - published primes:" << endl;
- rxcpp::from(values2)
- .subscribe_on(loop)
- .take(n/2)
- .for_each(
- [](int p) {
- cout << p << ", ";
- });
-
- auto values3 = rxcpp::from(rxcpp::Range(200))
- .where(IsPrime)
- .select([](int p) -> int {cout << endl << "producing: " << p << "-> "; return p;})
- .take(n/2)
- .publish_last()
- .ref_count(); // last of n/2 prime integers
-
- cout << endl << "Subscription 1 - last published prime:";
- rxcpp::from(values3)
- .subscribe_on(loop)
- .for_each(
- [](int p) {
- cout << p << ", ";
- });
-
- cout << endl << "Subscription 2 - last published prime:" << endl;
- rxcpp::from(values3)
- .subscribe_on(loop)
- .for_each(
- [](int p) {
- cout << p << ", ";
- });
- cout << endl;
-}
-
-
-void PrintIntervals(int n) {
- using namespace std::chrono;
- typedef steady_clock clock;
- struct Tick {
- Tick(size_t c, clock::time_point at) : cursor(c), at(at) {}
- size_t cursor;
- clock::time_point at;
- };
- auto source = std::make_shared<rxcpp::EventLoopScheduler>();
- auto subject = rxcpp::CreateSubject<Tick>();
-
- cout << n << " Intervals of .5 second: " << endl;
- rxcpp::from(subject)
- .zip(rxcpp::from(subject).skip(1))
- .select(rxcpp::MakeTupleDispatch(
- [=](Tick a, Tick b){
- return duration_cast<milliseconds>(b.at.time_since_epoch()) -
- duration_cast<milliseconds>(a.at.time_since_epoch());}))
- .to_vector()
- .subscribe(
- // on next
- [=](std::vector<milliseconds> d)
- {
- cout << endl;
- auto l = std::max_element(d.begin(), d.end());
- auto s = std::min_element(d.begin(), d.end());
- cout << "range: " << s->count() << "ms-" << l->count() << "ms" << endl;
- });
-
- rxcpp::from(rxcpp::Interval(std::chrono::milliseconds(500), source))
- .select([](size_t interval){return Tick(interval, clock::now());})
- .take(n)
- .for_each(
- // on next
- [=](Tick t)
- {
- cout << "." << flush;
- subject->OnNext(std::move(t));
- });
- subject->OnCompleted();
-}
-
-std::shared_ptr<rxcpp::Observable<string>> Data(
- string filename,
- rxcpp::Scheduler::shared scheduler = std::make_shared<rxcpp::CurrentThreadScheduler>()
-);
-string extract_value(const string& input, const string& key);
-
-void run()
-{
- using namespace cpplinq;
-
- struct item {
- string args;
- int concurrency;
- double time;
-
- item(const item& other) : args(other.args), concurrency(other.concurrency), time(other.time) {
- }
- item(item&& other) : args(std::move(other.args)), concurrency(std::move(other.concurrency)), time(std::move(other.time)) {
- }
- item(const string& input) {
- args = extract_value(input, "args");
- concurrency = atoi( extract_value(input, "concurrency").c_str() );
- time = atof( extract_value(input, "time").c_str() );
- }
- item& operator=(item other){
- using std::swap;
- swap(args, other.args);
- swap(concurrency, other.concurrency);
- swap(time, other.time);
- return *this;
- }
- };
-
- auto input = std::make_shared<rxcpp::EventLoopScheduler>();
- auto output = std::make_shared<rxcpp::EventLoopScheduler>();
-
- auto dataLines = Data("data.txt");
-
- rxcpp::from(dataLines)
- .subscribe_on(input)
- // parse input into items
- .select([](const string& line) {
- return item(line);}
- )
- // group items by args field
- .group_by([](const item& i) {
- return i.args;}
- )
- // flatten concurrencies in the same args
- .select_many(
- [](const std::shared_ptr<rxcpp::GroupedObservable<std::string, item>> & argsGroup){
- return rxcpp::from(argsGroup)
- // group items by concurrency field
- .group_by([](const item& i){
- return i.concurrency;}
- )
- // flatten times in the same concurrency
- .select_many(
- [](const std::shared_ptr<rxcpp::GroupedObservable<int, item>> & concurrencyGroup){
- return rxcpp::from(concurrencyGroup)
- .select([](const item& i){
- return i.time;})
- .to_vector();},
- [](const std::shared_ptr<rxcpp::GroupedObservable<int, item>> & concurrencyGroup,
- const std::vector<double> & times){
- return std::make_tuple(concurrencyGroup->Key(), times);}
- )
- .to_vector();},
- [](const std::shared_ptr<rxcpp::GroupedObservable<std::string, item>> & argsGroup,
- const std::vector<std::tuple<int, std::vector<double>>> & ouputGroup){
- return std::make_tuple(argsGroup->Key(), ouputGroup);}
- )
- .observe_on(output)
- .for_each(rxcpp::MakeTupleDispatch(
- [](const std::string& args, const std::vector<std::tuple<int, std::vector<double>>>& concurrencyGroup){
- cout<<"arguments: "<< args << endl;
- cout << "concurrency, mean, |, raw_data," << endl;
- for(auto& concurrencyItem : concurrencyGroup) {
- rxcpp::MakeTupleDispatch(
- [](int concurrency, const std::vector<double>& rawtimes){
- cout << concurrency << ", ";
-
- auto n = from(rawtimes).count();
- auto sum = std::accumulate(rawtimes.begin(), rawtimes.end(), 0.0);
-
- cout << (sum / n) << ", |";
-
- for (auto timeIter = rawtimes.begin(), end = rawtimes.end();
- timeIter != end;
- ++timeIter)
- {
- cout << ", " << *timeIter;
- }
- cout << endl;})(concurrencyItem);}})
- );
-}
-
-template<class Scheduler>
-void innerScheduler() {
- auto outer = std::make_shared<Scheduler>();
- rxcpp::Scheduler::shared inner;
- std::mutex lock;
- std::condition_variable wake;
- outer->Schedule([&](rxcpp::Scheduler::shared s) -> rxcpp::Disposable {
- std::lock_guard<std::mutex> guard(lock);
- inner = s; wake.notify_one();
- return rxcpp::Disposable::Empty();});
- {
- std::unique_lock<std::mutex> guard(lock);
- wake.wait(guard, [&]{return !!inner;});
- }
- inner->Schedule([&](rxcpp::Scheduler::shared s) -> rxcpp::Disposable {
- std::lock_guard<std::mutex> guard(lock);
- inner = nullptr; wake.notify_one();
- return rxcpp::Disposable::Empty();});
- {
- std::unique_lock<std::mutex> guard(lock);
- wake.wait(guard, [&]{return !inner;});
- }
- cout << "innerScheduler test succeeded" << endl;
-}
-
-int main(int argc, char* argv[])
-{
- try {
- RefCount(20);
- PrintIntervals(10);
- IxToRx(20);
- PrintPrimes(20);
- cout << "Zip Immediate" << endl;
- Zip<rxcpp::ImmediateScheduler, rxcpp::ImmediateScheduler>(20);
- cout << "Zip Current" << endl;
- Zip<rxcpp::CurrentThreadScheduler, rxcpp::CurrentThreadScheduler>(20);
- cout << "Zip EventLoop" << endl;
- Zip<rxcpp::EventLoopScheduler, rxcpp::EventLoopScheduler>(20);
- Combine(20);
- Merge(20);
- Concat(20);
-
- innerScheduler<rxcpp::ImmediateScheduler>();
- innerScheduler<rxcpp::CurrentThreadScheduler>();
- innerScheduler<rxcpp::EventLoopScheduler>();
-
- Scan();
-
- run();
- } catch (exception& e) {
- cerr << "exception: " << e.what() << endl;
- }
-}
-
-bool IsPrime(int x)
-{
- if (x < 2) return false;
- for (int i = 2; i <= x/2; ++i)
- {
- if (x % i == 0)
- return false;
- }
- return true;
-}
-
-regex key_value_pair("'([^\']*)'\\s*[:,]\\s*(\\d+(?:\\.\\d+)?|'[^']*')");
-
-string extract_value(const string& input, const string& key)
-{
- const std::sregex_iterator end;
- for (std::sregex_iterator i(input.cbegin(), input.cend(), key_value_pair);
- i != end;
- ++i)
- {
- if ((*i)[1] == key)
- {
- return (*i)[2];
- }
- }
- throw std::range_error("search key not found");
-}
-
-std::shared_ptr<rxcpp::Observable<string>> Data(
- string filename,
- rxcpp::Scheduler::shared scheduler
-)
-{
- return rxcpp::CreateObservable<string>(
- [=](std::shared_ptr<rxcpp::Observer<string>> observer)
- -> rxcpp::Disposable
- {
- struct State
- {
- State(string filename)
- : cancel(false), data(filename) {
- if (data.fail()) {
- throw logic_error("could not find file");
- }
- }
- bool cancel;
- ifstream data;
- };
- auto state = std::make_shared<State>(std::move(filename));
-
- rxcpp::ComposableDisposable cd;
-
- cd.Add(rxcpp::Disposable([=]{
- state->cancel = true;
- }));
-
- cd.Add(scheduler->Schedule(
- rxcpp::fix0([=](rxcpp::Scheduler::shared s, std::function<rxcpp::Disposable(rxcpp::Scheduler::shared)> self) -> rxcpp::Disposable
- {
- if (state->cancel)
- return rxcpp::Disposable::Empty();
-
- string line;
- if (!!getline(state->data, line))
- {
- observer->OnNext(std::move(line));
- return s->Schedule(std::move(self));
- }
- else
- {
- observer->OnCompleted();
- }
- return rxcpp::Disposable::Empty();
- })
- ));
-
- return cd;
- }
- );
-}
-
diff --git a/Rx/CPP/testbench/testbench.vcxproj b/Rx/CPP/testbench/testbench.vcxproj
deleted file mode 100644
index 3f0ae00..0000000
--- a/Rx/CPP/testbench/testbench.vcxproj
+++ /dev/null
@@ -1,93 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup Label="ProjectConfigurations">
- <ProjectConfiguration Include="Debug|Win32">
- <Configuration>Debug</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Release|Win32">
- <Configuration>Release</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- </ItemGroup>
- <PropertyGroup Label="Globals">
- <VCTargetsPath Condition="'$(VCTargetsPath11)' != '' and '$(VSVersion)' == '' and '$(VisualStudioVersion)' == ''">$(VCTargetsPath11)</VCTargetsPath>
- </PropertyGroup>
- <PropertyGroup Label="Globals">
- <ProjectGuid>{6FC6DE04-1645-457E-9728-0E8E6FCDC9EB}</ProjectGuid>
- <Keyword>Win32Proj</Keyword>
- <RootNamespace>testbench</RootNamespace>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <UseDebugLibraries>true</UseDebugLibraries>
- <PlatformToolset>v110</PlatformToolset>
- <CharacterSet>Unicode</CharacterSet>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <UseDebugLibraries>false</UseDebugLibraries>
- <PlatformToolset>v110</PlatformToolset>
- <WholeProgramOptimization>true</WholeProgramOptimization>
- <CharacterSet>Unicode</CharacterSet>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
- <ImportGroup Label="ExtensionSettings">
- </ImportGroup>
- <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <PropertyGroup Label="UserMacros" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <LinkIncremental>true</LinkIncremental>
- <IncludePath>$(VCInstallDir)include;..\..\..\Ix\CPP\src;..\src;$(WindowsSDK_IncludePath);</IncludePath>
- <OutDir>$(SolutionDir)\bin\$(Configuration)\</OutDir>
- <IntDir>obj\$(Configuration)\</IntDir>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <LinkIncremental>false</LinkIncremental>
- <IncludePath>$(VCInstallDir)include;..\..\..\Ix\CPP\src;..\src;$(WindowsSDK_IncludePath);</IncludePath>
- <OutDir>$(SolutionDir)\bin\$(Configuration)\</OutDir>
- <IntDir>obj\$(Configuration)\</IntDir>
- </PropertyGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <ClCompile>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <Optimization>Disabled</Optimization>
- <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- </ClCompile>
- <Link>
- <SubSystem>Console</SubSystem>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- </Link>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <ClCompile>
- <WarningLevel>Level3</WarningLevel>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <Optimization>MaxSpeed</Optimization>
- <FunctionLevelLinking>true</FunctionLevelLinking>
- <IntrinsicFunctions>true</IntrinsicFunctions>
- <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- </ClCompile>
- <Link>
- <SubSystem>Console</SubSystem>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <EnableCOMDATFolding>true</EnableCOMDATFolding>
- <OptimizeReferences>true</OptimizeReferences>
- </Link>
- </ItemDefinitionGroup>
- <ItemGroup>
- <ClCompile Include="testbench.cpp" />
- </ItemGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
- <ImportGroup Label="ExtensionTargets">
- </ImportGroup>
-</Project> \ No newline at end of file
diff --git a/Rx/CPP/testbench/testbench.vcxproj.filters b/Rx/CPP/testbench/testbench.vcxproj.filters
deleted file mode 100644
index 8afd620..0000000
--- a/Rx/CPP/testbench/testbench.vcxproj.filters
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup>
- <Filter Include="Source Files">
- <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
- <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
- </Filter>
- <Filter Include="Header Files">
- <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
- <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
- </Filter>
- <Filter Include="Resource Files">
- <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
- <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
- </Filter>
- </ItemGroup>
- <ItemGroup>
- <ClCompile Include="testbench.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
- </ItemGroup>
-</Project> \ No newline at end of file
diff --git a/Rx/v2/examples/pythagorian/main.cpp b/Rx/v2/examples/pythagorian/main.cpp
new file mode 100644
index 0000000..d6aa6f0
--- /dev/null
+++ b/Rx/v2/examples/pythagorian/main.cpp
@@ -0,0 +1,50 @@
+#include "rxcpp/rx.hpp"
+// create alias' to simplify code
+// these are owned by the user so that
+// conflicts can be managed by the user.
+namespace rx=rxcpp;
+namespace rxu=rxcpp::util;
+namespace rxsc=rxcpp::schedulers;
+namespace rxsub=rxcpp::subjects;
+
+// At this time, RxCpp will fail to compile if the contents
+// of the std namespace are merged into the global namespace
+// DO NOT USE: 'using namespace std;'
+
+#ifdef UNICODE
+int wmain(int argc, wchar_t** argv)
+#else
+int main(int argc, char** argv)
+#endif
+{
+ int c = 0;
+
+ auto triples =
+ rx::observable<>::range(1)
+ .concat_map(
+ [&c](int z){
+ return rx::observable<>::range(1, z)
+ .concat_map(
+ [=, &c](int x){
+ return rx::observable<>::range(x, z)
+ .filter([=, &c](int y){++c; return x*x + y*y == z*z;})
+ .map([=](int y){return std::make_tuple(x, y, z);})
+ // forget type to workaround lambda deduction bug on msvc 2013
+ .as_dynamic();},
+ [](int x, std::tuple<int,int,int> triplet){return triplet;})
+ // forget type to workaround lambda deduction bug on msvc 2013
+ .as_dynamic();},
+ [](int z, std::tuple<int,int,int> triplet){return triplet;});
+
+ int ct = 0;
+
+ triples
+ .take(100)
+ .subscribe(rxu::apply_to([&ct](int x,int y,int z){
+ ++ct;
+ }));
+
+ std::cout << "concat_map pythagorian range : " << c << " filtered to, " << ct << " triplets" << std::endl;
+
+ return 0;
+}
diff --git a/Rx/v2/test/operators/flat_map.cpp b/Rx/v2/test/operators/flat_map.cpp
index f3ada84..9c6d51d 100644
--- a/Rx/v2/test/operators/flat_map.cpp
+++ b/Rx/v2/test/operators/flat_map.cpp
@@ -60,7 +60,7 @@ SCENARIO("flat_map pythagorian ranges", "[hide][range][flat_map][pythagorian][pe
auto sc = rxsc::make_immediate();
//auto sc = rxsc::make_current_thread();
- auto so = rx::syncronize_in_one_worker(sc);
+ auto so = rx::identity_one_worker(sc);
int c = 0;
int ct = 0;
diff --git a/projects/CMake/CMakeLists.txt b/projects/CMake/CMakeLists.txt
index 87676b6..34ab78d 100644
--- a/projects/CMake/CMakeLists.txt
+++ b/projects/CMake/CMakeLists.txt
@@ -15,68 +15,48 @@ endif()
# define some folders
get_filename_component(RXCPP_DIR "${CMAKE_CURRENT_SOURCE_DIR}" PATH)
get_filename_component(RXCPP_DIR "${RXCPP_DIR}" PATH)
-set(TEST_DIR ${RXCPP_DIR}/Rx/CPP/test)
-set(V2_TEST_DIR ${RXCPP_DIR}/Rx/v2/test)
+set(TEST_DIR ${RXCPP_DIR}/Rx/v2/test)
+set(EXAMPLES_DIR ${RXCPP_DIR}/Rx/v2/examples)
-include_directories(${RXCPP_DIR}/ext/catch/include ${RXCPP_DIR}/Ix/CPP/src ${RXCPP_DIR}/Rx/CPP/src ${RXCPP_DIR}/Rx/v2/src)
+include_directories(${RXCPP_DIR}/ext/catch/include ${RXCPP_DIR}/Ix/CPP/src ${RXCPP_DIR}/Rx/v2/src)
# define the sources of the self test
set(TEST_SOURCES
${TEST_DIR}/test.cpp
- ${TEST_DIR}/operators/Merge.cpp
- ${TEST_DIR}/operators/Return.cpp
- ${TEST_DIR}/operators/Select.cpp
- ${TEST_DIR}/operators/SelectMany.cpp
- ${TEST_DIR}/operators/Where.cpp
- ${TEST_DIR}/operators/Publish.cpp
+ ${TEST_DIR}/subscriptions/observer.cpp
+ ${TEST_DIR}/subscriptions/subscription.cpp
+ ${TEST_DIR}/subjects/subject.cpp
+ ${TEST_DIR}/sources/defer.cpp
+ ${TEST_DIR}/sources/interval.cpp
+ ${TEST_DIR}/operators/buffer.cpp
+ ${TEST_DIR}/operators/combine_latest.cpp
+ ${TEST_DIR}/operators/concat.cpp
+ ${TEST_DIR}/operators/merge.cpp
+ ${TEST_DIR}/operators/lift.cpp
+ ${TEST_DIR}/operators/filter.cpp
+ ${TEST_DIR}/operators/scan.cpp
+ ${TEST_DIR}/operators/take.cpp
+ ${TEST_DIR}/operators/publish.cpp
+ ${TEST_DIR}/operators/flat_map.cpp
+ ${TEST_DIR}/operators/concat_map.cpp
+ ${TEST_DIR}/operators/map.cpp
)
-add_executable(rxcpp_test ${TEST_SOURCES})
+add_executable(rxcppv2_test ${TEST_SOURCES})
-# define the sources of testbench
-set(TESTBENCH_SOURCES
- ${RXCPP_DIR}/Rx/CPP/testbench/testbench.cpp
+# define the sources of the pythagorian example
+set(PYTHAGORIAN_SOURCES
+ ${EXAMPLES_DIR}/pythagorian/main.cpp
)
-add_executable(testbench ${TESTBENCH_SOURCES})
-
-# define the sources of the self test
-set(V2_TEST_SOURCES
- ${V2_TEST_DIR}/test.cpp
- ${V2_TEST_DIR}/operators/buffer.cpp
- ${V2_TEST_DIR}/sources/defer.cpp
- ${V2_TEST_DIR}/operators/combine_latest.cpp
- ${V2_TEST_DIR}/sources/interval.cpp
- ${V2_TEST_DIR}/operators/concat.cpp
- ${V2_TEST_DIR}/operators/merge.cpp
- ${V2_TEST_DIR}/operators/lift.cpp
- ${V2_TEST_DIR}/operators/filter.cpp
- ${V2_TEST_DIR}/subscriptions/observer.cpp
- ${V2_TEST_DIR}/operators/scan.cpp
- ${V2_TEST_DIR}/operators/take.cpp
- ${V2_TEST_DIR}/operators/publish.cpp
- ${V2_TEST_DIR}/subjects/subject.cpp
- ${V2_TEST_DIR}/subscriptions/subscription.cpp
- ${V2_TEST_DIR}/operators/flat_map.cpp
- ${V2_TEST_DIR}/operators/concat_map.cpp
- ${V2_TEST_DIR}/operators/map.cpp
-)
-add_executable(rxcppv2_test ${V2_TEST_SOURCES})
+add_executable(pythagorian ${PYTHAGORIAN_SOURCES})
# configure unit tests via CTest
enable_testing()
-add_test(NAME RunTests COMMAND rxcpp_test)
+add_test(NAME RunTests COMMAND rxcppv2_test)
-add_test(NAME ListTests COMMAND rxcpp_test --list-tests)
+add_test(NAME ListTests COMMAND rxcppv2_test --list-tests)
set_tests_properties(ListTests PROPERTIES PASS_REGULAR_EXPRESSION "[0-9]+ test cases")
-add_test(NAME ListTags COMMAND rxcpp_test --list-tags)
+add_test(NAME ListTags COMMAND rxcppv2_test --list-tags)
set_tests_properties(ListTags PROPERTIES PASS_REGULAR_EXPRESSION "[0-9]+ tags")
-
-add_test(NAME RunTestsV2 COMMAND rxcppv2_test)
-
-add_test(NAME ListTestsV2 COMMAND rxcppv2_test --list-tests)
-set_tests_properties(ListTestsV2 PROPERTIES PASS_REGULAR_EXPRESSION "[0-9]+ test cases")
-
-add_test(NAME ListTagsV2 COMMAND rxcppv2_test --list-tags)
-set_tests_properties(ListTagsV2 PROPERTIES PASS_REGULAR_EXPRESSION "[0-9]+ tags")
diff --git a/projects/nuget/rxcpp.autoconfig b/projects/nuget/rxcpp.autoconfig
index 7c002d0..bb3b63e 100644
--- a/projects/nuget/rxcpp.autoconfig
+++ b/projects/nuget/rxcpp.autoconfig
@@ -21,8 +21,8 @@ nuget {
#defines {
SDK_RX = ..\..\;
}
- include: { "${SDK_RX}Rx\CPP\src\**\*", "${SDK_RX}Ix\CPP\src\**\*" };
- docs: { ${SDK_RX}Readme.html, ${SDK_RX}AUTHORS.txt, ${SDK_RX}Rx\CPP\license.txt };
+ include: { "${SDK_RX}Rx\v2\src\**\*", "${SDK_RX}Ix\CPP\src\**\*" };
+ docs: { ${SDK_RX}Readme.html, ${SDK_RX}AUTHORS.txt, ${SDK_RX}v2\license.txt };
}
targets {