xtd
1.0.0
Toggle main menu visibility
Loading...
Searching...
No Matches
xtd.core
include
xtd
threading
tasks
parallel.hpp
Go to the documentation of this file.
1
4
#pragma once
5
#include "
task_factory.hpp
"
6
#include "
../../collections/generic/list.hpp
"
7
#include "
../../array.hpp
"
8
#include "
../../static.hpp
"
9
11
namespace
xtd
{
13
namespace
threading
{
15
namespace
tasks
{
22
class
parallel
static_
{
23
public
:
34
static
auto
invoke
(
const
xtd::array
<xtd::action<>>& actions) ->
void
{
35
xtd::collections::generic::list<xtd::threading::tasks::task<>
>
tasks
;
36
for
(
const
auto
& action : actions)
37
tasks
.add(xtd::threading::tasks::task<>::factory().start_new(action));
38
task<>::wait_all(
tasks
);
39
}
40
41
template
<
typename
collection_t>
42
static
auto
invoke
(
const
collection_t& actions) ->
void
{
43
xtd::collections::generic::list<xtd::threading::tasks::task<>
>
tasks
;
44
for
(
const
auto
& action : actions)
45
tasks
.add(xtd::threading::tasks::task<>::factory().start_new(action));
46
task<>::wait_all(
tasks
);
47
}
48
49
template
<
typename
...args_t>
50
static
auto
invoke
(args_t... args) ->
void
{
invoke
(
xtd::array
<xtd::action<>> {xtd::action<> {std::forward<args_t>(args)}...});}
51
};
52
}
53
}
54
}
array.hpp
Contains xtd::array class.
xtd::array
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
Definition
array.hpp:64
xtd::collections::generic::list
Represents a strongly typed list of objects that can be accessed by index. Provides methods to search...
Definition
list.hpp:80
xtd::threading::tasks::parallel
Provides support for creating and scheduling Task objects.
Definition
parallel.hpp:22
xtd::threading::tasks::parallel::invoke
static auto invoke(const xtd::array< xtd::action<> > &actions) -> void
Executes each of the provided actions, possibly in parallel.
Definition
parallel.hpp:34
static_
#define static_
This keyword is use to represent a static object. A static object can't be instantiated (constructors...
Definition
static.hpp:38
list.hpp
Contains xtd::collections::generic::list <type_t> class.
xtd::threading::tasks
The xtd::threading::tasks namespace provides types that simplify the work of writing concurrent and a...
Definition
basic_task.hpp:32
xtd::threading
The xtd::threading namespace provides classes and interfaces that enable multithreaded programming....
Definition
abandoned_mutex_exception.hpp:10
xtd
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition
abstract_object.hpp:8
static.hpp
Contains xtd::static_object class.
task_factory.hpp
Contains xtd::threading::tasks::task_factory <result_t> class.
Generated on
for xtd by
Gammasoft
. All rights reserved.