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
32de80f3
Commit
32de80f3
authored
Jun 05, 2012
by
neverlord
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clang compatibility
parent
e555bc8f
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
75 additions
and
75 deletions
+75
-75
cppa/detail/actor_proxy_cache.hpp
cppa/detail/actor_proxy_cache.hpp
+3
-2
cppa/detail/default_uniform_type_info_impl.hpp
cppa/detail/default_uniform_type_info_impl.hpp
+1
-1
cppa/detail/empty_tuple.hpp
cppa/detail/empty_tuple.hpp
+3
-1
cppa/detail/matches.hpp
cppa/detail/matches.hpp
+1
-1
cppa/detail/value_guard.hpp
cppa/detail/value_guard.hpp
+4
-8
cppa/get.hpp
cppa/get.hpp
+1
-1
cppa/primitive_variant.hpp
cppa/primitive_variant.hpp
+15
-14
cppa/util/type_list.hpp
cppa/util/type_list.hpp
+7
-7
cppa/util/void_type.hpp
cppa/util/void_type.hpp
+3
-10
examples/announce_example_1.cpp
examples/announce_example_1.cpp
+1
-1
src/scheduler.cpp
src/scheduler.cpp
+3
-1
src/singleton_manager.cpp
src/singleton_manager.cpp
+2
-0
unit_testing/test.hpp
unit_testing/test.hpp
+1
-1
unit_testing/test__atom.cpp
unit_testing/test__atom.cpp
+7
-9
unit_testing/test__primitive_variant.cpp
unit_testing/test__primitive_variant.cpp
+12
-5
unit_testing/test__serialization.cpp
unit_testing/test__serialization.cpp
+5
-3
unit_testing/test__uniform_type.cpp
unit_testing/test__uniform_type.cpp
+0
-4
unit_testing/test__yield_interface.cpp
unit_testing/test__yield_interface.cpp
+6
-6
No files found.
cppa/detail/actor_proxy_cache.hpp
View file @
32de80f3
...
...
@@ -60,8 +60,9 @@ class actor_proxy_cache {
std
::
uint32_t
process_id
,
Fun
fun
)
{
key_tuple
lb
{
nid
,
process_id
,
std
::
numeric_limits
<
actor_id
>::
min
()};
key_tuple
ub
{
nid
,
process_id
,
std
::
numeric_limits
<
actor_id
>::
max
()};
{
lock_guard
<
util
::
shared_spinlock
>
guard
{
m_lock
};
key_tuple
ub
{
nid
,
process_id
,
std
::
numeric_limits
<
actor_id
>::
max
()};
{
// lifetime scope of guard
lock_guard
<
util
::
shared_spinlock
>
guard
(
m_lock
);
auto
e
=
m_entries
.
end
();
auto
first
=
m_entries
.
lower_bound
(
lb
);
if
(
first
!=
e
)
{
...
...
cppa/detail/default_uniform_type_info_impl.hpp
View file @
32de80f3
...
...
@@ -266,7 +266,7 @@ class default_uniform_type_info_impl : public util::abstract_uniform_type_info<T
template
<
typename
R
,
class
C
,
typename
...
Args
>
typename
std
::
enable_if
<
is_invalid
<
R
>::
value
>::
type
push_back
(
R
C
::*
mem_ptr
,
Args
&&
...
args
)
{
push_back
(
R
C
::*
,
Args
&&
...
)
{
static_assert
(
util
::
is_primitive
<
R
>::
value
,
"T is neither a primitive type nor a "
"stl-compliant list/map"
);
...
...
cppa/detail/empty_tuple.hpp
View file @
32de80f3
...
...
@@ -35,7 +35,9 @@
namespace
cppa
{
namespace
detail
{
struct
empty_tuple
:
abstract_tuple
{
class
empty_tuple
:
public
abstract_tuple
{
public:
using
abstract_tuple
::
const_iterator
;
...
...
cppa/detail/matches.hpp
View file @
32de80f3
...
...
@@ -343,7 +343,7 @@ struct match_impl<wildcard_position::multiple, Tuple, Ts...> {
};
template
<
class
Tuple
,
class
List
>
class
match_impl_from_type_list
;
struct
match_impl_from_type_list
;
template
<
class
Tuple
,
typename
...
Ts
>
struct
match_impl_from_type_list
<
Tuple
,
util
::
type_list
<
Ts
...
>
>
{
...
...
cppa/detail/value_guard.hpp
View file @
32de80f3
...
...
@@ -31,6 +31,8 @@
#ifndef VALUE_GUARD_HPP
#define VALUE_GUARD_HPP
#include <type_traits>
#include "cppa/util/rm_ref.hpp"
#include "cppa/util/void_type.hpp"
#include "cppa/util/type_list.hpp"
...
...
@@ -69,12 +71,6 @@ class value_guard {
return
true
;
}
template
<
class
Tail
,
typename
Arg0
,
typename
...
Args
>
static
inline
bool
_eval
(
const
util
::
void_type
&
,
const
Tail
&
tail
,
const
Arg0
&
,
const
Args
&
...
args
)
{
return
_eval
(
tail
.
head
,
tail
.
tail
(),
args
...);
}
template
<
typename
T0
,
typename
T1
>
static
inline
bool
cmp
(
const
T0
&
lhs
,
const
T1
&
rhs
)
{
return
lhs
==
rhs
;
...
...
@@ -85,8 +81,8 @@ class value_guard {
return
lhs
==
rhs
.
get
();
}
template
<
typename
Head
,
class
Tail
,
typename
Arg0
,
typename
...
Args
>
static
inline
bool
_eval
(
const
Head
&
head
,
const
Tail
&
tail
,
template
<
typename
Head
,
typename
Tail0
,
typename
...
Tail
,
typename
Arg0
,
typename
...
Args
>
static
inline
bool
_eval
(
const
Head
&
head
,
const
tdata
<
Tail0
,
Tail
...
>
&
tail
,
const
Arg0
&
arg0
,
const
Args
&
...
args
)
{
return
cmp
(
head
,
arg0
)
&&
_eval
(
tail
.
head
,
tail
.
tail
(),
args
...);
}
...
...
cppa/get.hpp
View file @
32de80f3
...
...
@@ -40,7 +40,7 @@ namespace cppa {
// forward declaration of details
namespace
detail
{
template
<
typename
...
>
class
tdata
;
template
<
typename
...
>
struct
tdata
;
template
<
typename
...
>
struct
pseudo_tuple
;
}
...
...
cppa/primitive_variant.hpp
View file @
32de80f3
...
...
@@ -33,6 +33,7 @@
#include <new>
#include <cstdint>
#include <typeinfo>
#include <stdexcept>
#include <type_traits>
...
...
@@ -102,20 +103,20 @@ class primitive_variant {
};
// use static call dispatching to select member
inline
decltype
(
i8
)
&
get
(
util
::
pt_token
<
pt_int8
>
)
{
return
i8
;
}
inline
decltype
(
i16
)
&
get
(
util
::
pt_token
<
pt_int16
>
)
{
return
i16
;
}
inline
decltype
(
i32
)
&
get
(
util
::
pt_token
<
pt_int32
>
)
{
return
i32
;
}
inline
decltype
(
i64
)
&
get
(
util
::
pt_token
<
pt_int64
>
)
{
return
i64
;
}
inline
decltype
(
u8
)
&
get
(
util
::
pt_token
<
pt_uint8
>
)
{
return
u8
;
}
inline
decltype
(
u16
)
&
get
(
util
::
pt_token
<
pt_uint16
>
)
{
return
u16
;
}
inline
decltype
(
u32
)
&
get
(
util
::
pt_token
<
pt_uint32
>
)
{
return
u32
;
}
inline
decltype
(
u64
)
&
get
(
util
::
pt_token
<
pt_uint64
>
)
{
return
u64
;
}
inline
decltype
(
fl
)
&
get
(
util
::
pt_token
<
pt_float
>
)
{
return
fl
;
}
inline
decltype
(
db
)
&
get
(
util
::
pt_token
<
pt_double
>
)
{
return
db
;
}
inline
decltype
(
ldb
)
&
get
(
util
::
pt_token
<
pt_long_double
>
)
{
return
ldb
;
}
inline
decltype
(
s8
)
&
get
(
util
::
pt_token
<
pt_u8string
>
)
{
return
s8
;
}
inline
decltype
(
s16
)
&
get
(
util
::
pt_token
<
pt_u16string
>
)
{
return
s16
;
}
inline
decltype
(
s32
)
&
get
(
util
::
pt_token
<
pt_u32string
>
)
{
return
s32
;
}
inline
auto
get
(
util
::
pt_token
<
pt_int8
>
)
->
decltype
(
i8
)
&
{
return
i8
;
}
inline
auto
get
(
util
::
pt_token
<
pt_int16
>
)
->
decltype
(
i16
)
&
{
return
i16
;
}
inline
auto
get
(
util
::
pt_token
<
pt_int32
>
)
->
decltype
(
i32
)
&
{
return
i32
;
}
inline
auto
get
(
util
::
pt_token
<
pt_int64
>
)
->
decltype
(
i64
)
&
{
return
i64
;
}
inline
auto
get
(
util
::
pt_token
<
pt_uint8
>
)
->
decltype
(
u8
)
&
{
return
u8
;
}
inline
auto
get
(
util
::
pt_token
<
pt_uint16
>
)
->
decltype
(
u16
)
&
{
return
u16
;
}
inline
auto
get
(
util
::
pt_token
<
pt_uint32
>
)
->
decltype
(
u32
)
&
{
return
u32
;
}
inline
auto
get
(
util
::
pt_token
<
pt_uint64
>
)
->
decltype
(
u64
)
&
{
return
u64
;
}
inline
auto
get
(
util
::
pt_token
<
pt_float
>
)
->
decltype
(
fl
)
&
{
return
fl
;
}
inline
auto
get
(
util
::
pt_token
<
pt_double
>
)
->
decltype
(
db
)
&
{
return
db
;
}
inline
auto
get
(
util
::
pt_token
<
pt_long_double
>
)
->
decltype
(
ldb
)
&
{
return
ldb
;
}
inline
auto
get
(
util
::
pt_token
<
pt_u8string
>
)
->
decltype
(
s8
)
&
{
return
s8
;
}
inline
auto
get
(
util
::
pt_token
<
pt_u16string
>
)
->
decltype
(
s16
)
&
{
return
s16
;
}
inline
auto
get
(
util
::
pt_token
<
pt_u32string
>
)
->
decltype
(
s32
)
&
{
return
s32
;
}
// get(...) const overload
template
<
primitive_type
PT
>
...
...
cppa/util/type_list.hpp
View file @
32de80f3
...
...
@@ -385,8 +385,8 @@ struct tl_binary_forall {
template
<
class
List
,
template
<
typename
>
class
Predicate
>
struct
tl_exists
{
static
constexpr
bool
value
=
Predicate
<
class
List
::
head
>::
value
||
tl_exists
<
class
List
::
tail
,
Predicate
>::
value
;
Predicate
<
typename
List
::
head
>::
value
||
tl_exists
<
typename
List
::
tail
,
Predicate
>::
value
;
};
template
<
template
<
typename
>
class
Predicate
>
...
...
@@ -402,8 +402,8 @@ struct tl_exists<type_list<>, Predicate> {
*/
template
<
class
List
,
template
<
typename
>
class
Predicate
>
struct
tl_count
{
static
constexpr
size_t
value
=
(
Predicate
<
class
List
::
head
>::
value
?
1
:
0
)
+
tl_count
<
class
List
::
tail
,
Predicate
>::
value
;
static
constexpr
size_t
value
=
(
Predicate
<
typename
List
::
head
>::
value
?
1
:
0
)
+
tl_count
<
typename
List
::
tail
,
Predicate
>::
value
;
};
template
<
template
<
typename
>
class
Predicate
>
...
...
@@ -418,8 +418,8 @@ struct tl_count<type_list<>, Predicate> {
*/
template
<
class
List
,
template
<
typename
>
class
Predicate
>
struct
tl_count_not
{
static
constexpr
size_t
value
=
(
Predicate
<
class
List
::
head
>::
value
?
0
:
1
)
+
tl_count_not
<
class
List
::
tail
,
Predicate
>::
value
;
static
constexpr
size_t
value
=
(
Predicate
<
typename
List
::
head
>::
value
?
0
:
1
)
+
tl_count_not
<
typename
List
::
tail
,
Predicate
>::
value
;
};
template
<
template
<
typename
>
class
Predicate
>
...
...
@@ -837,7 +837,7 @@ struct tl_is_zipped {
template
<
class
List
,
typename
What
=
void_type
>
struct
tl_trim
{
typedef
typename
util
::
if_else
<
std
::
is_same
<
class
List
::
back
,
What
>
,
std
::
is_same
<
typename
List
::
back
,
What
>
,
typename
tl_trim
<
typename
tl_pop_back
<
List
>::
type
,
What
>::
type
,
util
::
wrapped
<
List
>
>::
type
...
...
cppa/util/void_type.hpp
View file @
32de80f3
...
...
@@ -33,23 +33,16 @@
namespace
cppa
{
namespace
util
{
// forward declaration
template
<
typename
...
Types
>
struct
type_list
;
struct
void_type
{
typedef
void_type
head
;
typedef
type_list
<>
tail
;
constexpr
void_type
()
{
}
constexpr
void_type
(
const
void_type
&
)
{
}
void_type
&
operator
=
(
const
void_type
&
)
=
default
;
// anything could be used to initialize a void...
template
<
typename
Arg
0
,
typename
...
Args
>
void_type
(
Arg0
&&
,
Args
&&
...
)
{
}
template
<
typename
Arg
>
constexpr
void_type
(
const
Arg
&
)
{
}
};
inline
bool
operator
==
(
const
void_type
&
,
const
void_type
&
)
{
return
true
;
}
inline
bool
operator
!=
(
const
void_type
&
,
const
void_type
&
)
{
return
false
;
}
}
}
// namespace cppa::util
...
...
examples/announce_example_1.cpp
View file @
32de80f3
...
...
@@ -43,7 +43,7 @@ int main(int, char**) {
assert
(
announce
<
foo_pair2
>
(
&
foo_pair2
::
first
,
&
foo_pair2
::
second
)
==
false
);
// send a foo to ourselves
send
(
self
,
foo
{
{
1
,
2
,
3
,
4
},
5
});
send
(
self
,
foo
{
std
::
vector
<
int
>
{
1
,
2
,
3
,
4
},
5
});
// send a foo_pair2 to ourselves
send
(
self
,
foo_pair2
{
3
,
4
});
// quits the program
...
...
src/scheduler.cpp
View file @
32de80f3
...
...
@@ -64,7 +64,9 @@ struct exit_observer : cppa::attachable {
namespace
cppa
{
struct
scheduler_helper
{
class
scheduler_helper
{
public:
typedef
intrusive_ptr
<
detail
::
converted_thread_context
>
ptr_type
;
...
...
src/singleton_manager.cpp
View file @
32de80f3
...
...
@@ -72,6 +72,7 @@ void stop_and_kill(std::atomic<T*>& ptr) {
}
}
/*
void delete_singletons() {
if (self.unchecked() != nullptr) {
try { self.unchecked()->quit(exit_reason::normal); }
...
...
@@ -91,6 +92,7 @@ void delete_singletons() {
if (et && !et->deref()) delete et;
delete s_uniform_type_info_map.load();
}
*/
template
<
typename
T
>
T
*
lazy_get
(
std
::
atomic
<
T
*>&
ptr
,
bool
register_atexit_fun
=
false
)
{
...
...
unit_testing/test.hpp
View file @
32de80f3
...
...
@@ -30,7 +30,7 @@ template<typename T1, typename T2>
inline
bool
cppa_check_value_fun
(
const
T1
&
value1
,
const
T2
&
value2
,
char
const
*
file_name
,
int
line_number
,
size_t
&
error_count
)
{
size_t
&
error_count
)
{
if
(
cppa_check_value_fun_eq
(
value1
,
value2
)
==
false
)
{
std
::
cerr
<<
"ERROR in file "
<<
file_name
<<
" on line "
<<
line_number
<<
" => expected value: "
<<
value1
...
...
unit_testing/test__atom.cpp
View file @
32de80f3
...
...
@@ -6,6 +6,12 @@
#include "cppa/cppa.hpp"
namespace
cppa
{
inline
std
::
ostream
&
operator
<<
(
std
::
ostream
&
out
,
const
atom_value
&
a
)
{
return
(
out
<<
to_string
(
a
));
}
}
using
std
::
cout
;
using
std
::
endl
;
using
std
::
string
;
...
...
@@ -13,15 +19,7 @@ using std::string;
using
namespace
cppa
;
using
namespace
cppa
::
util
;
namespace
{
constexpr
auto
s_foo
=
atom
(
"FooBar"
);
inline
std
::
ostream
&
operator
<<
(
std
::
ostream
&
out
,
const
atom_value
&
a
)
{
return
(
out
<<
to_string
(
a
));
}
}
// namespace <anonymous>
namespace
{
constexpr
auto
s_foo
=
atom
(
"FooBar"
);
}
template
<
atom_value
AtomValue
,
typename
...
Types
>
void
foo
()
{
...
...
unit_testing/test__primitive_variant.cpp
View file @
32de80f3
...
...
@@ -2,8 +2,6 @@
#include "cppa/primitive_variant.hpp"
using
namespace
cppa
;
namespace
{
struct
streamer
{
...
...
@@ -13,16 +11,25 @@ struct streamer {
void
operator
()(
const
T
&
value
)
{
o
<<
value
;
}
void
operator
()(
const
std
::
u16string
&
)
{
}
void
operator
()(
const
std
::
u32string
&
)
{
}
};
inline
std
::
ostream
&
operator
<<
(
std
::
ostream
&
o
,
const
cppa
::
primitive_variant
&
pv
)
{
}
// namespace <anonymous>
namespace
cppa
{
inline
std
::
ostream
&
operator
<<
(
std
::
ostream
&
o
,
const
primitive_variant
&
pv
)
{
streamer
s
{
o
};
pv
.
apply
(
s
);
return
o
;
}
}
// namespace cppa
}
// namespace <anonymous>
using
namespace
cppa
;
size_t
test__primitive_variant
()
{
CPPA_TEST
(
test__primitive_variant
);
...
...
unit_testing/test__serialization.cpp
View file @
32de80f3
...
...
@@ -87,8 +87,10 @@ bool operator!=(const struct_b& lhs, const struct_b& rhs) {
return
!
(
lhs
==
rhs
);
}
typedef
std
::
map
<
std
::
string
,
std
::
u16string
>
strmap
;
struct
struct_c
{
st
d
::
map
<
std
::
string
,
std
::
u16string
>
strings
;
st
rmap
strings
;
std
::
set
<
int
>
ints
;
};
...
...
@@ -213,7 +215,7 @@ size_t test__serialization() {
&
struct_b
::
z
,
&
struct_b
::
ints
);
// testees
struct_b
b1
=
{
{
1
,
2
},
3
,
{
4
,
5
,
6
,
7
,
8
,
9
,
10
}
};
struct_b
b1
=
{
{
1
,
2
},
3
,
std
::
list
<
int
>
{
4
,
5
,
6
,
7
,
8
,
9
,
10
}
};
struct_b
b2
;
struct_b
b3
;
// expected result of to_string(&b1, meta_b)
...
...
@@ -245,7 +247,7 @@ size_t test__serialization() {
// get meta type of struct_c and "announce"
announce
<
struct_c
>
(
&
struct_c
::
strings
,
&
struct_c
::
ints
);
// testees
struct_c
c1
=
{
{
{
"abc"
,
u"cba"
},
{
"x"
,
u"y"
}
},
{
9
,
4
,
5
}
};
struct_c
c1
{
strmap
{{
"abc"
,
u"cba"
},
{
"x"
,
u"y"
}},
std
::
set
<
int
>
{
9
,
4
,
5
}
};
struct_c
c2
;
{
// serialize c1 to buf
binary_serializer
bs
;
...
...
unit_testing/test__uniform_type.cpp
View file @
32de80f3
...
...
@@ -36,10 +36,6 @@ inline bool operator==(const foo& lhs, const foo& rhs) {
return
lhs
.
value
==
rhs
.
value
;
}
inline
bool
operator
!=
(
const
foo
&
lhs
,
const
foo
&
rhs
)
{
return
!
(
lhs
==
rhs
);
}
}
// namespace <anonymous>
using
namespace
cppa
;
...
...
unit_testing/test__yield_interface.cpp
View file @
32de80f3
...
...
@@ -8,11 +8,7 @@
#include "cppa/util/fiber.hpp"
#include "cppa/detail/yield_interface.hpp"
using
namespace
cppa
;
using
namespace
cppa
::
util
;
using
namespace
cppa
::
detail
;
namespace
{
namespace
cppa
{
namespace
detail
{
std
::
ostream
&
operator
<<
(
std
::
ostream
&
o
,
yield_state
ys
)
{
switch
(
ys
)
{
...
...
@@ -29,7 +25,11 @@ std::ostream& operator<<(std::ostream& o, yield_state ys) {
}
}
}
// namespace <anonymous>
}
}
// namespace cppa::detail
using
namespace
cppa
;
using
namespace
cppa
::
util
;
using
namespace
cppa
::
detail
;
struct
pseudo_worker
{
...
...
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