Wrapper of std::future containing a status object and extra data.
More...
#include <tkrzw_dbm_async.h>
|
| StatusFuture (std::future< Status > &&future) |
| Constructor for a status object. More...
|
|
| StatusFuture (std::future< std::pair< Status, std::string >> &&future) |
| Constructor for a status object and a string. More...
|
|
| StatusFuture (std::future< std::pair< Status, std::vector< std::string >>> &&future) |
| Constructor for a status object and a string vector. More...
|
|
| StatusFuture (std::future< std::pair< Status, std::map< std::string, std::string >>> &&future) |
| Constructor for a status object and a string map. More...
|
|
| StatusFuture (std::future< std::pair< Status, int64_t >> &&future) |
| Constructor for a status object and an integer. More...
|
|
| StatusFuture (StatusFuture &&rhs) |
| Move constructor. More...
|
|
| ~StatusFuture () |
| Destructor. More...
|
|
| StatusFuture (const StatusFuture &rhs)=delete |
| Copy and assignment are disabled. More...
|
|
StatusFuture & | operator= (const StatusFuture &rhs)=delete |
|
bool | Wait (double timeout=-1) |
| Waits for the operation to be done. More...
|
|
Status | Get () |
| Waits for the operation to be done and gets the result status. More...
|
|
std::pair< Status, std::string > | GetString () |
| Waits for the operation to be done and gets the status and the extra string. More...
|
|
std::pair< Status, std::vector< std::string > > | GetStringVector () |
| Waits for the operation to be done and gets the status and the extra string vector. More...
|
|
std::pair< Status, std::map< std::string, std::string > > | GetStringMap () |
| Waits for the operation to be done and gets the status and the extra string map. More...
|
|
std::pair< Status, int64_t > | GetInteger () |
| Waits for the operation to be done and gets the status and the extra integer. More...
|
|
const std::type_info & | GetExtraType () |
| Gets the type information of the extra data. More...
|
|
Wrapper of std::future containing a status object and extra data.
◆ StatusFuture() [1/7]
tkrzw::StatusFuture::StatusFuture |
( |
std::future< Status > && |
future | ) |
|
|
explicit |
Constructor for a status object.
- Parameters
-
future | a future object. The ownership is taken. |
◆ StatusFuture() [2/7]
tkrzw::StatusFuture::StatusFuture |
( |
std::future< std::pair< Status, std::string >> && |
future | ) |
|
|
explicit |
Constructor for a status object and a string.
- Parameters
-
future | a future object. The ownership is taken. |
◆ StatusFuture() [3/7]
tkrzw::StatusFuture::StatusFuture |
( |
std::future< std::pair< Status, std::vector< std::string >>> && |
future | ) |
|
|
explicit |
Constructor for a status object and a string vector.
- Parameters
-
future | a future object. The ownership is taken. |
◆ StatusFuture() [4/7]
tkrzw::StatusFuture::StatusFuture |
( |
std::future< std::pair< Status, std::map< std::string, std::string >>> && |
future | ) |
|
|
explicit |
Constructor for a status object and a string map.
- Parameters
-
future | a future object. The ownership is taken. |
◆ StatusFuture() [5/7]
tkrzw::StatusFuture::StatusFuture |
( |
std::future< std::pair< Status, int64_t >> && |
future | ) |
|
|
explicit |
Constructor for a status object and an integer.
- Parameters
-
future | a future object. The ownership is taken. |
◆ StatusFuture() [6/7]
Move constructor.
- Parameters
-
rhs | The right-hand-side object. |
◆ ~StatusFuture()
tkrzw::StatusFuture::~StatusFuture |
( |
| ) |
|
◆ StatusFuture() [7/7]
tkrzw::StatusFuture::StatusFuture |
( |
const StatusFuture & |
rhs | ) |
|
|
explicitdelete |
Copy and assignment are disabled.
◆ Wait()
bool tkrzw::StatusFuture::Wait |
( |
double |
timeout = -1 | ) |
|
Waits for the operation to be done.
- Parameters
-
timeout | The waiting time in seconds. If it is negative, no timeout is set. |
- Returns
- True if the operation has done. False if timeout occurs.
◆ Get()
Status tkrzw::StatusFuture::Get |
( |
| ) |
|
Waits for the operation to be done and gets the result status.
- Returns
- The result status.
Either one of the Get method family can be called only once.
◆ GetString()
std::pair<Status, std::string> tkrzw::StatusFuture::GetString |
( |
| ) |
|
Waits for the operation to be done and gets the status and the extra string.
- Returns
- The result status and the extra string.
Either one of the Get method family can be called only once.
◆ GetStringVector()
std::pair<Status, std::vector<std::string> > tkrzw::StatusFuture::GetStringVector |
( |
| ) |
|
Waits for the operation to be done and gets the status and the extra string vector.
- Returns
- The result status and the extra string vector.
Either one of the Get method family can be called only once.
◆ GetStringMap()
std::pair<Status, std::map<std::string, std::string> > tkrzw::StatusFuture::GetStringMap |
( |
| ) |
|
Waits for the operation to be done and gets the status and the extra string map.
- Returns
- The result status and the extra string map.
Either one of the Get method family can be called only once.
◆ GetInteger()
std::pair<Status, int64_t> tkrzw::StatusFuture::GetInteger |
( |
| ) |
|
Waits for the operation to be done and gets the status and the extra integer.
- Returns
- The result status and the extra integer.
Either one of the Get method family can be called only once.
◆ GetExtraType()
const std::type_info& tkrzw::StatusFuture::GetExtraType |
( |
| ) |
|
Gets the type information of the extra data.
- Returns
- The type information of the extra data.