Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
8db1e5c3
Commit
8db1e5c3
authored
May 25, 2016
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initialize systems with argc+argv in examples
parent
e9bc9c1f
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
32 additions
and
32 deletions
+32
-32
examples/composition/calculator_behavior.cpp
examples/composition/calculator_behavior.cpp
+2
-2
examples/composition/dictionary_behavior.cpp
examples/composition/dictionary_behavior.cpp
+2
-2
examples/curl/curl_fuse.cpp
examples/curl/curl_fuse.cpp
+2
-2
examples/custom_type/custom_types_1.cpp
examples/custom_type/custom_types_1.cpp
+2
-2
examples/custom_type/custom_types_2.cpp
examples/custom_type/custom_types_2.cpp
+2
-2
examples/custom_type/custom_types_3.cpp
examples/custom_type/custom_types_3.cpp
+2
-2
examples/dynamic_behavior/dining_philosophers.cpp
examples/dynamic_behavior/dining_philosophers.cpp
+2
-2
examples/dynamic_behavior/skip_messages.cpp
examples/dynamic_behavior/skip_messages.cpp
+2
-2
examples/message_passing/calculator.cpp
examples/message_passing/calculator.cpp
+2
-2
examples/message_passing/cell.cpp
examples/message_passing/cell.cpp
+2
-2
examples/message_passing/dancing_kirby.cpp
examples/message_passing/dancing_kirby.cpp
+2
-2
examples/message_passing/delegating.cpp
examples/message_passing/delegating.cpp
+2
-2
examples/message_passing/divider.cpp
examples/message_passing/divider.cpp
+2
-2
examples/message_passing/fixed_stack.cpp
examples/message_passing/fixed_stack.cpp
+2
-2
examples/message_passing/prioritizing.cpp
examples/message_passing/prioritizing.cpp
+2
-2
examples/message_passing/request.cpp
examples/message_passing/request.cpp
+2
-2
No files found.
examples/composition/calculator_behavior.cpp
View file @
8db1e5c3
...
...
@@ -42,8 +42,8 @@ using calculator_bhvr = composed_behavior<adder_bhvr, multiplier_bhvr>;
}
// namespace <anonymous>
int
main
()
{
actor_system
system
;
int
main
(
int
argc
,
char
**
argv
)
{
actor_system
system
{
argc
,
argv
}
;
auto
f
=
make_function_view
(
system
.
spawn
<
calculator_bhvr
>
());
cout
<<
"10 + 20 = "
<<
f
(
add_atom
::
value
,
10
,
20
)
<<
endl
;
cout
<<
"7 * 9 = "
<<
f
(
multiply_atom
::
value
,
7
,
9
)
<<
endl
;
...
...
examples/composition/dictionary_behavior.cpp
View file @
8db1e5c3
...
...
@@ -45,8 +45,8 @@ protected:
}
// namespace <anonymous>
int
main
()
{
actor_system
system
;
int
main
(
int
argc
,
char
**
argv
)
{
actor_system
system
{
argc
,
argv
}
;
auto
f
=
make_function_view
(
system
.
spawn
<
dict_behavior
>
());
f
(
put_atom
::
value
,
"CAF"
,
"success"
);
cout
<<
"CAF is the key to "
<<
f
(
get_atom
::
value
,
"CAF"
)
<<
endl
;
...
...
examples/curl/curl_fuse.cpp
View file @
8db1e5c3
...
...
@@ -329,7 +329,7 @@ std::atomic<bool> shutdown_flag{false};
}
// namespace <anonymous>
int
main
()
{
int
main
(
int
argc
,
char
**
argv
)
{
// random number setup
// install signal handler
struct
sigaction
act
;
...
...
@@ -343,7 +343,7 @@ int main() {
set_sighandler
();
// initialize CURL
curl_global_init
(
CURL_GLOBAL_DEFAULT
);
actor_system
system
;
actor_system
system
{
argc
,
argv
}
;
scoped_actor
self
{
system
};
// spawn client and curl_master
auto
master
=
self
->
spawn
<
detached
>
(
curl_master
);
...
...
examples/custom_type/custom_types_1.cpp
View file @
8db1e5c3
...
...
@@ -81,8 +81,8 @@ void testee(event_based_actor* self, size_t remaining) {
);
}
int
main
(
int
,
char
**
)
{
actor_system_config
cfg
;
int
main
(
int
argc
,
char
**
argv
)
{
actor_system_config
cfg
{
argc
,
argv
}
;
cfg
.
add_message_type
<
foo
>
(
"foo"
);
cfg
.
add_message_type
<
foo2
>
(
"foo2"
);
cfg
.
add_message_type
<
foo_pair
>
(
"foo_pair"
);
...
...
examples/custom_type/custom_types_2.cpp
View file @
8db1e5c3
...
...
@@ -61,8 +61,8 @@ behavior testee(event_based_actor* self) {
};
}
int
main
(
int
,
char
**
)
{
actor_system_config
cfg
;
int
main
(
int
argc
,
char
**
argv
)
{
actor_system_config
cfg
{
argc
,
argv
}
;
cfg
.
add_message_type
<
foo
>
(
"foo"
);
actor_system
system
{
cfg
};
anon_send
(
system
.
spawn
(
testee
),
foo
{
1
,
2
});
...
...
examples/custom_type/custom_types_3.cpp
View file @
8db1e5c3
...
...
@@ -75,8 +75,8 @@ behavior testee(event_based_actor* self) {
};
}
int
main
(
int
,
char
**
)
{
actor_system_config
cfg
;
int
main
(
int
argc
,
char
**
argv
)
{
actor_system_config
cfg
{
argc
,
argv
}
;
cfg
.
add_message_type
<
foo
>
(
"foo"
);
actor_system
system
{
cfg
};
anon_send
(
system
.
spawn
(
testee
),
foo
{
1
,
2
});
...
...
examples/dynamic_behavior/dining_philosophers.cpp
View file @
8db1e5c3
...
...
@@ -191,8 +191,8 @@ private:
}
// namespace <anonymous>
int
main
(
int
,
char
**
)
{
actor_system
system
;
int
main
(
int
argc
,
char
**
argv
)
{
actor_system
system
{
argc
,
argv
}
;
scoped_actor
self
{
system
};
// create five chopsticks
aout
(
self
)
<<
"chopstick ids are:"
;
...
...
examples/dynamic_behavior/skip_messages.cpp
View file @
8db1e5c3
...
...
@@ -36,8 +36,8 @@ behavior client(event_based_actor* self, const actor& serv) {
};
}
int
main
()
{
actor_system
system
;
int
main
(
int
argc
,
char
**
argv
)
{
actor_system
system
{
argc
,
argv
}
;
auto
serv
=
system
.
spawn
(
server
);
auto
worker
=
system
.
spawn
(
client
,
serv
);
scoped_actor
self
{
system
};
...
...
examples/message_passing/calculator.cpp
View file @
8db1e5c3
...
...
@@ -127,8 +127,8 @@ void tester(scoped_actor& self, const Handle& hdl, int x, int y, Ts&&... xs) {
tester
(
self
,
std
::
forward
<
Ts
>
(
xs
)...);
}
int
main
()
{
actor_system
system
;
int
main
(
int
argc
,
char
**
argv
)
{
actor_system
system
{
argc
,
argv
}
;
auto
a1
=
system
.
spawn
(
blocking_calculator_fun
);
auto
a2
=
system
.
spawn
(
calculator_fun
);
auto
a3
=
system
.
spawn
(
typed_calculator_fun
);
...
...
examples/message_passing/cell.cpp
View file @
8db1e5c3
...
...
@@ -44,8 +44,8 @@ behavior unchecked_cell(stateful_actor<cell_state>* self) {
};
}
int
main
()
{
actor_system
system
;
int
main
(
int
argc
,
char
**
argv
)
{
actor_system
system
{
argc
,
argv
}
;
// create one cell for each implementation
auto
cell1
=
system
.
spawn
(
type_checked_cell
);
auto
cell2
=
system
.
spawn
(
unchecked_cell
);
...
...
examples/message_passing/dancing_kirby.cpp
View file @
8db1e5c3
...
...
@@ -74,7 +74,7 @@ void dancing_kirby(event_based_actor* self) {
);
}
int
main
()
{
actor_system
system
;
int
main
(
int
argc
,
char
**
argv
)
{
actor_system
system
{
argc
,
argv
}
;
system
.
spawn
(
dancing_kirby
);
}
examples/message_passing/delegating.cpp
View file @
8db1e5c3
...
...
@@ -36,7 +36,7 @@ calc::behavior_type actor_c() {
};
}
int
main
()
{
actor_system
system
;
int
main
(
int
argc
,
char
**
argv
)
{
actor_system
system
{
argc
,
argv
}
;
system
.
spawn
(
actor_a
,
system
.
spawn
(
actor_b
,
system
.
spawn
(
actor_c
)));
}
examples/message_passing/divider.cpp
View file @
8db1e5c3
...
...
@@ -47,11 +47,11 @@ divider::behavior_type divider_impl() {
};
}
int
main
()
{
int
main
(
int
argc
,
char
**
argv
)
{
auto
renderer
=
[](
uint8_t
x
,
atom_value
,
const
message
&
)
{
return
"math_error"
+
deep_to_string_as_tuple
(
static_cast
<
math_error
>
(
x
));
};
actor_system_config
cfg
;
actor_system_config
cfg
{
argc
,
argv
}
;
cfg
.
add_error_category
(
atom
(
"math"
),
renderer
);
actor_system
system
{
cfg
};
double
x
;
...
...
examples/message_passing/fixed_stack.cpp
View file @
8db1e5c3
...
...
@@ -69,8 +69,8 @@ private:
behavior
empty_
;
};
int
main
()
{
actor_system
system
;
int
main
(
int
argc
,
char
**
argv
)
{
actor_system
system
{
argc
,
argv
}
;
auto
st
=
system
.
spawn
<
fixed_stack
>
(
5
);
scoped_actor
self
{
system
};
// fill stack
...
...
examples/message_passing/prioritizing.cpp
View file @
8db1e5c3
...
...
@@ -14,8 +14,8 @@ behavior foo(event_based_actor* self) {
};
}
int
main
()
{
actor_system
system
;
int
main
(
int
argc
,
char
**
argv
)
{
actor_system
system
{
argc
,
argv
}
;
scoped_actor
self
{
system
};
aout
(
self
)
<<
"spawn foo"
<<
endl
;
self
->
spawn
(
foo
);
...
...
examples/message_passing/request.cpp
View file @
8db1e5c3
...
...
@@ -57,8 +57,8 @@ void blocking_testee(blocking_actor* self, vector<cell> cells) {
});
}
int
main
()
{
actor_system
system
;
int
main
(
int
argc
,
char
**
argv
)
{
actor_system
system
{
argc
,
argv
}
;
vector
<
cell
>
cells
;
for
(
auto
i
=
0
;
i
<
5
;
++
i
)
cells
.
emplace_back
(
system
.
spawn
(
cell_impl
,
i
*
i
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment