Commit c11d8467 authored by Dominik Charousset's avatar Dominik Charousset

added local_actor::joined_groups

parent ef4f4349
...@@ -297,6 +297,11 @@ class local_actor : public actor { ...@@ -297,6 +297,11 @@ class local_actor : public actor {
*/ */
virtual void on_exit(); virtual void on_exit();
/**
* @brief Returns all joined groups of this actor.
*/
std::vector<group_ptr> joined_groups();
// library-internal members and member functions that shall // library-internal members and member functions that shall
// not appear in the documentation // not appear in the documentation
......
...@@ -94,4 +94,12 @@ void local_actor::leave(const group_ptr& what) { ...@@ -94,4 +94,12 @@ void local_actor::leave(const group_ptr& what) {
if (what) m_subscriptions.erase(what); if (what) m_subscriptions.erase(what);
} }
std::vector<group_ptr> local_actor::joined_groups() {
std::vector<group_ptr> result;
for (auto& kvp : m_subscriptions) {
result.emplace_back(kvp.first);
}
return result;
}
} // namespace cppa } // namespace cppa
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment