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
4b517a33
Commit
4b517a33
authored
Dec 19, 2011
by
neverlord
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changed attachable to pure interface
parent
9e460ecd
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
42 additions
and
25 deletions
+42
-25
cppa/actor.hpp
cppa/actor.hpp
+6
-1
cppa/attachable.hpp
cppa/attachable.hpp
+2
-2
cppa/group.hpp
cppa/group.hpp
+4
-2
src/attachable.cpp
src/attachable.cpp
+7
-7
src/group.cpp
src/group.cpp
+15
-10
src/scheduler.cpp
src/scheduler.cpp
+7
-0
unit_testing/test__spawn.cpp
unit_testing/test__spawn.cpp
+1
-3
No files found.
cppa/actor.hpp
View file @
4b517a33
...
...
@@ -225,11 +225,16 @@ class functor_attachable : public attachable
{
}
v
irtual
v
oid
detach
(
std
::
uint32_t
reason
)
void
detach
(
std
::
uint32_t
reason
)
{
m_functor
(
reason
);
}
bool
matches
(
const
attachable
::
token
&
)
{
return
false
;
}
};
template
<
typename
F
>
...
...
cppa/attachable.hpp
View file @
4b517a33
...
...
@@ -39,9 +39,9 @@ class attachable
*
* The default implementation does nothing.
*/
virtual
void
detach
(
std
::
uint32_t
reason
);
virtual
void
detach
(
std
::
uint32_t
reason
)
=
0
;
virtual
bool
matches
(
const
token
&
);
virtual
bool
matches
(
const
token
&
)
=
0
;
};
...
...
cppa/group.hpp
View file @
4b517a33
...
...
@@ -51,11 +51,13 @@ class group : public channel
unsubscriber
(
const
channel_ptr
&
s
,
const
intrusive_ptr
<
group
>&
g
);
~
unsubscriber
();
void
detach
(
std
::
uint32_t
);
// matches on m_group
bool
matches
(
const
attachable
::
token
&
what
);
virtual
~
unsubscriber
();
};
typedef
std
::
unique_ptr
<
unsubscriber
>
subscription
;
...
...
src/attachable.cpp
View file @
4b517a33
...
...
@@ -6,13 +6,13 @@ attachable::~attachable()
{
}
void
attachable
::
detach
(
std
::
uint32_t
)
{
}
//
void attachable::detach(std::uint32_t)
//
{
//
}
bool
attachable
::
matches
(
const
attachable
::
token
&
)
{
return
false
;
}
//
bool attachable::matches(const attachable::token&)
//
{
//
return false;
//
}
}
// namespace cppa::detail
src/group.cpp
View file @
4b517a33
...
...
@@ -27,7 +27,21 @@ group::unsubscriber::unsubscriber(const channel_ptr& s,
group
::
unsubscriber
::~
unsubscriber
()
{
if
(
m_group
)
m_group
->
unsubscribe
(
m_self
);
if
(
m_group
&&
m_self
)
m_group
->
unsubscribe
(
m_self
);
}
void
group
::
unsubscriber
::
detach
(
std
::
uint32_t
)
{
// unsubscription is done in destructor
}
bool
group
::
unsubscriber
::
matches
(
const
attachable
::
token
&
what
)
{
if
(
what
.
subtype
==
typeid
(
group
::
unsubscriber
))
{
return
m_group
==
reinterpret_cast
<
const
group
*>
(
what
.
ptr
);
}
return
false
;
}
group
::
module
::
module
(
const
std
::
string
&
name
)
:
m_name
(
name
)
...
...
@@ -43,15 +57,6 @@ const std::string& group::module::name()
return
m_name
;
}
bool
group
::
unsubscriber
::
matches
(
const
attachable
::
token
&
what
)
{
if
(
what
.
subtype
==
typeid
(
group
::
unsubscriber
))
{
return
m_group
==
reinterpret_cast
<
const
group
*>
(
what
.
ptr
);
}
return
false
;
}
group
::
group
(
std
::
string
&&
id
,
std
::
string
&&
mod_name
)
:
m_identifier
(
std
::
move
(
id
)),
m_module_name
(
std
::
move
(
mod_name
))
{
...
...
src/scheduler.cpp
View file @
4b517a33
...
...
@@ -24,6 +24,13 @@ struct exit_observer : cppa::attachable
{
cppa
::
detail
::
dec_actor_count
();
}
void
detach
(
std
::
uint32_t
)
{
}
bool
matches
(
const
token
&
)
{
return
false
;
}
};
}
// namespace <anonymous>
...
...
unit_testing/test__spawn.cpp
View file @
4b517a33
...
...
@@ -25,11 +25,9 @@ using namespace cppa;
// GCC 4.7 supports non-static member initialization
#if (__GNUC__ >= 4) && (__GNUC_MINOR__ >= 7)
class
event_testee
:
public
fsm_actor
<
event_testee
>
struct
event_testee
:
public
fsm_actor
<
event_testee
>
{
friend
class
fsm_actor
<
event_testee
>
;
invoke_rules
wait4string
=
(
on
<
std
::
string
>
()
>>
[
=
]()
...
...
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