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
bddd8a35
Commit
bddd8a35
authored
Feb 18, 2015
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove dead code and coding style nitpicks
parent
40b1b4f1
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
57 additions
and
113 deletions
+57
-113
examples/curl/curl_fuse.cpp
examples/curl/curl_fuse.cpp
+2
-1
examples/qtsupport/qt_group_chat.cpp
examples/qtsupport/qt_group_chat.cpp
+0
-1
examples/remote_actors/group_chat.cpp
examples/remote_actors/group_chat.cpp
+0
-12
examples/type_system/announce_5.cpp
examples/type_system/announce_5.cpp
+9
-9
libcaf_core/src/partial_function.cpp
libcaf_core/src/partial_function.cpp
+0
-44
unit_testing/ping_pong.cpp
unit_testing/ping_pong.cpp
+0
-7
unit_testing/ping_pong.hpp
unit_testing/ping_pong.hpp
+0
-2
unit_testing/test_intrusive_ptr.cpp
unit_testing/test_intrusive_ptr.cpp
+46
-12
unit_testing/test_match.cpp
unit_testing/test_match.cpp
+0
-22
unit_testing/test_serialization.cpp
unit_testing/test_serialization.cpp
+0
-3
No files found.
examples/curl/curl_fuse.cpp
View file @
bddd8a35
...
...
@@ -215,7 +215,8 @@ client::~client() {
class
curl_worker
:
public
base_actor
{
public:
curl_worker
(
const
actor
&
parent
)
:
base_actor
(
parent
,
"curl_worker"
,
color
::
yellow
)
{
:
base_actor
(
parent
,
"curl_worker"
,
color
::
yellow
),
m_curl
(
nullptr
)
{
// nop
}
...
...
examples/qtsupport/qt_group_chat.cpp
View file @
bddd8a35
...
...
@@ -52,7 +52,6 @@ int main(int argc, char** argv) {
try
{
gptr
=
group
::
get
(
group_id
.
substr
(
0
,
p
),
group_id
.
substr
(
p
+
1
));
}
catch
(
exception
&
e
)
{
ostringstream
err
;
cerr
<<
"*** exception: group::get(
\"
"
<<
group_id
.
substr
(
0
,
p
)
<<
"
\"
,
\"
"
<<
group_id
.
substr
(
p
+
1
)
<<
"
\"
) failed; "
<<
to_verbose_string
(
e
)
<<
endl
;
...
...
examples/remote_actors/group_chat.cpp
View file @
bddd8a35
...
...
@@ -35,17 +35,6 @@ istream& operator>>(istream& is, line& l) {
namespace
{
string
s_last_line
;
}
message
split_line
(
const
line
&
l
)
{
istringstream
strs
(
l
.
str
);
s_last_line
=
move
(
l
.
str
);
string
tmp
;
message_builder
mb
;
while
(
getline
(
strs
,
tmp
,
' '
))
{
if
(
!
tmp
.
empty
())
mb
.
append
(
std
::
move
(
tmp
));
}
return
mb
.
to_message
();
}
void
client
(
event_based_actor
*
self
,
const
string
&
name
)
{
self
->
become
(
[
=
](
broadcast_atom
,
const
string
&
message
)
{
...
...
@@ -113,7 +102,6 @@ int main(int argc, char** argv) {
anon_send
(
client_actor
,
join_atom
::
value
,
g
);
}
catch
(
exception
&
e
)
{
ostringstream
err
;
cerr
<<
"*** exception: group::get(
\"
"
<<
group_id
.
substr
(
0
,
p
)
<<
"
\"
,
\"
"
<<
group_id
.
substr
(
p
+
1
)
<<
"
\"
) failed; "
<<
to_verbose_string
(
e
)
<<
endl
;
...
...
examples/type_system/announce_5.cpp
View file @
bddd8a35
libcaf_core/src/partial_function.cpp
deleted
100644 → 0
View file @
40b1b4f1
/******************************************************************************
* _________________________ *
* __ ____/__ |__ ____/ C++ *
* _ / __ /| |_ /_ Actor *
* / /___ _ ___ | __/ Framework *
* ____/ /_/ |_/_/ *
* *
* Copyright (C) 2011 - 2014 *
* Dominik Charousset <dominik.charousset (at) haw-hamburg.de> *
* *
* Distributed under the terms and conditions of the BSD 3-Clause License or *
* (at your option) under the terms and conditions of the Boost Software *
* License 1.0. See accompanying files LICENSE and LICENCE_ALTERNATIVE. *
* *
* If you did not receive a copy of the license files, see *
* http://opensource.org/licenses/BSD-3-Clause and *
* http://www.boost.org/LICENSE_1_0.txt. *
******************************************************************************/
#include "cppa/to_string.hpp"
#include "cppa/config.hpp"
#include "cppa/message_handler.hpp"
namespace
cppa
{
message_handler
::
message_handler
(
impl_ptr
ptr
)
:
m_impl
(
std
::
move
(
ptr
))
{}
void
detail
::
behavior_impl
::
handle_timeout
()
{}
}
// namespace cppa
namespace
cppa
{
namespace
detail
{
message_handler
combine
(
behavior_impl_ptr
lhs
,
behavior_impl_ptr
rhs
)
{
return
{
lhs
->
or_else
(
rhs
)};
}
behavior_impl_ptr
extract
(
const
message_handler
&
arg
)
{
return
arg
.
as_behavior_impl
();
}
}
}
// namespace cppa::detail
unit_testing/ping_pong.cpp
View file @
bddd8a35
...
...
@@ -72,10 +72,3 @@ void pong(blocking_actor* self, actor ping_actor) {
self
->
send
(
ping_actor
,
pong_atom
::
value
,
0
);
// kickoff
self
->
receive_loop
(
pong_behavior
(
self
));
}
void
event_based_pong
(
event_based_actor
*
self
,
actor
ping_actor
)
{
CAF_LOGF_TRACE
(
"ping_actor = "
<<
to_string
(
ping_actor
));
CAF_REQUIRE
(
ping_actor
!=
invalid_actor
);
self
->
send
(
ping_actor
,
pong_atom
::
value
,
0
);
// kickoff
self
->
become
(
pong_behavior
(
self
));
}
unit_testing/ping_pong.hpp
View file @
bddd8a35
...
...
@@ -12,8 +12,6 @@ void event_based_ping(caf::event_based_actor*, size_t num_pings);
void
pong
(
caf
::
blocking_actor
*
,
caf
::
actor
ping_actor
);
void
event_based_pong
(
caf
::
event_based_actor
*
,
caf
::
actor
ping_actor
);
// returns the number of messages ping received
size_t
pongs
();
...
...
unit_testing/test_intrusive_ptr.cpp
View file @
bddd8a35
...
...
@@ -14,29 +14,53 @@ int class0_instances = 0;
int
class1_instances
=
0
;
struct
class0
:
ref_counted
{
class0
()
{
++
class0_instances
;
}
class0
(
bool
subtype
=
false
)
:
m_subtype
(
subtype
)
{
if
(
!
subtype
)
{
++
class0_instances
;
}
}
~
class0
()
{
if
(
!
m_subtype
)
{
--
class0_instances
;
}
}
virtual
~
class0
()
{
--
class0_instances
;
}
bool
is_subtype
()
const
{
return
m_subtype
;
}
virtual
class0
*
create
()
const
{
return
new
class0
;
}
virtual
class0
*
create
()
const
{
return
new
class0
;
}
bool
m_subtype
;
};
struct
class1
:
class0
{
class1
()
{
++
class1_instances
;
}
virtual
~
class1
()
{
--
class1_instances
;
}
class1
()
:
class0
(
true
)
{
++
class1_instances
;
}
virtual
class1
*
create
()
const
{
return
new
class1
;
}
~
class1
()
{
--
class1_instances
;
}
class1
*
create
()
const
override
{
return
new
class1
;
}
};
using
class0_ptr
=
intrusive_ptr
<
class0
>
;
using
class1_ptr
=
intrusive_ptr
<
class1
>
;
class0
*
get_test_rc
()
{
return
new
class0
;
}
class0
*
get_test_rc
()
{
return
new
class0
;
}
class0_ptr
get_test_ptr
()
{
return
get_test_rc
();
}
class0_ptr
get_test_ptr
()
{
return
get_test_rc
();
}
}
// namespace <anonymous>
...
...
@@ -51,6 +75,7 @@ int main() {
CAF_CHECK
(
p
->
unique
());
}
CAF_CHECK_EQUAL
(
class0_instances
,
0
);
CAF_CHECK_EQUAL
(
class1_instances
,
0
);
{
class0_ptr
p
;
p
=
new
class0
;
...
...
@@ -58,6 +83,7 @@ int main() {
CAF_CHECK
(
p
->
unique
());
}
CAF_CHECK_EQUAL
(
class0_instances
,
0
);
CAF_CHECK_EQUAL
(
class1_instances
,
0
);
{
class0_ptr
p1
;
p1
=
get_test_rc
();
...
...
@@ -66,6 +92,7 @@ int main() {
CAF_CHECK_EQUAL
(
p1
->
unique
(),
false
);
}
CAF_CHECK_EQUAL
(
class0_instances
,
0
);
CAF_CHECK_EQUAL
(
class1_instances
,
0
);
{
std
::
list
<
class0_ptr
>
pl
;
pl
.
push_back
(
get_test_ptr
());
...
...
@@ -75,19 +102,26 @@ int main() {
CAF_CHECK_EQUAL
(
class0_instances
,
3
);
}
CAF_CHECK_EQUAL
(
class0_instances
,
0
);
CAF_CHECK_EQUAL
(
class1_instances
,
0
);
{
auto
p1
=
detail
::
make_counted
<
class0
>
();
p1
=
new
class1
;
CAF_CHECK_EQUAL
(
p1
->
is_subtype
(),
false
);
CAF_CHECK_EQUAL
(
p1
->
unique
(),
true
);
CAF_CHECK_EQUAL
(
class0_instances
,
1
);
CAF_CHECK_EQUAL
(
class1_instances
,
0
);
p1
.
reset
(
new
class1
);
CAF_CHECK_EQUAL
(
p1
->
is_subtype
(),
true
);
CAF_CHECK_EQUAL
(
p1
->
unique
(),
true
);
CAF_CHECK_EQUAL
(
class0_instances
,
0
);
CAF_CHECK_EQUAL
(
class1_instances
,
1
);
auto
p2
=
detail
::
make_counted
<
class1
>
();
p1
=
p2
;
CAF_CHECK_EQUAL
(
class0_instances
,
1
);
CAF_CHECK_EQUAL
(
p1
->
unique
(),
false
);
CAF_CHECK_EQUAL
(
class0_instances
,
0
);
CAF_CHECK_EQUAL
(
class1_instances
,
1
);
CAF_CHECK
(
p1
==
p2
);
}
CAF_CHECK_EQUAL
(
class0_instances
,
0
);
CAF_CHECK_EQUAL
(
class1_instances
,
0
);
return
CAF_TEST_RESULT
();
}
unit_testing/test_match.cpp
View file @
bddd8a35
...
...
@@ -10,20 +10,6 @@ using namespace std;
using
hi_atom
=
atom_constant
<
atom
(
"hi"
)
>
;
using
ho_atom
=
atom_constant
<
atom
(
"ho"
)
>
;
optional
<
int
>
even_int
(
int
i
)
{
if
(
i
%
2
==
0
)
{
return
i
;
}
return
none
;
}
optional
<
const
vector
<
int
>&>
sorted_vec
(
const
vector
<
int
>&
vec
)
{
if
(
is_sorted
(
vec
.
begin
(),
vec
.
end
()))
{
return
vec
;
}
return
none
;
}
function
<
optional
<
string
>
(
const
string
&
)
>
starts_with
(
const
string
&
s
)
{
return
[
=
](
const
string
&
str
)
->
optional
<
string
>
{
cout
<<
"starts_with guard called"
<<
endl
;
...
...
@@ -35,14 +21,6 @@ function<optional<string>(const string&)> starts_with(const string& s) {
};
}
optional
<
vector
<
string
>>
kvp_split
(
const
string
&
str
)
{
auto
pos
=
str
.
find
(
'='
);
if
(
pos
!=
string
::
npos
&&
pos
==
str
.
rfind
(
'='
))
{
return
vector
<
string
>
{
str
.
substr
(
0
,
pos
),
str
.
substr
(
pos
+
1
)};
}
return
none
;
}
optional
<
int
>
toint
(
const
string
&
str
)
{
char
*
endptr
=
nullptr
;
int
result
=
static_cast
<
int
>
(
strtol
(
str
.
c_str
(),
&
endptr
,
10
));
...
...
unit_testing/test_serialization.cpp
View file @
bddd8a35
...
...
@@ -93,9 +93,6 @@ struct raw_struct_type_info : detail::abstract_uniform_type_info<raw_struct> {
rs
->
str
.
resize
(
size
);
source
->
read_raw
(
size
,
&
(
rs
->
str
[
0
]));
}
bool
equals
(
const
void
*
lhs
,
const
void
*
rhs
)
const
override
{
return
deref
(
lhs
)
==
deref
(
rhs
);
}
};
void
test_ieee_754
()
{
...
...
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