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
66190667
Commit
66190667
authored
Nov 05, 2011
by
neverlord
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed obsolete matcher_arguments
parent
9524070a
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
55 additions
and
110 deletions
+55
-110
Makefile.am
Makefile.am
+0
-2
cppa/detail/matcher_arguments.hpp
cppa/detail/matcher_arguments.hpp
+0
-52
cppa/detail/pattern_details.hpp
cppa/detail/pattern_details.hpp
+44
-31
src/matcher_arguments.cpp
src/matcher_arguments.cpp
+0
-17
src/yielding_message_queue.cpp
src/yielding_message_queue.cpp
+11
-7
unit_testing/main.cpp
unit_testing/main.cpp
+0
-1
No files found.
Makefile.am
View file @
66190667
...
...
@@ -35,7 +35,6 @@ libcppa_la_SOURCES = \
src/invokable.cpp
\
src/invoke_rules.cpp
\
src/mailman.cpp
\
src/matcher_arguments.cpp
\
src/message_queue.cpp
\
src/mock_scheduler.cpp
\
src/native_socket.cpp
\
...
...
@@ -109,7 +108,6 @@ nobase_library_include_HEADERS = \
cppa/detail/list_member.hpp
\
cppa/detail/mailman.hpp
\
cppa/detail/map_member.hpp
\
cppa/detail/matcher_arguments.hpp
\
cppa/detail/mock_scheduler.hpp
\
cppa/detail/native_socket.hpp
\
cppa/detail/network_manager.hpp
\
...
...
cppa/detail/matcher_arguments.hpp
deleted
100644 → 0
View file @
9524070a
#ifndef MATCHER_ARGUMENTS_HPP
#define MATCHER_ARGUMENTS_HPP
#include <vector>
#include "cppa/util/any_tuple_iterator.hpp"
namespace
cppa
{
namespace
detail
{
struct
matcher_arguments
{
util
::
any_tuple_iterator
iter
;
std
::
vector
<
size_t
>*
mapping
;
matcher_arguments
(
const
any_tuple
&
tup
,
std
::
vector
<
size_t
>*
mv
=
nullptr
);
matcher_arguments
(
util
::
any_tuple_iterator
tuple_iterator
,
std
::
vector
<
size_t
>*
mv
=
nullptr
);
matcher_arguments
(
const
matcher_arguments
&
)
=
default
;
matcher_arguments
&
operator
=
(
const
matcher_arguments
&
)
=
default
;
inline
bool
at_end
()
const
;
inline
matcher_arguments
&
next
();
inline
bool
push_mapping
();
};
inline
bool
matcher_arguments
::
at_end
()
const
{
return
iter
.
at_end
();
}
inline
matcher_arguments
&
matcher_arguments
::
next
()
{
iter
.
next
();
return
*
this
;
}
inline
bool
matcher_arguments
::
push_mapping
()
{
if
(
mapping
)
mapping
->
push_back
(
iter
.
position
());
return
true
;
}
}
}
// namespace cppa::detail
#endif // MATCHER_ARGUMENTS_HPP
cppa/detail/pattern_details.hpp
View file @
66190667
...
...
@@ -187,57 +187,70 @@ struct tuple_iterator_arg
template
<
typename
VectorType
>
bool
do_match
(
pattern_arg
&
pargs
,
tuple_iterator_arg
<
VectorType
>&
targs
)
{
if
(
pargs
.
at_end
()
&&
targs
.
at_end
()
)
for
(;;
)
{
return
true
;
}
if
(
pargs
.
type
()
==
nullptr
)
// nullptr == wildcard
{
// perform submatching
pargs
.
next
();
if
(
pargs
.
at_end
())
if
(
pargs
.
at_end
()
&&
targs
.
at_end
())
{
// always true at the end of the pattern
return
true
;
}
auto
pargs_copy
=
pargs
;
VectorType
mv
;
auto
mv_ptr
=
(
targs
.
mapping
)
?
&
mv
:
nullptr
;
// iterate over tu_args until we found a match
while
(
targs
.
at_end
()
==
false
)
else
if
(
pargs
.
type
()
==
nullptr
)
// nullptr == wildcard (anything)
{
tuple_iterator_arg
<
VectorType
>
targs_copy
(
targs
.
iter
,
mv_ptr
);
if
(
do_match
(
pargs_copy
,
targs_copy
))
// perform submatching
pargs
.
next
();
if
(
pargs
.
at_end
())
{
if
(
mv_ptr
)
// always true at the end of the pattern
return
true
;
}
auto
pargs_copy
=
pargs
;
VectorType
mv
;
auto
mv_ptr
=
(
targs
.
mapping
)
?
&
mv
:
nullptr
;
// iterate over tu_args until we found a match
while
(
targs
.
at_end
()
==
false
)
{
tuple_iterator_arg
<
VectorType
>
targs_copy
(
targs
.
iter
,
mv_ptr
);
if
(
do_match
(
pargs_copy
,
targs_copy
))
{
targs
.
mapping
->
insert
(
targs
.
mapping
->
end
(),
mv
.
begin
(),
mv
.
end
());
if
(
mv_ptr
)
{
targs
.
mapping
->
insert
(
targs
.
mapping
->
end
(),
mv
.
begin
(),
mv
.
end
());
}
return
true
;
}
return
true
;
// next iteration
mv
.
clear
();
targs
.
next
();
}
// next iteration
mv
.
clear
();
targs
.
next
();
// no successfull submatch found
return
false
;
}
}
else
{
// compare types
if
(
targs
.
at_end
()
==
false
&&
pargs
.
type
()
==
targs
.
type
())
else
if
(
targs
.
at_end
()
==
false
&&
pargs
.
type
()
==
targs
.
type
())
{
// compare values if needed
if
(
pargs
.
has_value
()
==
false
||
pargs
.
type
()
->
equal
(
pargs
.
value
(),
targs
.
value
()))
{
targs
.
push_mapping
();
// submatch
return
do_match
(
pargs
.
next
(),
targs
.
next
());
// ok, go to next iteration
}
else
{
// values didn't match
return
false
;
}
}
else
{
// no match
return
false
;
}
// next iteration
pargs
.
next
();
targs
.
next
();
}
return
false
;
}
}
}
// namespace cppa::detail
...
...
src/matcher_arguments.cpp
deleted
100644 → 0
View file @
9524070a
#include "cppa/detail/matcher_arguments.hpp"
namespace
cppa
{
namespace
detail
{
matcher_arguments
::
matcher_arguments
(
util
::
any_tuple_iterator
tuple_iterator
,
std
::
vector
<
size_t
>*
mv
)
:
iter
(
tuple_iterator
),
mapping
(
mv
)
{
}
matcher_arguments
::
matcher_arguments
(
const
any_tuple
&
tup
,
std
::
vector
<
size_t
>*
mv
)
:
iter
(
tup
),
mapping
(
mv
)
{
}
}
}
// namespace cppa::detail
src/yielding_message_queue.cpp
View file @
66190667
...
...
@@ -170,7 +170,9 @@ bool yielding_message_queue_impl::dequeue_impl(any_tuple& storage)
// dequeue next message
return
false
;
}
storage
=
std
::
move
(
node
->
msg
);
m_last_dequeued
=
std
::
move
(
node
->
msg
);
m_last_sender
=
std
::
move
(
node
->
sender
);
storage
=
m_last_dequeued
;
return
true
;
}
...
...
@@ -194,7 +196,8 @@ yielding_message_queue_impl::dq(std::unique_ptr<queue_node>& node,
auto
imd
=
rules
.
get_intermediate
(
node
->
msg
);
if
(
imd
)
{
m_last_dequeued
=
node
->
msg
;
m_last_dequeued
=
std
::
move
(
node
->
msg
);
m_last_sender
=
std
::
move
(
node
->
sender
);
// restore mailbox before invoking imd
if
(
!
buffer
.
empty
())
m_queue
.
push_front
(
std
::
move
(
buffer
));
imd
->
invoke
();
...
...
@@ -221,6 +224,7 @@ bool yielding_message_queue_impl::dequeue_impl(timed_invoke_rules& rules,
switch
(
dq
(
node
,
rules
,
buffer
))
{
case
done
:
{
if
(
m_has_pending_timeout_request
)
{
// expire pending request
...
...
@@ -228,14 +232,14 @@ bool yielding_message_queue_impl::dequeue_impl(timed_invoke_rules& rules,
m_has_pending_timeout_request
=
false
;
}
return
true
;
}
case
timeout_occured
:
rules
.
handle_timeout
();
{
m_has_pending_timeout_request
=
false
;
rules
.
handle_timeout
();
return
true
;
case
indeterminate
:
return
false
;
}
default:
break
;
}
return
false
;
}
...
...
unit_testing/main.cpp
View file @
66190667
...
...
@@ -29,7 +29,6 @@
// header for experimental stuff
#include "cppa/util/filter_type_list.hpp"
#include "cppa/util/any_tuple_iterator.hpp"
#include "cppa/detail/matcher_arguments.hpp"
#define CPPA_TEST_CATCH_BLOCK() \
catch (std::exception& e) \
...
...
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