============================================================================================== interface IThreadFutureBase ============================================================================================== @interface ICoroFutureBase @brief Exposes methods to access a non-coroutine future (i.e. accessed from a thread)
| 30 | /// @interface ICoroFutureBase |
| 31 | /// @brief Exposes methods to access a non-coroutine future (i.e. accessed from a thread) |
| 32 | struct IThreadFutureBase |
| 33 | { |
| 34 | using Ptr = std::shared_ptr<IThreadFutureBase>; |
| 35 | |
| 36 | /// @brief Virtual destructor |
| 37 | virtual ~IThreadFutureBase() = default; |
| 38 | |
| 39 | /// @brief Determines if this future still has a shared state with the promise object. |
| 40 | /// @return True if valid, false otherwise. |
| 41 | virtual bool valid() const = 0; |
| 42 | |
| 43 | /// @brief Waits for the future value. |
| 44 | /// @note This method blocks until the future is ready or until an exception is thrown. |
| 45 | virtual void wait() const = 0; |
| 46 | |
| 47 | /// @brief Waits for the future value up to a maximum 'timeMs' milliseconds. |
| 48 | /// @param[in] timeMs The maximum amount of milliseconds to wait until the future value becomes ready. |
| 49 | /// Using -1 is equivalent to calling wait(). Other negative values will throw. |
| 50 | /// @return 'ready' if value was posted before duration expired or 'timeout' otherwise. |
| 51 | /// @note Blocks until the value is ready, until 'timeMs' duration expires or until an exception is thrown. |
| 52 | virtual std::future_status waitFor(std::chrono::milliseconds timeMs) const = 0; |
| 53 | }; |
| 54 | |
| 55 | using IThreadFutureBasePtr = IThreadFutureBase::Ptr; |
| 56 |
nothing calls this directly
no outgoing calls
no test coverage detected