#include <fileoperation.hxx>
Base type for file operation exposing information about its progress state. Exposes a ProgressNotifier, associated to the operation.
Definition at line 17 of file fileoperation.hxx.
| virtual qi::FileOperation::~FileOperation |
( |
| ) |
|
|
inlinevirtual |
Destructor. Cancel the operations's task if is still running and this object is valid.
Definition at line 23 of file fileoperation.hxx.
Move construction.
- Parameters
-
| other | Object that will be moved-from. Will be in invalid state after this call, until being assigned to a vallid state. |
Definition at line 40 of file fileoperation.hxx.
| qi::FileOperation::FileOperation |
( |
TaskPtr |
task | ) |
|
|
inlineexplicitprotected |
| qi::Future<void> qi::FileOperation::detach |
( |
| ) |
|
|
inline |
Detach the running operation from this object. Useful to dissociate the on-going operation from the lifetime of the object, in order to allow its continuation after object destruction. The object destructor will cancel any still running operation if not dissociated beforehand.
Once called, this object will be in invalid state. The task must have been started before calling this function, otherwise a std::runtime_exception will be thrown.
- Returns
- A future corresponding to the end of the operation.
Definition at line 87 of file fileoperation.hxx.
| bool qi::FileOperation::isValid |
( |
| ) |
const |
|
inline |
- Returns
- True if this object is in a valid state, false otherwise. In an invalid state, all of this object's member function calls will result in exception thrown except validity checks functions and move-assignation. An invalid object can be re-assigned to a valid state.
Definition at line 119 of file fileoperation.hxx.
- Returns
- A progress notifier associated to the operation if the operation's task is owned and this object is valid, null otherwise.
Definition at line 112 of file fileoperation.hxx.
| qi::FileOperation::operator bool |
( |
| ) |
const |
|
inlineexplicit |
- Returns
- True if this object owns the operation's task, false otherwise.
Definition at line 122 of file fileoperation.hxx.
| auto qi::FileOperation::operator() |
( |
| ) |
-> decltype(start()) |
|
inline |
Move assignation.
- Parameters
-
| other | Object that will be moved-from. Will be in invalid state after this call, until being assigned to a vallid state. |
Definition at line 48 of file fileoperation.hxx.
| qi::Future<void> qi::FileOperation::start |
( |
| ) |
|
|
inline |
Starts the operation's task. This function must be called only once. Throws a std::runtime_error if start() has already been called before at least once or if this object is in an invalid state.
- Returns
- A future corresponding to the end of the operation.
Definition at line 61 of file fileoperation.hxx.
The documentation for this class was generated from the following file: