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
70db21f9
Commit
70db21f9
authored
May 28, 2015
by
Marian Triebe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove GCC 4.7 workarounds
relates #300
parent
d6fc83de
Changes
22
Show whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
51 additions
and
53 deletions
+51
-53
examples/brokers/simple_http_broker.cpp
examples/brokers/simple_http_broker.cpp
+1
-1
libcaf_core/caf/all.hpp
libcaf_core/caf/all.hpp
+1
-1
libcaf_core/caf/detail/ieee_754.hpp
libcaf_core/caf/detail/ieee_754.hpp
+2
-2
libcaf_core/caf/detail/singletons.hpp
libcaf_core/caf/detail/singletons.hpp
+1
-1
libcaf_core/caf/detail/split_join.hpp
libcaf_core/caf/detail/split_join.hpp
+6
-8
libcaf_core/caf/policy/work_stealing.hpp
libcaf_core/caf/policy/work_stealing.hpp
+1
-1
libcaf_core/src/abstract_coordinator.cpp
libcaf_core/src/abstract_coordinator.cpp
+2
-2
libcaf_core/src/actor_registry.cpp
libcaf_core/src/actor_registry.cpp
+2
-2
libcaf_core/src/group_manager.cpp
libcaf_core/src/group_manager.cpp
+4
-4
libcaf_core/src/local_actor.cpp
libcaf_core/src/local_actor.cpp
+3
-4
libcaf_core/src/logging.cpp
libcaf_core/src/logging.cpp
+2
-2
libcaf_core/src/memory.cpp
libcaf_core/src/memory.cpp
+1
-1
libcaf_core/src/run_program.cpp
libcaf_core/src/run_program.cpp
+2
-2
libcaf_core/src/string_serialization.cpp
libcaf_core/src/string_serialization.cpp
+3
-3
libcaf_core/test/serialization.cpp
libcaf_core/test/serialization.cpp
+1
-1
libcaf_io/caf/io/broker.hpp
libcaf_io/caf/io/broker.hpp
+4
-4
libcaf_io/caf/io/middleman.hpp
libcaf_io/caf/io/middleman.hpp
+1
-1
libcaf_io/caf/io/spawn_io.hpp
libcaf_io/caf/io/spawn_io.hpp
+1
-0
libcaf_io/src/basp_broker.cpp
libcaf_io/src/basp_broker.cpp
+2
-2
libcaf_io/src/middleman.cpp
libcaf_io/src/middleman.cpp
+4
-4
libcaf_io/test/uniform_type.cpp
libcaf_io/test/uniform_type.cpp
+4
-4
libcaf_test/caf/test/unit_test_impl.hpp
libcaf_test/caf/test/unit_test_impl.hpp
+3
-3
No files found.
examples/brokers/simple_http_broker.cpp
View file @
70db21f9
...
...
@@ -13,7 +13,7 @@ using namespace caf::io;
using
tick_atom
=
atom_constant
<
atom
(
"tick"
)
>
;
const
char
http_ok
[]
=
R"__(HTTP/1.1 200 OK
const
expr
const
char
http_ok
[]
=
R"__(HTTP/1.1 200 OK
Content-Type: text/plain
Connection: keep-alive
Transfer-Encoding: chunked
...
...
libcaf_core/caf/all.hpp
View file @
70db21f9
...
...
@@ -111,7 +111,7 @@
*
* @section GettingStarted Getting Started
*
* To build `libcaf,` you need `GCC >= 4.
7
or <tt>Clang >=
* To build `libcaf,` you need `GCC >= 4.
8
or <tt>Clang >=
*3.2</tt>,
* and `CMake`.
*
...
...
libcaf_core/caf/detail/ieee_754.hpp
View file @
70db21f9
...
...
@@ -65,7 +65,7 @@ struct ieee_754_trait<uint64_t> : ieee_754_trait<double> {};
template
<
class
T
>
typename
ieee_754_trait
<
T
>::
packed_type
pack754
(
T
f
)
{
typedef
ieee_754_trait
<
T
>
trait
;
// using trait = ... fails on GCC 4.7
using
trait
=
ieee_754_trait
<
T
>
;
using
result_type
=
typename
trait
::
packed_type
;
// filter special type
if
(
std
::
fabs
(
f
)
<=
trait
::
zero
)
{
...
...
@@ -106,7 +106,7 @@ typename ieee_754_trait<T>::packed_type pack754(T f) {
template
<
class
T
>
typename
ieee_754_trait
<
T
>::
float_type
unpack754
(
T
i
)
{
typedef
ieee_754_trait
<
T
>
trait
;
// using trait = ... fails on GCC 4.7
using
trait
=
ieee_754_trait
<
T
>
;
using
signed_type
=
typename
trait
::
signed_packed_type
;
using
result_type
=
typename
trait
::
float_type
;
if
(
i
==
0
)
return
trait
::
zero
;
...
...
libcaf_core/caf/detail/singletons.hpp
View file @
70db21f9
...
...
@@ -89,7 +89,7 @@ class singletons {
static
std
::
atomic
<
abstract_singleton
*>&
get_plugin_singleton
(
size_t
id
);
// Get instance from @p ptr or crate it on-the-fly using DCLP
// Get instance from @p ptr or cr
e
ate it on-the-fly using DCLP
template
<
class
T
,
class
Factory
>
static
T
*
lazy_get
(
std
::
atomic
<
T
*>&
ptr
,
std
::
mutex
&
mtx
,
Factory
f
)
{
auto
result
=
ptr
.
load
(
std
::
memory_order_acquire
);
...
...
libcaf_core/caf/detail/split_join.hpp
View file @
70db21f9
...
...
@@ -49,16 +49,14 @@ class split_join_collector : public event_based_actor {
behavior
make_behavior
()
override
{
return
{
others
>>
[
=
]
{
m_rp
=
this
->
make_response_promise
();
m_split
(
m_workset
,
this
->
current_message
());
m_rp
=
make_response_promise
();
m_split
(
m_workset
,
current_message
());
// first message is the forwarded request
// GCC 4.7 workaround; `for (auto& x : m_workset)` doesn't compile
for
(
size_t
i
=
0
;
i
<
m_workset
.
size
();
++
i
)
{
auto
&
x
=
m_workset
[
i
];
this
->
sync_send
(
x
.
first
,
std
::
move
(
x
.
second
)).
then
(
for
(
auto
&
x
:
m_workset
)
{
sync_send
(
x
.
first
,
std
::
move
(
x
.
second
)).
then
(
others
>>
[
=
]
{
m_join
(
m_value
,
this
->
current_message
());
if
(
--
this
->
m_awaited_results
==
0
)
{
if
(
--
m_awaited_results
==
0
)
{
m_rp
.
deliver
(
make_message
(
m_value
));
quit
();
}
...
...
@@ -66,7 +64,7 @@ class split_join_collector : public event_based_actor {
);
}
// no longer needed
this
->
m_workset
.
clear
();
m_workset
.
clear
();
}
};
}
...
...
libcaf_core/caf/policy/work_stealing.hpp
View file @
70db21f9
...
...
@@ -193,7 +193,7 @@ class work_stealing {
template
<
class
Worker
,
class
UnaryFunction
>
void
foreach_resumable
(
Worker
*
self
,
UnaryFunction
f
)
{
auto
next
=
[
&
]
{
return
this
->
d
(
self
).
queue
.
take_head
();
};
auto
next
=
[
&
]
{
return
d
(
self
).
queue
.
take_head
();
};
for
(
auto
job
=
next
();
job
!=
nullptr
;
job
=
next
())
{
f
(
job
);
}
...
...
libcaf_core/src/abstract_coordinator.cpp
View file @
70db21f9
...
...
@@ -67,7 +67,7 @@ inline void insert_dmsg(Map& storage, const duration& d, Ts&&... xs) {
auto
tout
=
hrc
::
now
();
tout
+=
d
;
delayed_msg
dmsg
{
std
::
forward
<
Ts
>
(
xs
)...};
storage
.
insert
(
std
::
make_pair
(
std
::
move
(
tout
),
std
::
move
(
dmsg
)
));
storage
.
emplace
(
std
::
move
(
tout
),
std
::
move
(
dmsg
));
}
class
timer_actor
:
public
blocking_actor
{
...
...
@@ -165,7 +165,7 @@ void printer_loop(blocking_actor* self) {
}
auto
i
=
out
.
find
(
s
);
if
(
i
==
out
.
end
())
{
i
=
out
.
insert
(
make_pair
(
s
,
std
::
move
(
str
)
)).
first
;
i
=
out
.
emplace
(
s
,
move
(
str
)).
first
;
// monitor actor to flush its output on exit
self
->
monitor
(
s
);
}
else
{
...
...
libcaf_core/src/actor_registry.cpp
View file @
70db21f9
...
...
@@ -64,10 +64,10 @@ void actor_registry::put(actor_id key, const abstract_actor_ptr& val) {
if
(
val
==
nullptr
)
{
return
;
}
auto
entry
=
std
::
make_pair
(
key
,
value_type
(
val
,
exit_reason
::
not_exited
));
{
// lifetime scope of guard
exclusive_guard
guard
(
m_instances_mtx
);
if
(
!
m_entries
.
insert
(
entry
).
second
)
{
if
(
!
m_entries
.
emplace
(
key
,
value_type
{
val
,
exit_reason
::
not_exited
}).
second
)
{
// already defined
return
;
}
...
...
libcaf_core/src/group_manager.cpp
View file @
70db21f9
...
...
@@ -335,7 +335,7 @@ class local_group_module : public abstract_group::module {
}
auto
tmp
=
make_counted
<
local_group
>
(
true
,
this
,
identifier
);
upgrade_to_unique_guard
uguard
(
guard
);
auto
p
=
m_instances
.
insert
(
make_pair
(
identifier
,
tmp
)
);
auto
p
=
m_instances
.
emplace
(
identifier
,
tmp
);
auto
result
=
p
.
first
->
second
;
uguard
.
unlock
();
// someone might preempt us
...
...
@@ -365,7 +365,7 @@ class local_group_module : public abstract_group::module {
local_group_ptr
tmp
=
make_counted
<
local_group_proxy
>
(
broker
,
this
,
identifier
);
upgrade_to_unique_guard
uguard
(
guard
);
auto
p
=
m_proxies
.
insert
(
std
::
make_pair
(
broker
,
tmp
)
);
auto
p
=
m_proxies
.
emplace
(
broker
,
tmp
);
// someone might preempt us
return
{
p
.
first
->
second
};
}
...
...
@@ -443,7 +443,7 @@ group_manager::~group_manager() {
group_manager
::
group_manager
()
{
abstract_group
::
unique_module_ptr
ptr
{
new
local_group_module
};
m_mmap
.
insert
(
std
::
make_pair
(
std
::
string
(
"local"
),
std
::
move
(
ptr
)
));
m_mmap
.
emplace
(
std
::
string
(
"local"
),
std
::
move
(
ptr
));
}
group
group_manager
::
anonymous
()
{
...
...
@@ -471,7 +471,7 @@ void group_manager::add_module(std::unique_ptr<abstract_group::module> mptr) {
auto
&
mname
=
mptr
->
name
();
{
// lifetime scope of guard
std
::
lock_guard
<
std
::
mutex
>
guard
(
m_mmap_mtx
);
if
(
m_mmap
.
insert
(
std
::
make_pair
(
mname
,
std
::
move
(
mptr
)
)).
second
)
{
if
(
m_mmap
.
emplace
(
mname
,
std
::
move
(
mptr
)).
second
)
{
return
;
// success; don't throw
}
}
...
...
libcaf_core/src/local_actor.cpp
View file @
70db21f9
...
...
@@ -420,8 +420,7 @@ struct pending_response_predicate {
message_id
local_actor
::
new_request_id
(
message_priority
mp
)
{
auto
result
=
++
m_last_request_id
;
m_pending_responses
.
push_front
(
std
::
make_pair
(
result
.
response_id
(),
behavior
{}));
m_pending_responses
.
emplace_front
(
result
.
response_id
(),
behavior
{});
return
mp
==
message_priority
::
normal
?
result
:
result
.
with_high_priority
();
}
...
...
@@ -484,7 +483,7 @@ void local_actor::launch(execution_unit* eu, bool lazy, bool hide) {
scheduler
::
inc_detached_threads
();
}
//intrusive_ptr<local_actor> mself{this};
std
::
thread
(
[
hide
](
intrusive_ptr
<
local_actor
>
mself
)
{
std
::
thread
{
[
hide
](
intrusive_ptr
<
local_actor
>
mself
)
{
// this extra scope makes sure that the trace logger is
// destructed before dec_detached_threads() is called
{
...
...
@@ -501,7 +500,7 @@ void local_actor::launch(execution_unit* eu, bool lazy, bool hide) {
if
(
!
hide
)
{
scheduler
::
dec_detached_threads
();
}
},
intrusive_ptr
<
local_actor
>
{
this
}
)
.
detach
();
},
intrusive_ptr
<
local_actor
>
{
this
}
}
.
detach
();
return
;
}
// actor is cooperatively scheduled
...
...
libcaf_core/src/logging.cpp
View file @
70db21f9
...
...
@@ -78,7 +78,7 @@ class logging_impl : public logging {
public:
void
initialize
()
override
{
const
char
*
log_level_table
[]
=
{
"ERROR"
,
"WARN"
,
"INFO"
,
"DEBUG"
,
"TRACE"
};
m_thread
=
std
::
thread
([
this
]
{
(
*
this
)();
})
;
m_thread
=
std
::
thread
{[
this
]
{
(
*
this
)();
}}
;
std
::
string
msg
=
"ENTRY log level = "
;
msg
+=
log_level_table
[
global_log_level
];
log
(
"TRACE"
,
"logging"
,
"run"
,
__FILE__
,
__LINE__
,
msg
);
...
...
@@ -217,7 +217,7 @@ actor_id logging::set_aid(actor_id aid) {
}
// upgrade to unique lock and insert new element
upgrade_to_unique_lock
<
detail
::
shared_spinlock
>
uguard
{
guard
};
m_aids
.
insert
(
std
::
make_pair
(
tid
,
aid
)
);
m_aids
.
emplace
(
tid
,
aid
);
return
0
;
// was empty before
}
...
...
libcaf_core/src/memory.cpp
View file @
70db21f9
...
...
@@ -66,7 +66,7 @@ cache_map& get_cache_map() {
pthread_setspecific
(
s_key
,
cache
);
// insert default types
std
::
unique_ptr
<
memory_cache
>
tmp
(
new
basic_memory_cache
<
mailbox_element
>
);
cache
->
insert
(
std
::
make_pair
(
&
typeid
(
mailbox_element
),
move
(
tmp
)
));
cache
->
emplace
(
&
typeid
(
mailbox_element
),
move
(
tmp
));
}
return
*
cache
;
}
...
...
libcaf_core/src/run_program.cpp
View file @
70db21f9
...
...
@@ -36,7 +36,7 @@ std::thread caf::detail::run_program_impl(actor rc, const char* cpath,
}
oss
<<
" 2>&1"
;
string
cmdstr
=
oss
.
str
();
return
thread
(
[
cmdstr
,
rc
]
{
return
std
::
thread
{
[
cmdstr
,
rc
]
{
string
output
;
auto
fp
=
popen
(
cmdstr
.
c_str
(),
"r"
);
if
(
!
fp
)
{
...
...
@@ -50,5 +50,5 @@ std::thread caf::detail::run_program_impl(actor rc, const char* cpath,
}
pclose
(
fp
);
anon_send
(
rc
,
output
);
}
)
;
}
}
;
}
libcaf_core/src/string_serialization.cpp
View file @
70db21f9
...
...
@@ -312,12 +312,12 @@ class string_deserializer : public deserializer, public dummy_backend {
void
operator
()(
atom_value
&
what
)
{
what
=
static_cast
<
atom_value
>
(
detail
::
atom_val
(
str
.
c_str
(),
0xF
));
}
void
operator
()(
u16string
&
)
{
void
operator
()
[[
noreturn
]]
(
u16string
&
)
{
throw
std
::
runtime_error
(
"u16string currently not supported "
"by string_deserializer"
);
}
void
operator
()(
u32string
&
)
{
void
operator
()
[[
noreturn
]]
(
u32string
&
)
{
throw
std
::
runtime_error
(
"u32string currently not supported "
"by string_deserializer"
);
...
...
@@ -452,7 +452,7 @@ class string_deserializer : public deserializer, public dummy_backend {
++
m_pos
;
}
void
throw_malformed
(
const
string
&
error_msg
)
{
void
throw_malformed
[[
noreturn
]]
(
const
string
&
error_msg
)
{
throw
std
::
runtime_error
(
"malformed string: "
+
error_msg
);
}
...
...
libcaf_core/test/serialization.cpp
View file @
70db21f9
...
...
@@ -197,7 +197,7 @@ struct is_message {
template
<
class
T
,
class
...
Ts
>
bool
equal
(
T
&&
v
,
Ts
&&
...
vs
)
{
bool
ok
=
false
;
// work around for gcc bug
// work around for gcc
4.8.4
bug
auto
tup
=
tie
(
v
,
vs
...);
message_handler
impl
{
[
&
](
T
const
&
u
,
Ts
const
&
...
us
)
{
...
...
libcaf_io/caf/io/broker.hpp
View file @
70db21f9
...
...
@@ -241,14 +241,14 @@ class broker : public abstract_event_based_actor<behavior, false> {
m_scribes
.
erase
(
i
);
return
spawn_functor
(
nullptr
,
[
sptr
](
broker
*
forked
)
{
sptr
->
set_broker
(
forked
);
forked
->
m_scribes
.
insert
(
std
::
make_pair
(
sptr
->
hdl
(),
sptr
)
);
forked
->
m_scribes
.
emplace
(
sptr
->
hdl
(),
sptr
);
},
fun
,
hdl
,
std
::
forward
<
Ts
>
(
xs
)...);
}
inline
void
add_scribe
(
const
scribe_pointer
&
ptr
)
{
m_scribes
.
insert
(
std
::
make_pair
(
ptr
->
hdl
(),
ptr
)
);
m_scribes
.
emplace
(
ptr
->
hdl
(),
ptr
);
}
connection_handle
add_tcp_scribe
(
const
std
::
string
&
host
,
uint16_t
port
);
...
...
@@ -258,7 +258,7 @@ class broker : public abstract_event_based_actor<behavior, false> {
connection_handle
add_tcp_scribe
(
network
::
native_socket
fd
);
inline
void
add_doorman
(
const
doorman_pointer
&
ptr
)
{
m_doormen
.
insert
(
std
::
make_pair
(
ptr
->
hdl
(),
ptr
)
);
m_doormen
.
emplace
(
ptr
->
hdl
(),
ptr
);
if
(
is_initialized
())
{
ptr
->
launch
();
}
...
...
libcaf_io/caf/io/middleman.hpp
View file @
70db21f9
...
...
@@ -70,7 +70,7 @@ class middleman : public detail::abstract_singleton {
auto
result
=
make_counted
<
Impl
>
(
*
this
);
CAF_ASSERT
(
result
->
unique
());
result
->
launch
(
nullptr
,
false
,
true
);
m_named_brokers
.
insert
(
std
::
make_pair
(
name
,
result
)
);
m_named_brokers
.
emplace
(
name
,
result
);
return
result
;
}
...
...
libcaf_io/caf/io/spawn_io.hpp
View file @
70db21f9
...
...
@@ -59,6 +59,7 @@ actor spawn_io_client(F fun, const std::string& host,
// works around an issue with older GCC releases that could not handle
// variadic template parameter packs inside lambdas by storing into a
// std::function first (using `auto init =` won't compile on Clang)
// This bug still exsist in GCC 4.8.4
auto
mfptr
=
&
broker
::
functor_based
::
init
<
F
,
connection_handle
,
Ts
...
>
;
using
bi
=
std
::
function
<
void
(
broker
::
functor_based
*
,
F
,
connection_handle
)
>
;
using
namespace
std
::
placeholders
;
...
...
libcaf_io/src/basp_broker.cpp
View file @
70db21f9
...
...
@@ -800,8 +800,8 @@ void basp_broker::add_published_actor(accept_handle hdl,
if
(
!
ptr
)
{
return
;
}
m_acceptors
.
insert
(
std
::
make_pair
(
hdl
,
std
::
make_pair
(
ptr
,
port
)
));
m_open_ports
.
insert
(
std
::
make_pair
(
port
,
hdl
)
);
m_acceptors
.
emplace
(
hdl
,
std
::
make_pair
(
ptr
,
port
));
m_open_ports
.
emplace
(
port
,
hdl
);
ptr
->
attach_functor
([
port
](
abstract_actor
*
self
,
uint32_t
)
{
unpublish_impl
(
self
->
address
(),
port
,
false
);
});
...
...
libcaf_io/src/middleman.cpp
View file @
70db21f9
...
...
@@ -257,7 +257,7 @@ class middleman_actor_impl : public middleman_actor_base::base {
auto
req_id
=
m_next_request_id
++
;
send
(
m_broker
,
get_atom
::
value
,
hdl
,
req_id
,
actor
{
this
},
std
::
move
(
expected_ifs
));
m_pending_gets
.
insert
(
std
::
make_pair
(
req_id
,
result
)
);
m_pending_gets
.
emplace
(
req_id
,
result
);
}
catch
(
network_error
&
err
)
{
// fullfil promise immediately
...
...
@@ -273,7 +273,7 @@ class middleman_actor_impl : public middleman_actor_base::base {
auto
result
=
make_response_promise
();
auto
req_id
=
m_next_request_id
++
;
send
(
m_broker
,
delete_atom
::
value
,
req_id
,
whom
,
port
);
m_pending_deletes
.
insert
(
std
::
make_pair
(
req_id
,
result
)
);
m_pending_deletes
.
emplace
(
req_id
,
result
);
return
result
;
}
...
...
@@ -344,10 +344,10 @@ void middleman::initialize() {
CAF_LOG_TRACE
(
""
);
m_backend
=
network
::
multiplexer
::
make
();
m_backend_supervisor
=
m_backend
->
make_supervisor
();
m_thread
=
std
::
thread
(
[
this
]
{
m_thread
=
std
::
thread
{
[
this
]
{
CAF_LOG_TRACE
(
""
);
m_backend
->
run
();
}
)
;
}
}
;
m_backend
->
thread_id
(
m_thread
.
get_id
());
// announce io-related types
do_announce
<
new_data_msg
>
(
"caf::io::new_data_msg"
);
...
...
libcaf_io/test/uniform_type.cpp
View file @
70db21f9
...
...
@@ -83,7 +83,7 @@ bool check_types(const std::map<std::string, uint16_t>& expected) {
// fetch all available type names
auto
types
=
uniform_type_info
::
instances
();
for
(
auto
tinfo
:
types
)
{
found
.
insert
(
std
::
make_pair
(
tinfo
->
name
(),
tinfo
->
type_nr
()
));
found
.
emplace
(
tinfo
->
name
(),
tinfo
->
type_nr
(
));
}
// compare the two maps
if
(
expected
==
found
)
{
...
...
@@ -127,7 +127,7 @@ T& append(T& storage) {
template
<
class
T
,
typename
U
,
class
...
Us
>
T
&
append
(
T
&
storage
,
U
&&
u
,
Us
&&
...
us
)
{
storage
.
insert
(
std
::
make_pair
(
std
::
forward
<
U
>
(
u
),
uint16_t
{
0
})
);
storage
.
emplace
(
std
::
forward
<
U
>
(
u
),
uint16_t
{
0
}
);
return
append
(
storage
,
std
::
forward
<
Us
>
(
us
)...);
}
...
...
@@ -144,11 +144,11 @@ CAF_TEST(test_uniform_type) {
CAF_CHECK
(
announce1
==
announce2
);
CAF_CHECK
(
announce1
==
announce3
);
CAF_CHECK
(
announce1
==
announce4
);
//CAF_CHECK_EQUAL(announce1->name(), "foo"); // fails ...
CAF_CHECK
(
strcmp
(
announce1
->
name
(),
"foo"
)
==
0
);
{
auto
uti
=
uniform_typeid
<
atom_value
>
();
CAF_CHECK
(
uti
!=
nullptr
);
//CAF_CHECK_EQUAL(uti->name(), "@atom"); // fails...
CAF_CHECK
(
strcmp
(
uti
->
name
(),
"@atom"
)
==
0
);
}
using
detail
::
type_nr
;
// these types (and only those) are present if
...
...
libcaf_test/caf/test/unit_test_impl.hpp
View file @
70db21f9
...
...
@@ -44,7 +44,7 @@ class watchdog {
private:
watchdog
()
{
m_thread
=
std
::
thread
(
[
&
]
{
m_thread
=
std
::
thread
{
[
&
]
{
auto
tp
=
std
::
chrono
::
high_resolution_clock
::
now
()
+
std
::
chrono
::
seconds
(
30
);
std
::
unique_lock
<
std
::
mutex
>
guard
{
m_mtx
};
...
...
@@ -57,7 +57,7 @@ class watchdog {
<<
"WATCHDOG: unit test did finish within 10s, abort
\n
"
;
abort
();
}
}
)
;
}
}
;
}
~
watchdog
()
{
{
// lifetime scope of guard
...
...
@@ -148,7 +148,7 @@ logger::stream::stream(logger& l, level lvl) : m_logger(l), m_level(lvl) {
logger
::
stream
::
stream
(
stream
&&
other
)
:
m_logger
(
other
.
m_logger
)
,
m_level
(
other
.
m_level
)
{
// ostringstream does have swap since C++11... but not in GCC 4.
7
// ostringstream does have swap since C++11... but not in GCC 4.
8.4
m_buf
.
str
(
other
.
m_buf
.
str
());
}
...
...
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