nlib
Future.h ファイル

マルチスレッドプログラミングのためのFutureパターンを実装しています。 [詳解]

#include "nn/nlib/Swap.h"
#include "nn/nlib/UniquePtr.h"
#include "nn/nlib/DateTime.h"
#include "nn/nlib/TypeTraits.h"
#include "nn/nlib/threading/CriticalSection.h"
#include "nn/nlib/threading/LimitedSharedPtr.h"
#include "nn/nlib/threading/Thread.h"

[ソースコード]

クラス

class  nn::nlib::threading::Future< R >
 別のスレッド実行の出力をスレッドセーフに取得するためのクラスです。C++11のstd::shared_futureに似ています。 [詳解]
 
class  nn::nlib::threading::Promise< R >
 スレッド実行の結果を呼び出しスレッドに対してスレッドセーフに出力するためのクラスです。C++11のstd::promiseに似ています。 [詳解]
 
class  nn::nlib::threading::Promise< R >
 スレッド実行の結果を呼び出しスレッドに対してスレッドセーフに出力するためのクラスです。C++11のstd::promiseに似ています。 [詳解]
 
class  nn::nlib::threading::Future< R >
 別のスレッド実行の出力をスレッドセーフに取得するためのクラスです。C++11のstd::shared_futureに似ています。 [詳解]
 
class  nn::nlib::threading::PackagedTask< T >
 関数をラップし、別スレッドで実行し戻り値をスレッドセーフに取得できるようにするクラスです。C++11のstd::packaged_taskに似ています。 [詳解]
 
class  nn::nlib::threading::WhenFutureComplete< R1, R2, R3, R4, R5 >
 Futureに値が設定されたことを条件として値が設定されるFutureを定義します。 [詳解]
 

名前空間

 nn::nlib
 共通して使われることの多いストリーム関連のクラス群や各種コンテナ、及びガシェットクラスが実装されています。nlib_nsはエイリアスです。
 
 nn::nlib::threading
 スレッド関連のクラスや関数が実装されています。
 

関数

template<class FutureResult >
errno_t nn::nlib::threading::GetFutureError (FutureResult &result) noexcept
 スレッドがエラー値を持つとき、それをシステムが取得できるようにするための関数です。 [詳解]
 
template<class R >
errno_t nn::nlib::threading::MakeReadyFuture (Future< R > *future, const R &value)
 予め値が設定されたFutureを作成します。 [詳解]
 
Async(引数を持たない関数)
template<class FUNC , class R >
errno_t nn::nlib::threading::Async (Future< R > *future, const FUNC &func, const ThreadSettings &settings)
 ユーザーがスレッドの起動設定を行うことができるAsyncです。
 
template<class FUNC , class R >
errno_t nn::nlib::threading::Async (Future< R > *future, const FUNC &func, const ThreadSettings &settings, move_tag)
 ユーザーがスレッドの起動設定と行うことができ、引数や関数オブジェクトがムーブされるAsyncです。
 
template<class FUNC , class R >
errno_t nn::nlib::threading::Async (Future< R > *future, const FUNC &func)
 関数を別スレッドで実行して実行結果をFutureで取り出せるようにします。
 
template<class FUNC , class R >
errno_t nn::nlib::threading::Async (Future< R > *future, const FUNC &func, move_tag)
 引数や関数オブジェクトがムーブされるAsyncです。
 
Async(引数が1つの関数)
template<class FUNC , class R , class T1 >
errno_t nn::nlib::threading::Async (Future< R > *future, const FUNC &func, const T1 &arg1, const ThreadSettings &settings)
 ユーザーがスレッドの起動設定を行うことができるAsyncです。
 
template<class FUNC , class R , class T1 >
errno_t nn::nlib::threading::Async (Future< R > *future, const FUNC &func, const T1 &arg1, const ThreadSettings &settings, move_tag)
 ユーザーがスレッドの起動設定と行うことができ、引数や関数オブジェクトがムーブされるAsyncです。
 
template<class FUNC , class R , class T1 >
errno_t nn::nlib::threading::Async (Future< R > *future, const FUNC &func, const T1 &arg1)
 関数を別スレッドで実行して実行結果をFutureで取り出せるようにします。 [詳解]
 
template<class FUNC , class R , class T1 >
errno_t nn::nlib::threading::Async (Future< R > *future, const FUNC &func, const T1 &arg1, move_tag)
 引数や関数オブジェクトがムーブされるAsyncです。 [詳解]
 
Async(引数が2つの関数)
template<class FUNC , class R , class T1 , class T2 >
errno_t nn::nlib::threading::Async (Future< R > *future, const FUNC &func, const T1 &arg1, const T2 &arg2, const ThreadSettings &settings)
 ユーザーがスレッドの起動設定を行うことができるAsyncです。
 
template<class FUNC , class R , class T1 , class T2 >
errno_t nn::nlib::threading::Async (Future< R > *future, const FUNC &func, const T1 &arg1, const T2 &arg2, const ThreadSettings &settings, move_tag)
 ユーザーがスレッドの起動設定と行うことができ、引数や関数オブジェクトがムーブされるAsyncです。
 
template<class FUNC , class R , class T1 , class T2 >
errno_t nn::nlib::threading::Async (Future< R > *future, const FUNC &func, const T1 &arg1, const T2 &arg2)
 関数を別スレッドで実行して実行結果をフューチャーによって取り出せるようにします。 [詳解]
 
template<class FUNC , class R , class T1 , class T2 >
errno_t nn::nlib::threading::Async (Future< R > *future, const FUNC &func, const T1 &arg1, const T2 &arg2, move_tag)
 引数や関数オブジェクトがムーブされるAsyncです。
 
Async(引数が3つの関数)
template<class FUNC , class R , class T1 , class T2 , class T3 >
errno_t nn::nlib::threading::Async (Future< R > *future, const FUNC &func, const T1 &arg1, const T2 &arg2, const T3 &arg3, const ThreadSettings &settings)
 ユーザーがスレッドの起動設定を行うことができるAsyncです。
 
template<class FUNC , class R , class T1 , class T2 , class T3 >
errno_t nn::nlib::threading::Async (Future< R > *future, const FUNC &func, const T1 &arg1, const T2 &arg2, const T3 &arg3, const ThreadSettings &settings, move_tag)
 ユーザーがスレッドの起動設定と行うことができ、引数や関数オブジェクトがムーブされるAsyncです。
 
template<class FUNC , class R , class T1 , class T2 , class T3 >
errno_t nn::nlib::threading::Async (Future< R > *future, const FUNC &func, const T1 &arg1, const T2 &arg2, const T3 &arg3)
 関数を別スレッドで実行して実行結果をフューチャーによって取り出せるようにします。 [詳解]
 
template<class FUNC , class R , class T1 , class T2 , class T3 >
errno_t nn::nlib::threading::Async (Future< R > *future, const FUNC &func, const T1 &arg1, const T2 &arg2, const T3 &arg3, move_tag)
 引数や関数オブジェクトがムーブされるAsyncです。
 
Async(引数が4つの関数)
template<class FUNC , class R , class T1 , class T2 , class T3 , class T4 >
errno_t nn::nlib::threading::Async (Future< R > *future, const FUNC &func, const T1 &arg1, const T2 &arg2, const T3 &arg3, const T4 &arg4, const ThreadSettings &settings)
 ユーザーがスレッドの起動設定を行うことができるAsyncです。
 
template<class FUNC , class R , class T1 , class T2 , class T3 , class T4 >
errno_t nn::nlib::threading::Async (Future< R > *future, const FUNC &func, const T1 &arg1, const T2 &arg2, const T3 &arg3, const T4 &arg4, const ThreadSettings &settings, move_tag)
 ユーザーがスレッドの起動設定と行うことができ、引数や関数オブジェクトがムーブされるAsyncです。
 
template<class FUNC , class R , class T1 , class T2 , class T3 , class T4 >
errno_t nn::nlib::threading::Async (Future< R > *future, const FUNC &func, const T1 &arg1, const T2 &arg2, const T3 &arg3, const T4 &arg4)
 関数を別スレッドで実行して実行結果をフューチャーによって取り出せるようにします。 [詳解]
 
template<class FUNC , class R , class T1 , class T2 , class T3 , class T4 >
errno_t nn::nlib::threading::Async (Future< R > *future, const FUNC &func, const T1 &arg1, const T2 &arg2, const T3 &arg3, const T4 &arg4, move_tag)
 引数や関数オブジェクトがムーブされるAsyncです。
 
Async(引数が5つの関数)
template<class FUNC , class R , class T1 , class T2 , class T3 , class T4 , class T5 >
errno_t nn::nlib::threading::Async (Future< R > *future, const FUNC &func, const T1 &arg1, const T2 &arg2, const T3 &arg3, const T4 &arg4, const T5 &arg5, const ThreadSettings &settings)
 ユーザーがスレッドの起動設定を行うことができるAsyncです。
 
template<class FUNC , class R , class T1 , class T2 , class T3 , class T4 , class T5 >
errno_t nn::nlib::threading::Async (Future< R > *future, const FUNC &func, const T1 &arg1, const T2 &arg2, const T3 &arg3, const T4 &arg4, const T5 &arg5, const ThreadSettings &settings, move_tag)
 ユーザーがスレッドの起動設定と行うことができ、引数や関数オブジェクトがムーブされるAsyncです。
 
template<class FUNC , class R , class T1 , class T2 , class T3 , class T4 , class T5 >
errno_t nn::nlib::threading::Async (Future< R > *future, const FUNC &func, const T1 &arg1, const T2 &arg2, const T3 &arg3, const T4 &arg4, const T5 &arg5)
 関数を別スレッドで実行して実行結果をフューチャーによって取り出せるようにします。 [詳解]
 
template<class FUNC , class R , class T1 , class T2 , class T3 , class T4 , class T5 >
errno_t nn::nlib::threading::Async (Future< R > *future, const FUNC &func, const T1 &arg1, const T2 &arg2, const T3 &arg3, const T4 &arg4, const T5 &arg5, move_tag)
 引数や関数オブジェクトがムーブされるAsyncです。
 

詳解

マルチスレッドプログラミングのためのFutureパターンを実装しています。

Future.h に定義があります。