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
594858b8
Commit
594858b8
authored
Mar 30, 2011
by
neverlord
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
group
parent
6886fd45
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
63 additions
and
0 deletions
+63
-0
cppa/group.hpp
cppa/group.hpp
+49
-0
src/group.cpp
src/group.cpp
+14
-0
No files found.
cppa/group.hpp
0 → 100644
View file @
594858b8
#ifndef GROUP_HPP
#define GROUP_HPP
#include "cppa/channel.hpp"
#include "cppa/ref_counted.hpp"
namespace
cppa
{
class
group
:
public
channel
{
protected:
virtual
void
unsubscribe
(
const
channel_ptr
&
who
)
=
0
;
public:
class
subscription
;
friend
class
group
::
subscription
;
// NOT thread safe
class
subscription
:
public
ref_counted
{
channel_ptr
m_self
;
intrusive_ptr
<
group
>
m_group
;
subscription
()
=
delete
;
subscription
(
const
subscription
&
)
=
delete
;
subscription
&
operator
=
(
const
subscription
&
)
=
delete
;
public:
subscription
(
const
channel_ptr
&
s
,
const
intrusive_ptr
<
group
>&
g
);
virtual
~
subscription
();
};
virtual
intrusive_ptr
<
subscription
>
subscribe
(
const
channel_ptr
&
who
)
=
0
;
};
typedef
intrusive_ptr
<
group
>
group_ptr
;
}
// namespace cppa
#endif // GROUP_HPP
src/group.cpp
0 → 100644
View file @
594858b8
#include "cppa/group.hpp"
namespace
cppa
{
group
::
subscription
::
subscription
(
const
channel_ptr
&
s
,
const
intrusive_ptr
<
group
>&
g
)
:
m_self
(
s
),
m_group
(
g
)
{
}
group
::
subscription
::~
subscription
()
{
m_group
->
unsubscribe
(
m_self
);
}
}
// namespace cppa
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