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
7c9b8cf5
Commit
7c9b8cf5
authored
Feb 17, 2012
by
neverlord
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
iterator interface
parent
ff1724f7
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
63 additions
and
51 deletions
+63
-51
cppa/detail/matches.hpp
cppa/detail/matches.hpp
+12
-6
cppa/detail/types_array.hpp
cppa/detail/types_array.hpp
+2
-2
cppa/pattern.hpp
cppa/pattern.hpp
+1
-43
cppa/type_value_pair.hpp
cppa/type_value_pair.hpp
+48
-0
No files found.
cppa/detail/matches.hpp
View file @
7c9b8cf5
...
...
@@ -234,8 +234,11 @@ bool matches(std::integral_constant<int, 0>,
// compare values only (types are guaranteed to be equal)
for
(
auto
i
=
tpl
.
begin
();
i
!=
end
;
++
i
,
++
j
)
{
if
(
j
->
second
!=
nullptr
&&
i
->
first
->
equals
(
i
->
second
,
j
->
second
)
==
false
)
return
false
;
if
(
j
.
value
()
!=
nullptr
&&
i
.
type
()
->
equals
(
i
.
value
(),
j
.
value
())
==
false
)
{
return
false
;
}
}
}
}
...
...
@@ -246,9 +249,12 @@ bool matches(std::integral_constant<int, 0>,
// compares type and value
for
(
auto
i
=
tpl
.
begin
();
i
!=
end
;
++
i
,
++
j
)
{
if
(
i
->
first
!=
j
->
first
||
(
j
->
second
!=
nullptr
&&
i
->
first
->
equals
(
i
->
second
,
j
->
second
)
==
false
))
return
false
;
if
(
i
.
type
()
!=
j
.
type
()
||
(
j
.
value
()
!=
nullptr
&&
i
.
type
()
->
equals
(
i
.
value
(),
j
.
value
())
==
false
))
{
return
false
;
}
}
}
else
...
...
@@ -256,7 +262,7 @@ bool matches(std::integral_constant<int, 0>,
// compares the types only
for
(
auto
i
=
tpl
.
begin
();
i
!=
end
;
++
i
,
++
j
)
{
if
(
i
->
first
!=
j
->
first
)
return
false
;
if
(
i
.
type
()
!=
j
.
type
()
)
return
false
;
}
}
}
...
...
cppa/detail/types_array.hpp
View file @
7c9b8cf5
...
...
@@ -77,7 +77,7 @@ struct types_array_impl
{
return
data
[
p
];
}
typedef
type_value_pair
const
*
const_iterator
;
typedef
type_value_pair
_const_iterator
const_iterator
;
inline
const_iterator
begin
()
const
{
return
pairs
;
}
inline
const_iterator
end
()
const
{
return
pairs
+
sizeof
...(
T
);
}
};
...
...
@@ -121,7 +121,7 @@ struct types_array_impl<false, T...>
}
return
result
;
}
typedef
type_value_pair
const
*
const_iterator
;
typedef
type_value_pair
_const_iterator
const_iterator
;
inline
const_iterator
begin
()
const
{
auto
result
=
pairs
.
load
();
...
...
cppa/pattern.hpp
View file @
7c9b8cf5
...
...
@@ -84,50 +84,8 @@ class pattern
typedef
util
::
fixed_vector
<
size_t
,
filtered_types
::
size
>
mapping_vector
;
class
const_iterator
{
type_value_pair
const
*
iter
;
public:
const_iterator
(
type_value_pair
const
*
i
)
:
iter
(
i
)
{
}
const_iterator
(
const_iterator
const
&
)
=
default
;
inline
uniform_type_info
const
*
type
()
const
{
return
iter
->
first
;
}
inline
void
const
*
value
()
const
{
return
iter
->
second
;
}
inline
decltype
(
iter
)
operator
->
()
{
return
iter
;
}
inline
decltype
(
*
iter
)
operator
*
()
{
return
*
iter
;
}
inline
const_iterator
&
operator
++
()
{
++
iter
;
return
*
this
;
}
inline
const_iterator
&
operator
--
()
{
--
iter
;
return
*
this
;
}
inline
bool
operator
==
(
const_iterator
const
&
other
)
const
{
return
iter
==
other
.
iter
;
}
inline
bool
operator
!=
(
const_iterator
const
&
other
)
const
{
return
iter
!=
other
.
iter
;
}
};
typedef
type_value_pair_const_iterator
const_iterator
;
//typedef type_value_pair const* const_iterator;
const_iterator
begin
()
const
{
return
m_ptrs
;
}
...
...
cppa/type_value_pair.hpp
View file @
7c9b8cf5
...
...
@@ -37,6 +37,54 @@ namespace cppa {
typedef
std
::
pair
<
uniform_type_info
const
*
,
void
const
*>
type_value_pair
;
class
type_value_pair_const_iterator
{
type_value_pair
const
*
iter
;
public:
type_value_pair_const_iterator
(
type_value_pair
const
*
i
)
:
iter
(
i
)
{
}
type_value_pair_const_iterator
(
type_value_pair_const_iterator
const
&
)
=
default
;
inline
uniform_type_info
const
*
type
()
const
{
return
iter
->
first
;
}
inline
void
const
*
value
()
const
{
return
iter
->
second
;
}
inline
decltype
(
iter
)
operator
->
()
{
return
iter
;
}
inline
decltype
(
*
iter
)
operator
*
()
{
return
*
iter
;
}
inline
type_value_pair_const_iterator
&
operator
++
()
{
++
iter
;
return
*
this
;
}
inline
type_value_pair_const_iterator
&
operator
--
()
{
--
iter
;
return
*
this
;
}
inline
type_value_pair_const_iterator
operator
+
(
size_t
offset
)
{
return
iter
+
offset
;
}
inline
bool
operator
==
(
type_value_pair_const_iterator
const
&
other
)
const
{
return
iter
==
other
.
iter
;
}
inline
bool
operator
!=
(
type_value_pair_const_iterator
const
&
other
)
const
{
return
iter
!=
other
.
iter
;
}
};
}
// namespace cppa
#endif // TYPE_VALUE_PAIR_HPP
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