A simple class for easily managing asynchronous operations.
More...
#include <management.hpp>
|
|
bool | print = true |
| | Turn printing on/off.
|
| |
template<typename RetT>
class Helper::AsyncManager< RetT >
A simple class for easily managing asynchronous operations.
int some_func(int x) {
return x;
}
int main(void) {
a_manager();
return 0;
}
A simple class for easily managing asynchronous operations.
Definition management.hpp:146
void addProcess(Args &&...args)
Add new processes.
Definition management.hpp:179
void startAll()
Start all defined threads.
Definition management.hpp:185
bool resultsReceived() const
Check the status of the results being provided.
Definition management.hpp:208
std::vector< RetT > getResults()
Get results of threads.
Definition management.hpp:199
bool finalize() const
Print results. getResults() must have been called beforehand.
Definition management.hpp:215
- Template Parameters
-
| RetT | Return type of target function(s). |
◆ addProcess()
template<typename RetT >
template<typename... Args>
Add new processes.
class SomeClass {
public:
int func(int x) {
return x;
}
SomeClass() {
a_manager.
addProcess(&SomeClass::func,
this, 392);
a_manager.
addProcess(&SomeClass::func,
this, 950302);
}
};
- Parameters
-
◆ finalize()
◆ getResults()
Get results of threads.
- Note
- It waits for unfinished threads.
- Returns
- List of results.
◆ operator()()
The documentation for this class was generated from the following file: